/* Generated by Cython 0.29.21 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_21" #define CYTHON_HEX_VERSION 0x001D15F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__distributed__scheduler #define __PYX_HAVE_API__distributed__scheduler /* Early includes */ #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "distributed/scheduler.py", "stringsource", }; /*--- Type declarations ---*/ struct __pyx_obj_11distributed_9scheduler_ClientState; struct __pyx_obj_11distributed_9scheduler_WorkerState; struct __pyx_obj_11distributed_9scheduler_TaskPrefix; struct __pyx_obj_11distributed_9scheduler_TaskGroup; struct __pyx_obj_11distributed_9scheduler_TaskState; struct __pyx_obj_11distributed_9scheduler_SchedulerState; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl; struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_check_idle_saturated; struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_get_task_duration; struct __pyx_opt_args_11distributed_9scheduler__add_to_memory; struct __pyx_opt_args_11distributed_9scheduler__task_to_msg; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; struct __pyx_defaults1; typedef struct __pyx_defaults1 __pyx_defaults1; /* "distributed/scheduler.py":2592 * @ccall * @exceptval(check=False) * def check_idle_saturated(self, ws: WorkerState, occ: double = -1.0): # <<<<<<<<<<<<<< * """Update the status of the idle and saturated state * */ struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_check_idle_saturated { int __pyx_n; double occ; }; /* "distributed/scheduler.py":2648 * * @ccall * def get_task_duration(self, ts: TaskState, default: double = -1) -> double: # <<<<<<<<<<<<<< * """ * Get the estimated computation cost of the given task */ struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_get_task_duration { int __pyx_n; double __pyx_default; }; /* "distributed/scheduler.py":6584 * @cfunc * @exceptval(check=False) * def _add_to_memory( # <<<<<<<<<<<<<< * state: SchedulerState, * ts: TaskState, */ struct __pyx_opt_args_11distributed_9scheduler__add_to_memory { int __pyx_n; PyObject *type; PyObject *typename; }; /* "distributed/scheduler.py":6719 * @cfunc * @exceptval(check=False) * def _task_to_msg(state: SchedulerState, ts: TaskState, duration=None) -> dict: # <<<<<<<<<<<<<< * """ Convert a single computational task to a message """ * ws: WorkerState */ struct __pyx_opt_args_11distributed_9scheduler__task_to_msg { int __pyx_n; PyObject *duration; }; struct __pyx_defaults { PyObject *__pyx_arg_kwargs; }; struct __pyx_defaults1 { PyObject *__pyx_arg_default; }; /* "distributed/scheduler.py":193 * @final * @cclass * class ClientState: # <<<<<<<<<<<<<< * """ * A simple object holding information about a client. */ struct __pyx_obj_11distributed_9scheduler_ClientState { PyObject_HEAD PyObject *_client_key; Py_hash_t _hash; PyObject *_wants_what; double _last_seen; PyObject *_versions; }; /* "distributed/scheduler.py":266 * @final * @cclass * class WorkerState: # <<<<<<<<<<<<<< * """ * A simple object holding information about a worker. */ struct __pyx_obj_11distributed_9scheduler_WorkerState { PyObject_HEAD struct __pyx_vtabstruct_11distributed_9scheduler_WorkerState *__pyx_vtab; PyObject *_actors; PyObject *_address; double _bandwidth; PyObject *_executing; PyObject *_extra; PyObject *_has_what; Py_hash_t _hash; double _last_seen; PyObject *_local_directory; Py_ssize_t _memory_limit; PyObject *_metrics; PyObject *_name; PyObject *_nanny; Py_ssize_t _nbytes; Py_ssize_t _nthreads; double _occupancy; Py_ssize_t _pid; PyObject *_processing; PyObject *_resources; PyObject *_services; PyObject *_status; double _time_delay; PyObject *_used_resources; PyObject *_versions; }; /* "distributed/scheduler.py":629 * @final * @cclass * class TaskPrefix: # <<<<<<<<<<<<<< * """Collection tracking all tasks within a group * */ struct __pyx_obj_11distributed_9scheduler_TaskPrefix { PyObject_HEAD PyObject *_name; PyObject *_all_durations; double _duration_average; Py_ssize_t _suspicious; PyObject *_groups; }; /* "distributed/scheduler.py":755 * @final * @cclass * class TaskGroup: # <<<<<<<<<<<<<< * """Collection tracking all tasks within a group * */ struct __pyx_obj_11distributed_9scheduler_TaskGroup { PyObject_HEAD struct __pyx_vtabstruct_11distributed_9scheduler_TaskGroup *__pyx_vtab; PyObject *_name; struct __pyx_obj_11distributed_9scheduler_TaskPrefix *_prefix; PyObject *_states; PyObject *_dependencies; Py_ssize_t _nbytes_total; Py_ssize_t _nbytes_in_memory; double _duration; PyObject *_types; }; /* "distributed/scheduler.py":871 * @final * @cclass * class TaskState: # <<<<<<<<<<<<<< * """ * A simple object holding information about a task. */ struct __pyx_obj_11distributed_9scheduler_TaskState { PyObject_HEAD struct __pyx_vtabstruct_11distributed_9scheduler_TaskState *__pyx_vtab; PyObject *_key; Py_hash_t _hash; struct __pyx_obj_11distributed_9scheduler_TaskPrefix *_prefix; PyObject *_run_spec; PyObject *_priority; PyObject *_state; PyObject *_dependencies; PyObject *_dependents; int _has_lost_dependencies; PyObject *_waiting_on; PyObject *_waiters; PyObject *_who_wants; PyObject *_who_has; struct __pyx_obj_11distributed_9scheduler_WorkerState *_processing_on; Py_ssize_t _retries; Py_ssize_t _nbytes; PyObject *_type; PyObject *_exception; PyObject *_traceback; PyObject *_exception_blame; Py_ssize_t _suspicious; PyObject *_host_restrictions; PyObject *_worker_restrictions; PyObject *_resource_restrictions; int _loose_restrictions; PyObject *_metadata; PyObject *_annotations; int _actor; struct __pyx_obj_11distributed_9scheduler_TaskGroup *_group; PyObject *_group_key; }; /* "distributed/scheduler.py":1534 * * @cclass * class SchedulerState: # <<<<<<<<<<<<<< * """Underlying task state of dynamic scheduler * */ struct __pyx_obj_11distributed_9scheduler_SchedulerState { PyObject_HEAD struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *__pyx_vtab; PyObject *_aliases; double _bandwidth; PyObject *_clients; PyObject *_extensions; PyObject *_host_info; PyObject *_idle; PyObject *_idle_dv; Py_ssize_t _n_tasks; PyObject *_resources; PyObject *_saturated; PyObject *_tasks; PyObject *_task_groups; PyObject *_task_prefixes; PyObject *_task_metadata; Py_ssize_t _total_nthreads; double _total_occupancy; PyObject *_unknown_durations; PyObject *_unrunnable; int _validate; PyObject *_workers; PyObject *_workers_dv; }; /* "distributed/scheduler.py":718 * return merge_with(sum, [tg._states for tg in self.active]) * * def __repr__(self): # <<<<<<<<<<<<<< * return ( * "<" */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self; }; /* "distributed/scheduler.py":724 * + ": " * + ", ".join( * "%s: %d" % (k, v) for (k, v) in sorted(self.states.items()) if v # <<<<<<<<<<<<<< * ) * + ">" */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *__pyx_outer_scope; PyObject *__pyx_v_k; PyObject *__pyx_v_v; }; /* "distributed/scheduler.py":854 * ts._group = self * * def __repr__(self): # <<<<<<<<<<<<<< * return ( * "<" */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self; }; /* "distributed/scheduler.py":860 * + ": " * + ", ".join( * "%s: %d" % (k, v) for (k, v) in sorted(self._states.items()) if v # <<<<<<<<<<<<<< * ) * + ">" */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *__pyx_outer_scope; PyObject *__pyx_v_k; PyObject *__pyx_v_v; }; /* "distributed/scheduler.py":1453 * # For tasks etc. * * def __iter__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * for k, v in self._states.items(): */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ { PyObject_HEAD PyObject *__pyx_v_accessor; PyObject *__pyx_v_k; PyObject *__pyx_v_self; PyObject *__pyx_v_v; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":1459 * yield k * * def __len__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ { PyObject_HEAD PyObject *__pyx_v_accessor; PyObject *__pyx_v_self; }; /* "distributed/scheduler.py":1461 * def __len__(self): * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *__pyx_outer_scope; PyObject *__pyx_v_v; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":1483 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return (k for k, v in self._states.items() if self._accessor(v)) * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ { PyObject_HEAD PyObject *__pyx_v_self; }; /* "distributed/scheduler.py":1484 * * def __iter__(self): * return (k for k, v in self._states.items() if self._accessor(v)) # <<<<<<<<<<<<<< * * def __len__(self): */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *__pyx_outer_scope; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":3232 * return ws.host, port * * async def start(self): # <<<<<<<<<<<<<< * """ Clear out old state and restart all running coroutines """ * await super().start() */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start { PyObject_HEAD PyObject *__pyx_v_addr; PyObject *__pyx_v_c; PyObject *__pyx_v_del_scheduler_file; PyObject *__pyx_v_f; PyObject *__pyx_v_fn; PyObject *__pyx_v_k; PyObject *__pyx_v_listen_ip; PyObject *__pyx_v_listener; PyObject *__pyx_9genexpr32__pyx_v_plugin; PyObject *__pyx_v_preload; PyObject *__pyx_v_self; PyObject *__pyx_v_v; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "distributed/scheduler.py":3293 * return self * * async def close(self, comm=None, fast=False, close_workers=False): # <<<<<<<<<<<<<< * """Send cleanup signal to all coroutines then wait until finished * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close { PyObject_HEAD PyObject *__pyx_v_close_workers; PyObject *__pyx_v_comm; PyObject *__pyx_v_ext; PyObject *__pyx_v_fast; PyObject *__pyx_v_future; PyObject *__pyx_v_futures; long __pyx_v_i; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_pc; PyObject *__pyx_9genexpr33__pyx_v_plugin; PyObject *__pyx_v_preload; PyObject *__pyx_v_self; PyObject *__pyx_v_w; PyObject *__pyx_v_worker; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); long __pyx_t_3; }; /* "distributed/scheduler.py":3358 * disable_gc_diagnosis() * * async def close_worker(self, comm=None, worker=None, safe=None): # <<<<<<<<<<<<<< * """Remove a worker from the cluster * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker { PyObject_HEAD PyObject *__pyx_v_address; PyObject *__pyx_v_comm; PyObject *__pyx_v_nanny_addr; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_safe; PyObject *__pyx_v_self; PyObject *__pyx_v_worker; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; }; /* "distributed/scheduler.py":3454 * } * * async def add_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker { PyObject_HEAD PyObject *__pyx_v_address; PyObject *__pyx_9genexpr36__pyx_v_c; PyObject *__pyx_v_comm; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_9genexpr36__pyx_v_cs; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs; PyObject *__pyx_v_e; PyObject *__pyx_v_extra; PyObject *__pyx_v_host; PyObject *__pyx_v_host_info; PyObject *__pyx_v_key; PyObject *__pyx_v_keys; PyObject *__pyx_v_local_directory; PyObject *__pyx_v_memory_limit; PyObject *__pyx_v_metrics; PyObject *__pyx_v_msg; PyObject *__pyx_v_name; PyObject *__pyx_v_nanny; PyObject *__pyx_v_nbytes; PyObject *__pyx_v_now; PyObject *__pyx_v_nthreads; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_pid; PyObject *__pyx_v_plugin; PyObject *__pyx_v_recommendations; PyObject *__pyx_v_resolve_address; PyObject *__pyx_v_resources; PyObject *__pyx_v_response; PyObject *__pyx_v_result; PyObject *__pyx_v_self; PyObject *__pyx_v_services; PyObject *__pyx_v_tasks; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; PyObject *__pyx_v_types; PyObject *__pyx_v_valid; PyObject *__pyx_v_version_warning; PyObject *__pyx_v_versions; PyObject *__pyx_9genexpr35__pyx_v_w; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr35__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7; PyObject *__pyx_t_8; PyObject *__pyx_t_9; }; /* "distributed/scheduler.py":3659 * ) * * def update_graph( # <<<<<<<<<<<<<< * self, * client=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph { PyObject_HEAD PyObject *__pyx_v_annotations; PyObject *__pyx_v_child_deps; PyObject *__pyx_v_deps; PyObject *__pyx_v_done; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_tasks; }; /* "distributed/scheduler.py":3702 * for k, deps in list(dependencies.items()): * if any( * dep not in parent._tasks and dep not in tasks for dep in deps # <<<<<<<<<<<<<< * ): # bad key * logger.info("User asked for computation on lost data, %s", k) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *__pyx_outer_scope; PyObject *__pyx_v_dep; }; /* "distributed/scheduler.py":3738 * else: * child_deps = self.dependencies[dep] * if all(d in done for d in child_deps): # <<<<<<<<<<<<<< * if dep in parent._tasks and dep not in done: * done.add(dep) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *__pyx_outer_scope; PyObject *__pyx_v_d; }; /* "distributed/scheduler.py":3797 * if "allow_other_workers" in annotations: * loose_restrictions.extend( * k for k, v in annotations["allow_other_workers"].items() if v # <<<<<<<<<<<<<< * ) * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *__pyx_outer_scope; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":4083 * return tuple(seen) * * async def remove_worker(self, comm=None, address=None, safe=False, close=True): # <<<<<<<<<<<<<< * """ * Remove worker from cluster */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker { PyObject_HEAD PyObject *__pyx_v_address; PyObject *__pyx_v_cleanup_delay; PyObject *__pyx_v_close; PyObject *__pyx_v_comm; PyObject *__pyx_v_e; PyObject *__pyx_v_host; PyObject *__pyx_v_k; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_plugin; PyObject *__pyx_v_r; PyObject *__pyx_v_recommendations; PyObject *__pyx_v_remove_worker_from_events; PyObject *__pyx_v_result; PyObject *__pyx_v_safe; PyObject *__pyx_v_self; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; PyObject *__pyx_v_w; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; PyObject *__pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); }; /* "distributed/scheduler.py":4208 * self.cancel_key(key, client, force=force) * * def cancel_key(self, key, client, retries=5, force=False): # <<<<<<<<<<<<<< * """ Cancel a particular key and all dependents """ * # TODO: this should be converted to use the transition mechanism */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key { PyObject_HEAD PyObject *__pyx_v_client; PyObject *__pyx_v_key; PyObject *__pyx_v_retries; PyObject *__pyx_v_self; }; /* "distributed/scheduler.py":4366 * raise * * def validate_state(self, allow_overlap=False): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * validate_state(parent._tasks, parent._workers, parent._clients) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr47__pyx_v_ws; }; /* "distributed/scheduler.py":4398 * a = {w: ws._nbytes for w, ws in parent._workers_dv.items()} * b = { * w: sum(ts.get_nbytes() for ts in ws._has_what) # <<<<<<<<<<<<<< * for w, ws in parent._workers_dv.items() * } */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *__pyx_outer_scope; PyObject *__pyx_v_ts; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":4459 * logger.critical("Tried writing to closed comm: %s", msg) * * async def add_client(self, comm, client=None, versions=None): # <<<<<<<<<<<<<< * """Add client to network * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client { PyObject_HEAD PyObject *__pyx_v_bcomm; PyObject *__pyx_v_client; PyObject *__pyx_v_comm; PyObject *__pyx_v_e; PyObject *__pyx_v_msg; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_plugin; PyObject *__pyx_v_self; PyObject *__pyx_v_version_warning; PyObject *__pyx_v_versions; PyObject *__pyx_9genexpr51__pyx_v_w; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr51__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; PyObject *__pyx_t_7; PyObject *__pyx_t_8; PyObject *__pyx_t_9; PyObject *__pyx_t_10; char const *__pyx_t_11; }; /* "distributed/scheduler.py":4508 * pass * * def remove_client(self, client=None): # <<<<<<<<<<<<<< * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client { PyObject_HEAD PyObject *__pyx_v_client; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_self; }; /* "distributed/scheduler.py":4651 * self.check_idle_saturated(ws) * * async def handle_worker(self, comm=None, worker=None): # <<<<<<<<<<<<<< * """ * Listen to responses from a single worker */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker { PyObject_HEAD PyObject *__pyx_v_comm; PyObject *__pyx_v_self; PyObject *__pyx_v_worker; PyObject *__pyx_v_worker_comm; int __pyx_t_0; int __pyx_t_1; char const *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; PyObject *__pyx_t_7; PyObject *__pyx_t_8; }; /* "distributed/scheduler.py":4672 * await self.remove_worker(address=worker) * * def add_plugin(self, plugin=None, idempotent=False, **kwargs): # <<<<<<<<<<<<<< * """ * Add external plugin to scheduler */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin { PyObject_HEAD PyObject *__pyx_v_plugin; PyObject *__pyx_v_self; }; /* "distributed/scheduler.py":4681 * plugin = plugin(self, **kwargs) * * if idempotent and any(isinstance(p, type(plugin)) for p in self.plugins): # <<<<<<<<<<<<<< * return * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *__pyx_outer_scope; PyObject *__pyx_v_p; }; /* "distributed/scheduler.py":4741 * ############################ * * async def scatter( # <<<<<<<<<<<<<< * self, * comm=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter { PyObject_HEAD PyObject *__pyx_v_broadcast; PyObject *__pyx_v_client; PyObject *__pyx_v_comm; PyObject *__pyx_v_data; PyObject *__pyx_v_keys; PyObject *__pyx_v_n; PyObject *__pyx_v_nbytes; PyObject *__pyx_v_nthreads; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_self; PyObject *__pyx_v_start; PyObject *__pyx_v_timeout; PyObject *__pyx_9genexpr55__pyx_v_w; PyObject *__pyx_9genexpr56__pyx_v_w; PyObject *__pyx_9genexpr57__pyx_v_w; PyObject *__pyx_v_who_has; PyObject *__pyx_v_workers; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr55__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; }; /* "distributed/scheduler.py":4790 * return keys * * async def gather(self, comm=None, keys=None, serializers=None): # <<<<<<<<<<<<<< * """ Collect data in from workers """ * parent: SchedulerState = cast(SchedulerState, self) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather { PyObject_HEAD PyObject *__pyx_v_comm; PyObject *__pyx_v_data; PyObject *__pyx_9genexpr59__pyx_v_key; PyObject *__pyx_v_key; PyObject *__pyx_v_keys; PyObject *__pyx_v_missing_keys; PyObject *__pyx_v_missing_states; PyObject *__pyx_v_missing_workers; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_result; PyObject *__pyx_v_self; PyObject *__pyx_v_serializers; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; PyObject *__pyx_v_who_has; PyObject *__pyx_9genexpr60__pyx_v_worker; PyObject *__pyx_v_worker; PyObject *__pyx_v_workers; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr58__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; }; /* "distributed/scheduler.py":4858 * collection.clear() * * async def restart(self, client=None, timeout=3): # <<<<<<<<<<<<<< * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart { PyObject_HEAD PyObject *__pyx_9genexpr62__pyx_v_addr; PyObject *__pyx_v_addr; PyObject *__pyx_v_c; PyObject *__pyx_v_client; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs; PyObject *__pyx_v_e; PyObject *__pyx_v_genexpr; Py_ssize_t __pyx_v_n_workers; PyObject *__pyx_v_nannies; PyObject *__pyx_9genexpr64__pyx_v_nanny; PyObject *__pyx_9genexpr66__pyx_v_nanny; PyObject *__pyx_9genexpr67__pyx_v_nanny; PyObject *__pyx_9genexpr63__pyx_v_nanny_address; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_plugin; PyObject *__pyx_v_resps; PyObject *__pyx_v_self; PyObject *__pyx_v_start; PyObject *__pyx_v_timeout; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr61__pyx_v_ts; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr62__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6; PyObject *__pyx_t_7; PyObject *__pyx_t_8; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11; PyObject *__pyx_t_12; char const *__pyx_t_13; }; /* "distributed/scheduler.py":4918 * ) * else: * if not all(resp == "OK" for resp in resps): # <<<<<<<<<<<<<< * logger.error( * "Not all workers responded positively: %s", resps, exc_info=True */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *__pyx_outer_scope; PyObject *__pyx_v_resp; }; /* "distributed/scheduler.py":4938 * self.report({"op": "restart"}) * * async def broadcast( # <<<<<<<<<<<<<< * self, * comm=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast { PyObject_HEAD PyObject *__pyx_9genexpr69__pyx_v_address; PyObject *__pyx_v_addresses; PyObject *__pyx_v_comm; PyObject *__pyx_v_host; PyObject *__pyx_v_hosts; PyObject *__pyx_v_msg; PyObject *__pyx_v_nanny; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_results; PyObject *__pyx_v_self; PyObject *__pyx_v_send_message; PyObject *__pyx_v_serializers; PyObject *__pyx_9genexpr68__pyx_v_w; PyObject *__pyx_v_workers; }; /* "distributed/scheduler.py":4965 * addresses = workers * * async def send_message(addr): # <<<<<<<<<<<<<< * comm = await self.rpc.connect(addr) * comm.name = "Scheduler Broadcast" */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *__pyx_outer_scope; PyObject *__pyx_v_addr; PyObject *__pyx_v_comm; PyObject *__pyx_v_resp; }; /* "distributed/scheduler.py":4980 * return dict(zip(workers, results)) * * async def proxy(self, comm=None, msg=None, worker=None, serializers=None): # <<<<<<<<<<<<<< * """ Proxy a communication through the scheduler to some other worker """ * d = await self.broadcast( */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy { PyObject_HEAD PyObject *__pyx_v_comm; PyObject *__pyx_v_d; PyObject *__pyx_v_msg; PyObject *__pyx_v_self; PyObject *__pyx_v_serializers; PyObject *__pyx_v_worker; }; /* "distributed/scheduler.py":4987 * return d[worker] * * async def _delete_worker_data(self, worker_address, keys): # <<<<<<<<<<<<<< * """Delete data from a worker and update the corresponding worker/task states * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data { PyObject_HEAD PyObject *__pyx_9genexpr70__pyx_v_key; PyObject *__pyx_v_keys; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_self; PyObject *__pyx_v_tasks; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; PyObject *__pyx_v_worker_address; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; }; /* "distributed/scheduler.py":5011 * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) * * async def rebalance(self, comm=None, keys=None, workers=None): # <<<<<<<<<<<<<< * """Rebalance keys so that each worker stores roughly equal bytes * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance { PyObject_HEAD PyObject *__pyx_v_avg; PyObject *__pyx_v_comm; PyObject *__pyx_v_genexpr; PyObject *__pyx_9genexpr71__pyx_v_k; PyObject *__pyx_v_k; PyObject *__pyx_v_keys; PyObject *__pyx_v_missing_data; PyObject *__pyx_v_msgs; PyObject *__pyx_v_nb; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_r; PyObject *__pyx_v_recipient; PyObject *__pyx_v_recipients; PyObject *__pyx_v_result; PyObject *__pyx_v_self; PyObject *__pyx_v_sender; PyObject *__pyx_v_sender_keys; PyObject *__pyx_v_sorted_workers; PyObject *__pyx_v_tasks; PyObject *__pyx_v_tasks_by_worker; PyObject *__pyx_v_to_recipients; PyObject *__pyx_v_to_senders; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr72__pyx_v_ts; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr74__pyx_v_ts; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr75__pyx_v_ts; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr79__pyx_v_ts; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; PyObject *__pyx_9genexpr77__pyx_v_v; PyObject *__pyx_v_v; PyObject *__pyx_v_vv; PyObject *__pyx_9genexpr73__pyx_v_w; PyObject *__pyx_v_worker_bytes; PyObject *__pyx_v_workers; PyObject *__pyx_v_workers_by_task; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr76__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr77__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; PyObject *__pyx_t_7; PyObject *__pyx_t_8; PyObject *__pyx_t_9; PyObject *__pyx_t_10; PyObject *__pyx_t_11; PyObject *__pyx_t_12; }; /* "distributed/scheduler.py":5049 * * worker_bytes = { * ws: sum(ts.get_nbytes() for ts in v) # <<<<<<<<<<<<<< * for ws, v in tasks_by_worker.items() * } */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *__pyx_outer_scope; PyObject *__pyx_v_ts; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "distributed/scheduler.py":5096 * result = await asyncio.gather( * *( * retry_operation(self.rpc(addr=r).gather, who_has=v) # <<<<<<<<<<<<<< * for r, v in to_recipients.items() * ) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *__pyx_outer_scope; PyObject *__pyx_v_r; PyObject *__pyx_v_v; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":5114 * ) * * if not all(r["status"] == "OK" for r in result): # <<<<<<<<<<<<<< * return { * "status": "missing-data", */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *__pyx_outer_scope; PyObject *__pyx_v_r; }; /* "distributed/scheduler.py":5119 * "keys": tuple( * concat( * r["keys"].keys() # <<<<<<<<<<<<<< * for r in result * if r["status"] == "missing-data" */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *__pyx_outer_scope; PyObject *__pyx_v_r; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "distributed/scheduler.py":5142 * * await asyncio.gather( * *(self._delete_worker_data(r, v) for r, v in to_senders.items()) # <<<<<<<<<<<<<< * ) * */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *__pyx_outer_scope; PyObject *__pyx_v_r; PyObject *__pyx_v_v; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":5147 * return {"status": "OK"} * * async def replicate( # <<<<<<<<<<<<<< * self, * comm=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate { PyObject_HEAD PyObject *__pyx_v_branching_factor; PyObject *__pyx_v_comm; PyObject *__pyx_v_count; PyObject *__pyx_v_del_candidates; PyObject *__pyx_v_del_worker_tasks; PyObject *__pyx_v_delete; PyObject *__pyx_v_gathers; PyObject *__pyx_v_genexpr; PyObject *__pyx_9genexpr85__pyx_v_k; PyObject *__pyx_v_keys; PyObject *__pyx_v_lock; PyObject *__pyx_v_missing_data; PyObject *__pyx_v_n; PyObject *__pyx_v_n_missing; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_results; PyObject *__pyx_v_self; PyObject *__pyx_9genexpr88__pyx_v_t; PyObject *__pyx_9genexpr87__pyx_v_tasks; PyObject *__pyx_v_tasks; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr86__pyx_v_ts; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; PyObject *__pyx_v_v; PyObject *__pyx_9genexpr84__pyx_v_w; PyObject *__pyx_v_w; PyObject *__pyx_v_workers; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr87__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr89__pyx_v_wws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_wws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; PyObject *__pyx_t_7; PyObject *__pyx_t_8; }; /* "distributed/scheduler.py":5240 * results = await asyncio.gather( * *( * retry_operation(self.rpc(addr=w).gather, who_has=who_has) # <<<<<<<<<<<<<< * for w, who_has in gathers.items() * ) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *__pyx_outer_scope; PyObject *__pyx_v_w; PyObject *__pyx_v_who_has; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":5262 * ) * * def workers_to_close( # <<<<<<<<<<<<<< * self, * comm=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close { PyObject_HEAD PyObject *__pyx_v_group_bytes; PyObject *__pyx_v_groups; }; /* "distributed/scheduler.py":5398 * return result * * async def retire_workers( # <<<<<<<<<<<<<< * self, * comm=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers { PyObject_HEAD PyObject *__pyx_v_close_workers; PyObject *__pyx_v_comm; PyObject *__pyx_v_keys; PyObject *__pyx_v_kwargs; PyObject *__pyx_v_lock; PyObject *__pyx_v_names; PyObject *__pyx_v_other_workers; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_remove; PyObject *__pyx_v_self; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr102__pyx_v_ts; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; PyObject *__pyx_10genexpr100__pyx_v_w; PyObject *__pyx_10genexpr101__pyx_v_w; PyObject *__pyx_10genexpr105__pyx_v_w; PyObject *__pyx_10genexpr106__pyx_v_w; PyObject *__pyx_v_worker_keys; PyObject *__pyx_v_workers; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr103__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr104__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr99__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; PyObject *__pyx_t_7; PyObject *__pyx_t_8; PyObject *__pyx_t_9; PyObject *__pyx_t_10; PyObject *__pyx_t_11; PyObject *__pyx_t_12; }; /* "distributed/scheduler.py":5591 * self.report(report_msg, ts=ts, client=client) * * async def feed( # <<<<<<<<<<<<<< * self, comm, function=None, setup=None, teardown=None, interval="1s", **kwargs * ): */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed { PyObject_HEAD PyObject *__pyx_v_comm; PyObject *__pyx_v_function; PyObject *__pyx_v_interval; PyObject *__pyx_v_kwargs; PyObject *__pyx_v_response; PyObject *__pyx_v_self; PyObject *__pyx_v_setup; PyObject *__pyx_v_state; PyObject *__pyx_v_teardown; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; }; /* "distributed/scheduler.py":5708 * return {w: ws._nthreads for w, ws in parent._workers_dv.items()} * * async def get_call_stack(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack { PyObject_HEAD PyObject *__pyx_v_comm; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr123__pyx_v_dts; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts; PyObject *__pyx_v_genexpr; PyObject *__pyx_v_key; PyObject *__pyx_v_keys; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_processing; PyObject *__pyx_10genexpr126__pyx_v_r; PyObject *__pyx_v_response; PyObject *__pyx_v_results; PyObject *__pyx_v_self; PyObject *__pyx_v_stack; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts; PyObject *__pyx_10genexpr124__pyx_v_w; PyObject *__pyx_10genexpr126__pyx_v_w; PyObject *__pyx_v_workers; }; /* "distributed/scheduler.py":5734 * * results = await asyncio.gather( * *(self.rpc(w).call_stack(keys=v) for w, v in workers.items()) # <<<<<<<<<<<<<< * ) * response = {w: r for w, r in zip(workers, results) if r} */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *__pyx_outer_scope; PyObject *__pyx_v_v; PyObject *__pyx_v_w; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":5832 * return {"metadata": plugin.metadata, "state": plugin.state} * * async def register_worker_plugin(self, comm, plugin, name=None): # <<<<<<<<<<<<<< * """ Registers a setup function, and call it on every worker """ * self.worker_plugins.append({"plugin": plugin, "name": name}) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin { PyObject_HEAD PyObject *__pyx_v_comm; PyObject *__pyx_v_name; PyObject *__pyx_v_plugin; PyObject *__pyx_v_responses; PyObject *__pyx_v_self; }; /* "distributed/scheduler.py":6164 * return self._ipython_kernel.get_connection_info() * * async def get_profile( # <<<<<<<<<<<<<< * self, * comm=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile { PyObject_HEAD PyObject *__pyx_v_comm; PyObject *__pyx_v_genexpr; PyObject *__pyx_v_key; PyObject *__pyx_v_merge_workers; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_10genexpr136__pyx_v_r; PyObject *__pyx_v_response; PyObject *__pyx_v_results; PyObject *__pyx_v_scheduler; PyObject *__pyx_v_self; PyObject *__pyx_v_server; PyObject *__pyx_v_start; PyObject *__pyx_v_stop; PyObject *__pyx_v_workers; }; /* "distributed/scheduler.py":6186 * results = await asyncio.gather( * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) # <<<<<<<<<<<<<< * for w in workers * ), */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *__pyx_outer_scope; PyObject *__pyx_v_w; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "distributed/scheduler.py":6200 * return response * * async def get_profile_metadata( # <<<<<<<<<<<<<< * self, * comm=None, */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata { PyObject_HEAD PyObject *__pyx_v_comm; PyObject *__pyx_v_counts; PyObject *__pyx_v_d; PyObject *__pyx_v_dt; PyObject *__pyx_v_genexpr; PyObject *__pyx_10genexpr140__pyx_v_group; PyObject *__pyx_v_groups1; PyObject *__pyx_v_groups2; PyObject *__pyx_10genexpr141__pyx_v_k; PyObject *__pyx_v_k; PyObject *__pyx_v_keys; PyObject *__pyx_v_last; PyObject *__pyx_v_merge_workers; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_profile_cycle_interval; PyObject *__pyx_10genexpr138__pyx_v_r; PyObject *__pyx_v_results; PyObject *__pyx_v_self; PyObject *__pyx_v_start; PyObject *__pyx_v_stop; PyObject *__pyx_v_t; PyObject *__pyx_10genexpr140__pyx_v_time; PyObject *__pyx_v_tt; PyObject *__pyx_10genexpr139__pyx_v_v; PyObject *__pyx_10genexpr142__pyx_v_v; PyObject *__pyx_v_v; PyObject *__pyx_v_workers; }; /* "distributed/scheduler.py":6220 * workers = set(parent._workers_dv) & set(workers) * results = await asyncio.gather( * *(self.rpc(w).profile_metadata(start=start, stop=stop) for w in workers), # <<<<<<<<<<<<<< * return_exceptions=True, * ) */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr { PyObject_HEAD struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *__pyx_outer_scope; PyObject *__pyx_v_w; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "distributed/scheduler.py":6251 * return {"counts": counts, "keys": keys} * * async def performance_report(self, comm=None, start=None, code=""): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * stop = time() */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report { PyObject_HEAD PyObject *__pyx_v_BandwidthTypes; PyObject *__pyx_v_BandwidthWorkers; PyObject *__pyx_v_Div; PyObject *__pyx_v_Panel; PyObject *__pyx_v_Tabs; PyObject *__pyx_v_bandwidth_types; PyObject *__pyx_v_bandwidth_workers; PyObject *__pyx_v_code; PyObject *__pyx_v_comm; PyObject *__pyx_v_compute; PyObject *__pyx_v_d; PyObject *__pyx_v_data; PyObject *__pyx_v_distributed; PyObject *__pyx_v_f; PyObject *__pyx_v_fn; PyObject *__pyx_v_get_env; PyObject *__pyx_v_html; PyObject *__pyx_v_k; PyObject *__pyx_v_output_file; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_profile; PyObject *__pyx_v_profile_to_figure; PyObject *__pyx_v_rectangles; PyObject *__pyx_v_rects; PyObject *__pyx_v_save; PyObject *__pyx_v_scheduler; PyObject *__pyx_v_self; PyObject *__pyx_v_source; PyObject *__pyx_v_start; PyObject *__pyx_v_stop; PyObject *__pyx_v_tabs; PyObject *__pyx_v_task_stream; PyObject *__pyx_v_task_stream_figure; PyObject *__pyx_v_tasks_timings; PyObject *__pyx_v_template; PyObject *__pyx_v_template_directory; PyObject *__pyx_v_template_environment; PyObject *__pyx_v_timespent; Py_ssize_t __pyx_v_total_tasks; PyObject *__pyx_v_workers; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr143__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr144__pyx_v_ws; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_v_x; }; /* "distributed/scheduler.py":6388 * return data * * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): # <<<<<<<<<<<<<< * results = await self.broadcast( * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs { PyObject_HEAD PyObject *__pyx_v_comm; PyObject *__pyx_v_n; PyObject *__pyx_v_nanny; PyObject *__pyx_v_results; PyObject *__pyx_v_self; PyObject *__pyx_v_workers; }; /* "distributed/scheduler.py":6464 * raise * * async def check_worker_ttl(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl { PyObject_HEAD PyObject *__pyx_v_now; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent; PyObject *__pyx_v_self; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; }; /* "distributed/scheduler.py":266 * @final * @cclass * class WorkerState: # <<<<<<<<<<<<<< * """ * A simple object holding information about a worker. */ struct __pyx_vtabstruct_11distributed_9scheduler_WorkerState { PyObject *(*clean)(struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); PyObject *(*identity)(struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_11distributed_9scheduler_WorkerState *__pyx_vtabptr_11distributed_9scheduler_WorkerState; static PyObject *__pyx_f_11distributed_9scheduler_11WorkerState_clean(struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); static PyObject *__pyx_f_11distributed_9scheduler_11WorkerState_identity(struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); /* "distributed/scheduler.py":755 * @final * @cclass * class TaskGroup: # <<<<<<<<<<<<<< * """Collection tracking all tasks within a group * */ struct __pyx_vtabstruct_11distributed_9scheduler_TaskGroup { PyObject *(*add)(struct __pyx_obj_11distributed_9scheduler_TaskGroup *, PyObject *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_11distributed_9scheduler_TaskGroup *__pyx_vtabptr_11distributed_9scheduler_TaskGroup; static PyObject *__pyx_f_11distributed_9scheduler_9TaskGroup_add(struct __pyx_obj_11distributed_9scheduler_TaskGroup *, PyObject *, int __pyx_skip_dispatch); /* "distributed/scheduler.py":871 * @final * @cclass * class TaskState: # <<<<<<<<<<<<<< * """ * A simple object holding information about a task. */ struct __pyx_vtabstruct_11distributed_9scheduler_TaskState { PyObject *(*add_dependency)(struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch); Py_ssize_t (*get_nbytes)(struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch); PyObject *(*set_nbytes)(struct __pyx_obj_11distributed_9scheduler_TaskState *, Py_ssize_t, int __pyx_skip_dispatch); PyObject *(*validate)(struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_11distributed_9scheduler_TaskState *__pyx_vtabptr_11distributed_9scheduler_TaskState; static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_add_dependency(struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch); static CYTHON_INLINE Py_ssize_t __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch); static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_set_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *, Py_ssize_t, int __pyx_skip_dispatch); static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_validate(struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch); /* "distributed/scheduler.py":1534 * * @cclass * class SchedulerState: # <<<<<<<<<<<<<< * """Underlying task state of dynamic scheduler * */ struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState { struct __pyx_obj_11distributed_9scheduler_WorkerState *(*decide_worker)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch); double (*set_duration_estimate)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); PyObject *(*remove_key)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, PyObject *, int __pyx_skip_dispatch); PyObject *(*check_idle_saturated)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch, struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_check_idle_saturated *__pyx_optional_args); double (*get_comm_cost)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); double (*get_task_duration)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch, struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_get_task_duration *__pyx_optional_args); PyObject *(*valid_workers)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch); PyObject *(*consume_resources)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); PyObject *(*release_resources)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); PyObject *(*coerce_hostname)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, PyObject *, int __pyx_skip_dispatch); PyObject *(*worker_objective)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *__pyx_vtabptr_11distributed_9scheduler_SchedulerState; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED 1 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; size_t defaults_size; // used by FusedFunction for copying defaults int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* pyobject_as_double.proto */ static double __Pyx__PyObject_AsDouble(PyObject* obj); #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_AsDouble(obj)\ (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ likely(PyInt_CheckExact(obj)) ?\ PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) #else #define __Pyx_PyObject_AsDouble(obj)\ ((likely(PyFloat_CheckExact(obj))) ?\ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) #endif /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #elif PY_MAJOR_VERSION < 3 #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\ PyObject_Format(s, f)) #else #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* PyObjectFormatAndDecref.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); /* BuildPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, int prepend_sign, char padding_char); /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); /* JoinPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* RaiseMappingExpected.proto */ static void __Pyx_RaiseMappingExpectedError(PyObject* arg); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* set_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, Py_ssize_t* p_orig_length, int* p_source_is_set); static CYTHON_INLINE int __Pyx_set_iter_next( PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject **value, int source_is_set); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* py_dict_items.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod0.proto */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CallUnboundCMethod0(cfunc, self)\ (likely((cfunc)->func) ?\ (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ (PY_VERSION_HEX >= 0x030700A0 ?\ (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ __Pyx__CallUnboundCMethod0(cfunc, self)) #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif /* py_dict_values.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* PyUnicode_Unicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* pyfrozenset_new.proto */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); /* PySetContains.proto */ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); /* py_set_remove.proto */ static CYTHON_INLINE int __Pyx_PySet_Remove(PyObject *set, PyObject *key); /* None.proto */ static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* py_set_discard.proto */ static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return __Pyx_PyObject_GetAttrStr(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #else #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* py_dict_pop.proto */ static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* MergeKeywords.proto */ static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping); /* CoroutineBase.proto */ typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_ExcInfoStruct _PyErr_StackItem #else typedef struct { PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; } __Pyx_ExcInfoStruct; #endif typedef struct { PyObject_HEAD __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; int resume_label; char is_running; } __pyx_CoroutineObject; static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) #else #define __Pyx_Coroutine_SwapException(self) {\ __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ } #define __Pyx_Coroutine_ResetAndClearException(self) {\ __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ } #endif #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) #else #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PatchModuleWithCoroutine.proto */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); /* PatchGeneratorABC.proto */ static int __Pyx_patch_abc(void); /* Coroutine.proto */ #define __Pyx_Coroutine_USED static PyTypeObject *__pyx_CoroutineType = 0; static PyTypeObject *__pyx_CoroutineAwaitType = 0; #define __Pyx_Coroutine_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineType) #define __Pyx_Coroutine_Check(obj) __Pyx_Coroutine_CheckExact(obj) #define __Pyx_CoroutineAwait_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineAwaitType) #define __Pyx_Coroutine_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_CoroutineType, body, code, closure, name, qualname, module_name) static int __pyx_Coroutine_init(void); static PyObject *__Pyx__Coroutine_await(PyObject *coroutine); typedef struct { PyObject_HEAD PyObject *coroutine; } __pyx_CoroutineAwaitObject; static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, PyObject *arg); static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args); /* GetAwaitIter.proto */ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o); static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o); /* CoroutineYieldFrom.proto */ static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source); /* ReturnWithStopIteration.proto */ #define __Pyx_ReturnWithStopIteration(value)\ if (value == Py_None) PyErr_SetNone(PyExc_StopIteration); else __Pyx__ReturnWithStopIteration(value) static void __Pyx__ReturnWithStopIteration(PyObject* value); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* pop.proto */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) #else #define __Pyx_PyList_Pop(L) __Pyx__PyObject_Pop(L) #define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) #endif /* ListExtend.proto */ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { #if CYTHON_COMPILING_IN_CPYTHON PyObject* none = _PyList_Extend((PyListObject*)L, v); if (unlikely(!none)) return -1; Py_DECREF(none); return 0; #else return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); #endif } /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); #else #define __Pyx_PyFloat_SubtractObjC(op1, op2, floatval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* py_abs.proto */ #if CYTHON_USE_PYLONG_INTERNALS static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); #define __Pyx_PyNumber_Absolute(x)\ ((likely(PyLong_CheckExact(x))) ?\ (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ PyNumber_Absolute(x)) #else #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /* None.proto */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* SliceTupleAndList.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); #else #define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) #define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) #endif /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* PatchInspect.proto */ static PyObject* __Pyx_patch_inspect(PyObject* module); /* PatchAsyncIO.proto */ static PyObject* __Pyx_patch_asyncio(PyObject* module); /* Globals.proto */ static PyObject* __Pyx_Globals(void); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CyFunctionClassCell.proto */ static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* Generator.proto */ #define __Pyx_Generator_USED static PyTypeObject *__pyx_GeneratorType = 0; #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(void); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_11distributed_9scheduler_11WorkerState_clean(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_11WorkerState_identity(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_9TaskGroup_add(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self, PyObject *__pyx_v_o, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_add_dependency(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_other, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static CYTHON_INLINE Py_ssize_t __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_set_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, Py_ssize_t __pyx_v_nbytes, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_validate(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_f_11distributed_9scheduler_14SchedulerState_decide_worker(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, int __pyx_skip_dispatch); /* proto*/ static double __pyx_f_11distributed_9scheduler_14SchedulerState_set_duration_estimate(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_remove_key(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_check_idle_saturated(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch, struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_check_idle_saturated *__pyx_optional_args); /* proto*/ static double __pyx_f_11distributed_9scheduler_14SchedulerState_get_comm_cost(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch); /* proto*/ static double __pyx_f_11distributed_9scheduler_14SchedulerState_get_task_duration(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, int __pyx_skip_dispatch, struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_get_task_duration *__pyx_optional_args); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_valid_workers(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_consume_resources(CYTHON_UNUSED struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_release_resources(CYTHON_UNUSED struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_coerce_hostname(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_worker_objective(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch); /* proto*/ /* Module declarations from 'distributed.scheduler' */ static PyTypeObject *__pyx_ptype_11distributed_9scheduler_ClientState = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler_WorkerState = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler_TaskPrefix = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler_TaskGroup = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler_TaskState = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler_SchedulerState = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct____repr__ = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_1_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_2___repr__ = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_3_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_4___iter__ = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_5___len__ = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_6_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_7___iter__ = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_8_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_9_start = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_10_close = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_11_close_worker = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_12_add_worker = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_13_update_graph = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_14_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_15_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_16_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_17_remove_worker = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_18_cancel_key = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_19_validate_state = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_20_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_21_add_client = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_22_remove_client = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_23_handle_worker = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_24_add_plugin = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_25_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_26_scatter = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_27_gather = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_28_restart = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_29_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_30_broadcast = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_31_send_message = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_32_proxy = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_34_rebalance = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_35_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_36_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_37_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_38_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_39_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_40_replicate = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_41_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_43_retire_workers = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_44_feed = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_46_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_48_get_profile = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_49_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_51_genexpr = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_52_performance_report = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs = 0; static PyTypeObject *__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl = 0; static Py_ssize_t __pyx_v_11distributed_9scheduler_DEFAULT_DATA_SIZE; static double __pyx_v_11distributed_9scheduler_UNKNOWN_TASK_DURATION; static PyObject *__pyx_v_11distributed_9scheduler_ALL_TASK_STATES = 0; static PyObject *__pyx_f_11distributed_9scheduler__remove_from_processing(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler__add_to_memory(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, PyObject *, PyObject *, struct __pyx_opt_args_11distributed_9scheduler__add_to_memory *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler__propagate_forgotten(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler__client_releases_keys(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, PyObject *, struct __pyx_obj_11distributed_9scheduler_ClientState *, PyObject *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler__task_to_msg(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_opt_args_11distributed_9scheduler__task_to_msg *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler__task_to_report_msg(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler__task_to_client_msgs(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler__reevaluate_occupancy_worker(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *); /*proto*/ static struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_f_11distributed_9scheduler_decide_worker(struct __pyx_obj_11distributed_9scheduler_TaskState *, PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_ClientState__set_state(struct __pyx_obj_11distributed_9scheduler_ClientState *, PyObject *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_WorkerState__set_state(struct __pyx_obj_11distributed_9scheduler_WorkerState *, PyObject *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_TaskPrefix__set_state(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *, PyObject *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_TaskGroup__set_state(struct __pyx_obj_11distributed_9scheduler_TaskGroup *, PyObject *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_TaskState__set_state(struct __pyx_obj_11distributed_9scheduler_TaskState *, PyObject *); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_SchedulerState__set_state(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "distributed.scheduler" extern int __pyx_module_is_main_distributed__scheduler; int __pyx_module_is_main_distributed__scheduler = 0; /* Implementation of 'distributed.scheduler' */ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_sum; static PyObject *__pyx_builtin_any; static PyObject *__pyx_builtin_map; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_super; static PyObject *__pyx_builtin_min; static PyObject *__pyx_builtin_all; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_open; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_sorted; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_reversed; static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_builtin_EnvironmentError; static PyObject *__pyx_builtin_RuntimeError; static const char __pyx_k_T[] = "T"; static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_p[] = "p"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_1s[] = "1s"; static const char __pyx_k_OK[] = "OK"; static const char __pyx_k__3[] = ">"; static const char __pyx_k__4[] = ": "; static const char __pyx_k__5[] = "<"; static const char __pyx_k__6[] = ", "; static const char __pyx_k__7[] = " "; static const char __pyx_k__8[] = "("; static const char __pyx_k__9[] = ")"; static const char __pyx_k_bw[] = "bw"; static const char __pyx_k_cs[] = "cs"; static const char __pyx_k_dt[] = "dt"; static const char __pyx_k_fn[] = "fn"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_ip[] = "ip"; static const char __pyx_k_kv[] = "kv"; static const char __pyx_k_li[] = "\n
  • "; static const char __pyx_k_ms[] = "ms"; static const char __pyx_k_nb[] = "nb"; static const char __pyx_k_ns[] = "ns"; static const char __pyx_k_op[] = "op"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_pc[] = "pc"; static const char __pyx_k_st[] = "st"; static const char __pyx_k_tg[] = "tg"; static const char __pyx_k_tp[] = "tp"; static const char __pyx_k_ts[] = "ts"; static const char __pyx_k_tt[] = "tt"; static const char __pyx_k_vv[] = "vv"; static const char __pyx_k_wh[] = "wh"; static const char __pyx_k_ws[] = "ws"; static const char __pyx_k_ww[] = "ww"; static const char __pyx_k_2ms[] = "2ms"; static const char __pyx_k_5ms[] = "5ms"; static const char __pyx_k_60s[] = "60s"; static const char __pyx_k_All[] = "All"; static const char __pyx_k_Div[] = "Div"; static const char __pyx_k_Set[] = "Set"; static const char __pyx_k__14[] = "/"; static const char __pyx_k__48[] = "://"; static const char __pyx_k__50[] = ""; static const char __pyx_k__51[] = ":"; static const char __pyx_k__53[] = "]"; static const char __pyx_k__60[] = "-"; static const char __pyx_k__61[] = "_"; static const char __pyx_k__84[] = "."; static const char __pyx_k_add[] = "add"; static const char __pyx_k_all[] = "all"; static const char __pyx_k_any[] = "any"; static const char __pyx_k_avg[] = "avg"; static const char __pyx_k_cls[] = "cls"; static const char __pyx_k_cpu[] = "cpu"; static const char __pyx_k_cts[] = "cts"; static const char __pyx_k_dep[] = "dep"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_dsk[] = "dsk"; static const char __pyx_k_dts[] = "dts"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_ext[] = "ext"; static const char __pyx_k_fig[] = "fig"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_hlg[] = "hlg"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_len[] = "len"; static const char __pyx_k_log[] = "log"; static const char __pyx_k_map[] = "map"; static const char __pyx_k_min[] = "min"; static const char __pyx_k_msg[] = "msg"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_now[] = "now"; static const char __pyx_k_occ[] = "occ"; static const char __pyx_k_out[] = "out"; static const char __pyx_k_pdb[] = "pdb"; static const char __pyx_k_pid[] = "pid"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_rpc[] = "rpc"; static const char __pyx_k_run[] = "run"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_tlz[] = "tlz"; static const char __pyx_k_tsp[] = "tsp"; static const char __pyx_k_typ[] = "typ"; static const char __pyx_k_wws[] = "wws"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_Lock[] = "Lock"; static const char __pyx_k_None[] = "None"; static const char __pyx_k_Tabs[] = "Tabs"; static const char __pyx_k_Task[] = ">> scheduler.workers_to_close()\n ['tcp://192.168.0.1:1234', 'tcp://192.168.0.2:1234']\n\n Group workers by hostname prior to closing\n\n >>> scheduler.workers_to_close(key=lambda ws: ws.host)\n ['tcp://192.168.0.1:1234', 'tcp://192.168.0.1:4567']\n\n Remove two workers\n\n >>> scheduler.workers_to_close(n=2)\n\n Keep enough workers to have twice as much memory as we we need.\n\n >>> scheduler.workers_to_close(memory_ratio=2)\n\n Returns\n -------\n to_close: list of worker addresses that ""are OK to close\n\n See Also\n --------\n Scheduler.retire_workers\n "; static const char __pyx_k_Moving_d_keys_to_other_workers[] = "Moving %d keys to other workers"; static const char __pyx_k_Scheduler_client_releases_keys[] = "Scheduler.client_releases_keys"; static const char __pyx_k_Scheduler_connection_to_worker[] = "Scheduler connection to worker"; static const char __pyx_k_Scheduler_get_profile_metadata[] = "Scheduler.get_profile_metadata"; static const char __pyx_k_Scheduler_handle_task_finished[] = "Scheduler.handle_task_finished"; static const char __pyx_k_Scheduler_reevaluate_occupancy[] = "Scheduler.reevaluate_occupancy"; static const char __pyx_k_Scheduler_transition_line_5989[] = "Scheduler.transition (line 5989)"; static const char __pyx_k_Similar_to__StateLegacyMapping[] = "\n Similar to _StateLegacyMapping, but a false-y value is interpreted\n as a missing key.\n "; static const char __pyx_k_StateLegacySet___iter___locals[] = "_StateLegacySet.__iter__..genexpr"; static const char __pyx_k_Tried_writing_to_closed_comm_s[] = "Tried writing to closed comm: %s"; static const char __pyx_k_dashboard_components_scheduler[] = "dashboard.components.scheduler"; static const char __pyx_k_distributed_scheduler_validate[] = "distributed.scheduler.validate"; static const char __pyx_k_not_in_dependency_s_dependents[] = "not in dependency's dependents"; static const char __pyx_k_transition_processing_released[] = "transition_processing_released"; static const char __pyx_k_A_mapping_interface_mimicking_t[] = "\n A mapping interface mimicking the former Scheduler state dictionaries.\n "; static const char __pyx_k_An_plugin_to_share_worker_statu[] = "\n An plugin to share worker status with a remote observer\n\n This is used in cluster managers to keep updated about the status of the\n scheduler.\n "; static const char __pyx_k_Can_not_use_replicate_to_delete[] = "Can not use replicate to delete data"; static const char __pyx_k_Error_transitioning_r_from_r_to[] = "Error transitioning %r from %r to %r"; static const char __pyx_k_Exception_while_restarting_This[] = "Exception while restarting. This is normal"; static const char __pyx_k_Impossible_transition_from_r_to[] = "Impossible transition from %r to %r"; static const char __pyx_k_OptionalStateLegacyMapping___ge[] = "_OptionalStateLegacyMapping.__getitem__"; static const char __pyx_k_OptionalStateLegacyMapping___it[] = "_OptionalStateLegacyMapping.__iter__"; static const char __pyx_k_OptionalStateLegacyMapping___le[] = "_OptionalStateLegacyMapping.__len__..genexpr"; static const char __pyx_k_Scheduler__transition_line_5845[] = "Scheduler._transition (line 5845)"; static const char __pyx_k_Scheduler_broadcast_locals_send[] = "Scheduler.broadcast..send_message"; static const char __pyx_k_Scheduler_cancels_key_s_Force_s[] = "Scheduler cancels key %s. Force=%s"; static const char __pyx_k_Scheduler_get_call_stack_locals[] = "Scheduler.get_call_stack..genexpr"; static const char __pyx_k_Scheduler_handle_uncaught_error[] = "Scheduler.handle_uncaught_error"; static const char __pyx_k_Scheduler_stimulus_missing_data[] = "Scheduler.stimulus_missing_data"; static const char __pyx_k_Scheduler_validate_state_locals[] = "Scheduler.validate_state..genexpr"; static const char __pyx_k_Scheduler_workers_to_close_line[] = "Scheduler.workers_to_close (line 5262)"; static const char __pyx_k_Task_s_marked_as_failed_because[] = "Task %s marked as failed because %d workers died while trying to run it"; static const char __pyx_k_WorkerState_ncores_has_moved_to[] = "WorkerState.ncores has moved to WorkerState.nthreads"; static const char __pyx_k_Workers_don_t_have_promised_key[] = "Workers don't have promised key: %s, %s"; static const char __pyx_k_distributed_dashboard_scheduler[] = "distributed.dashboard.scheduler"; static const char __pyx_k_distributed_scheduler_bandwidth[] = "distributed.scheduler.bandwidth"; static const char __pyx_k_h1_Dask_Performance_Report_h1_i[] = "\n

    Dask Performance Report

    \n\n Select different tabs on the top for additional information \n\n

    Duration: {time}

    \n

    Tasks Information

    \n
      \n
    • number of tasks: {ntasks}
    • \n {tasks_timings}\n
    \n\n

    Scheduler Information

    \n
      \n
    • Address: {address}
    • \n
    • Workers: {nworkers}
    • \n
    • Threads: {threads}
    • \n
    • Memory: {memory}
    • \n
    • Dask Version: {dask_version}
    • \n
    • Dask.Distributed Version: {distributed_version}
    • \n
    \n\n

    Calling Code

    \n
    \n{code}\n        
    \n "; static const char __pyx_k_not_in_dependent_s_dependencies[] = "not in dependent's dependencies"; static const char __pyx_k_Attempting_to_reschedule_task_wh[] = "Attempting to reschedule task {}, which was not found on the scheduler. Aborting reschedule."; static const char __pyx_k_Client_s_requests_to_cancel_d_ke[] = "Client %s requests to cancel %d keys"; static const char __pyx_k_Client_s_requests_to_retry_d_key[] = "Client %s requests to retry %d keys"; static const char __pyx_k_CollectTaskMetaDataPlugin___init[] = "CollectTaskMetaDataPlugin.__init__"; static const char __pyx_k_CollectTaskMetaDataPlugin_transi[] = "CollectTaskMetaDataPlugin.transition"; static const char __pyx_k_CollectTaskMetaDataPlugin_update[] = "CollectTaskMetaDataPlugin.update_graph"; static const char __pyx_k_Communication_failed_during_repl[] = "Communication failed during replication: %s"; static const char __pyx_k_Couldn_t_gather_keys_s_state_s_w[] = "Couldn't gather keys %s state: %s workers: %s"; static const char __pyx_k_Dynamic_distributed_task_schedul[] = "Dynamic distributed task scheduler\n\n The scheduler tracks the current state of workers, data, and computations.\n The scheduler listens for events and responds by controlling workers\n appropriately. It continuously tries to use the workers to execute an ever\n growing dask graph.\n\n All events are handled quickly, in linear time with respect to their input\n (which is often of constant size) and generally within a millisecond. To\n accomplish this the scheduler tracks a lot of state. Every operation\n maintains the consistency of this state.\n\n The scheduler communicates with the outside world through Comm objects.\n It maintains a consistent and valid view of the world even when listening\n to several clients at once.\n\n A Scheduler is typically started either with the ``dask-scheduler``\n executable::\n\n $ dask-scheduler\n Scheduler started at 127.0.0.1:8786\n\n Or within a LocalCluster a Client starts up without connection\n information::\n\n >>> c = Client() # doctest: +SKIP\n >>> c.cluster.scheduler # doctest: +SKIP\n Scheduler(...)\n\n Users typically do not interact with the scheduler directly but rather with\n the client object ``Client``.\n\n **State**\n\n The scheduler contains the following state variables. Each variable is\n listed along with what it stores and a brief description.\n\n * **tasks:** ``{task key: TaskState}``\n Tasks currently known to the scheduler\n * **unrunnable:** ``{TaskState}``\n Tasks in the \"no-worker\" state\n\n * **workers:** ``{worker key: WorkerState}``\n Workers currently connected to the scheduler\n * **idle:** ``{WorkerState}``:\n Set of workers that are not fully utilized\n * **saturated:** ``{WorkerState}``:\n Set of workers that are not over-utilized\n\n * **host_info:** ``{hostname: dict}``:\n Information about each worker host\n\n * **clients:** ``""{client key: ClientState}``\n Clients currently connected to the scheduler\n\n * **services:** ``{str: port}``:\n Other services running on this scheduler, like Bokeh\n * **loop:** ``IOLoop``:\n The running Tornado IOLoop\n * **client_comms:** ``{client key: Comm}``\n For each client, a Comm object used to receive task requests and\n report task status updates.\n * **stream_comms:** ``{worker key: Comm}``\n For each worker, a Comm object from which we both accept stimuli and\n report results\n * **task_duration:** ``{key-prefix: time}``\n Time we expect certain functions to take, e.g. ``{'sum': 0.25}``\n "; static const char __pyx_k_Expected_to_find_exactly_one_Col[] = "Expected to find exactly one CollectTaskMetaDataPlugin with name "; static const char __pyx_k_Incompatible_checksums_s_vs_0x38[] = "Incompatible checksums (%s vs 0x38edd31 = (_client_key, _hash, _last_seen, _versions, _wants_what))"; static const char __pyx_k_Incompatible_checksums_s_vs_0x3d[] = "Incompatible checksums (%s vs 0x3d65355 = (_actor, _annotations, _dependencies, _dependents, _exception, _exception_blame, _group, _group_key, _has_lost_dependencies, _hash, _host_restrictions, _key, _loose_restrictions, _metadata, _nbytes, _prefix, _priority, _processing_on, _resource_restrictions, _retries, _run_spec, _state, _suspicious, _traceback, _type, _waiters, _waiting_on, _who_has, _who_wants, _worker_restrictions))"; static const char __pyx_k_Incompatible_checksums_s_vs_0x69[] = "Incompatible checksums (%s vs 0x694d44f = (_actors, _address, _bandwidth, _executing, _extra, _has_what, _hash, _last_seen, _local_directory, _memory_limit, _metrics, _name, _nanny, _nbytes, _nthreads, _occupancy, _pid, _processing, _resources, _services, _status, _time_delay, _used_resources, _versions))"; static const char __pyx_k_Incompatible_checksums_s_vs_0x81[] = "Incompatible checksums (%s vs 0x813f495 = (_dependencies, _duration, _name, _nbytes_in_memory, _nbytes_total, _prefix, _states, _types))"; static const char __pyx_k_Incompatible_checksums_s_vs_0x9b[] = "Incompatible checksums (%s vs 0x9bc1f9f = (_all_durations, _duration_average, _groups, _name, _suspicious))"; static const char __pyx_k_Incompatible_checksums_s_vs_0xeb[] = "Incompatible checksums (%s vs 0xebac261 = (_aliases, _bandwidth, _clients, _extensions, _host_info, _idle, _idle_dv, _n_tasks, _resources, _saturated, _task_groups, _task_metadata, _task_prefixes, _tasks, _total_nthreads, _total_occupancy, _unknown_durations, _unrunnable, _validate, _workers, _workers_dv))"; static const char __pyx_k_Nannies_didn_t_report_back_resta[] = "Nannies didn't report back restarted within timeout. Continuuing with restart process"; static const char __pyx_k_Not_all_workers_responded_positi[] = "Not all workers responded positively: %s"; static const char __pyx_k_Received_already_computed_task_w[] = "Received already computed task, worker: %s, state: %s, key: %s, who_has: %s"; static const char __pyx_k_Received_long_running_signal_fro[] = "Received long-running signal from duplicate task. Ignoring."; static const char __pyx_k_Scheduler_Profile_administrative[] = "Scheduler Profile (administrative)"; static const char __pyx_k_Scheduler___init___locals_lambda[] = "Scheduler.__init__.."; static const char __pyx_k_Scheduler_add_plugin_locals_gene[] = "Scheduler.add_plugin..genexpr"; static const char __pyx_k_Scheduler_cancel_key_locals_lamb[] = "Scheduler.cancel_key.."; static const char __pyx_k_Scheduler_closing_after_being_id[] = "Scheduler closing after being idle for %s"; static const char __pyx_k_Scheduler_get_nbytes_locals_lamb[] = "Scheduler.get_nbytes.."; static const char __pyx_k_Scheduler_get_profile_locals_gen[] = "Scheduler.get_profile..genexpr"; static const char __pyx_k_Scheduler_get_profile_metadata_l[] = "Scheduler.get_profile_metadata..genexpr"; static const char __pyx_k_Scheduler_get_worker_service_add[] = "Scheduler.get_worker_service_addr"; static const char __pyx_k_Scheduler_performance_report_loc[] = "Scheduler.performance_report..profile_to_figure"; static const char __pyx_k_Scheduler_rebalance_locals_genex[] = "Scheduler.rebalance..genexpr"; static const char __pyx_k_Scheduler_rebalance_locals_lambd[] = "Scheduler.rebalance.."; static const char __pyx_k_Scheduler_register_worker_plugin[] = "Scheduler.register_worker_plugin"; static const char __pyx_k_Scheduler_remove_client_locals_r[] = "Scheduler.remove_client..remove_client_from_events"; static const char __pyx_k_Scheduler_remove_worker_locals_r[] = "Scheduler.remove_worker..remove_worker_from_events"; static const char __pyx_k_Scheduler_replicate_locals_genex[] = "Scheduler.replicate..genexpr"; static const char __pyx_k_Scheduler_restart_locals_genexpr[] = "Scheduler.restart..genexpr"; static const char __pyx_k_Scheduler_start_locals_del_sched[] = "Scheduler.start..del_scheduler_file"; static const char __pyx_k_Scheduler_stimulus_task_finished[] = "Scheduler.stimulus_task_finished"; static const char __pyx_k_Scheduler_subscribe_worker_statu[] = "Scheduler.subscribe_worker_status"; static const char __pyx_k_Scheduler_update_graph_locals_ge[] = "Scheduler.update_graph..genexpr"; static const char __pyx_k_Scheduler_workers_to_close_local[] = "Scheduler.workers_to_close.._key"; static const char __pyx_k_Send_lost_future_signal_to_clien[] = "Send lost future signal to clients"; static const char __pyx_k_Similar_to__StateLegacyMapping_2[] = "\n Similar to _StateLegacyMapping, but exposes a set containing\n all values with a true value.\n "; static const char __pyx_k_Starting_worker_compute_stream_s[] = "Starting worker compute stream, %s"; static const char __pyx_k_Transition_a_key_from_its_curren[] = "Transition a key from its current state to the finish state\n\n Examples\n --------\n >>> self._transition('x', 'waiting')\n {'x': 'processing'}\n\n Returns\n -------\n Dictionary of recommendations for future transitions\n\n See Also\n --------\n Scheduler.transitions : transitive version of this function\n "; static const char __pyx_k_Transitioned_r_s_s_actual_s_Cons[] = "Transitioned %r %s->%s (actual: %s). Consequence: %s"; static const char __pyx_k_Tried_to_call_feed_route_with_cu[] = "Tried to call 'feed' route with custom functions, but pickle is disallowed. Set the 'distributed.scheduler.pickle'config value to True to use the 'feed' route (this is mostly commonly used with progress bars)"; static const char __pyx_k_Unexpected_worker_completed_task[] = "Unexpected worker completed task, likely due to work stealing. Expected: %s, Got: %s, Key: %s"; static const char __pyx_k_User_asked_for_computation_on_lo[] = "User asked for computation on lost data, %s"; static const char __pyx_k_WorkerStatusPlugin_remove_worker[] = "WorkerStatusPlugin.remove_worker"; static const char __pyx_k_Worker_failed_to_heartbeat_withi[] = "Worker failed to heartbeat within %s seconds. Closing: %s"; static const char __pyx_k_Worker_tried_to_connect_with_a_d[] = "Worker tried to connect with a duplicate name: %s"; static const char __pyx_k_Workers_not_the_same_in_all_coll[] = "Workers not the same in all collections"; static const char __pyx_k_addresses_should_be_strings_or_t[] = "addresses should be strings or tuples, got "; static const char __pyx_k_distributed_adaptive_target_dura[] = "distributed.adaptive.target-duration"; static const char __pyx_k_distributed_dashboard_components[] = "distributed.dashboard.components.scheduler"; static const char __pyx_k_distributed_diagnostics_task_str[] = "distributed.diagnostics.task_stream"; static const char __pyx_k_distributed_http_scheduler_missi[] = "distributed.http.scheduler.missing_bokeh"; static const char __pyx_k_distributed_scheduler_allowed_fa[] = "distributed.scheduler.allowed-failures"; static const char __pyx_k_distributed_scheduler_default_da[] = "distributed.scheduler.default-data-size"; static const char __pyx_k_distributed_scheduler_default_ta[] = "distributed.scheduler.default-task-durations"; static const char __pyx_k_distributed_scheduler_events_cle[] = "distributed.scheduler.events-cleanup-delay"; static const char __pyx_k_distributed_scheduler_http_route[] = "distributed.scheduler.http.routes"; static const char __pyx_k_distributed_scheduler_idle_timeo[] = "distributed.scheduler.idle-timeout"; static const char __pyx_k_distributed_scheduler_preload_ar[] = "distributed.scheduler.preload-argv"; static const char __pyx_k_distributed_scheduler_transition[] = "distributed.scheduler.transition-log-length"; static const char __pyx_k_distributed_scheduler_unknown_ta[] = "distributed.scheduler.unknown-task-duration"; static const char __pyx_k_distributed_scheduler_work_steal[] = "distributed.scheduler.work-stealing"; static const char __pyx_k_distributed_scheduler_worker_ttl[] = "distributed.scheduler.worker-ttl"; static const char __pyx_k_distributed_worker_profile_cycle[] = "distributed.worker.profile.cycle"; static const char __pyx_k_handle_missing_data_key_s_worker[] = "handle missing data key=%s worker=%s"; static const char __pyx_k_task_processing_without_all_deps[] = "task processing without all deps"; static const char __pyx_k_waiters_not_subset_of_dependents[] = "waiters not subset of dependents"; static const char __pyx_k_waiting_not_subset_of_dependenci[] = "waiting not subset of dependencies"; static const char __pyx_k_OptionalStateLegacyMapping___le_2[] = "_OptionalStateLegacyMapping.__len__"; static const char __pyx_k_Scheduler_get_profile_metadata_l_2[] = "Scheduler.get_profile_metadata.."; static const char __pyx_k_Transition_a_key_from_its_curren_2[] = "Transition a key from its current state to the finish state\n\n Examples\n --------\n >>> self.transition('x', 'waiting')\n {'x': 'processing'}\n\n Returns\n -------\n Dictionary of recommendations for future transitions\n\n See Also\n --------\n Scheduler.transitions: transitive version of this function\n "; static PyObject *__pyx_kp_u_0_0_0_0; static PyObject *__pyx_kp_u_11s_at_25s; static PyObject *__pyx_kp_u_1s; static PyObject *__pyx_kp_u_2ms; static PyObject *__pyx_kp_u_500ms; static PyObject *__pyx_kp_u_5ms; static PyObject *__pyx_kp_u_60s; static PyObject *__pyx_n_u_ALL_TASK_STATES; static PyObject *__pyx_kp_s_A_mapping_interface_mimicking_t; static PyObject *__pyx_n_s_All; static PyObject *__pyx_kp_s_An_plugin_to_share_worker_statu; static PyObject *__pyx_kp_u_Attempting_to_reschedule_task_wh; static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_n_s_BandwidthTypes; static PyObject *__pyx_n_s_BandwidthWorkers; static PyObject *__pyx_kp_u_Bandwidth_Types; static PyObject *__pyx_kp_u_Bandwidth_Workers; static PyObject *__pyx_n_s_BatchedSend; static PyObject *__pyx_kp_u_Can_not_use_replicate_to_delete; static PyObject *__pyx_kp_u_Clear_task_state; static PyObject *__pyx_n_s_ClientState; static PyObject *__pyx_kp_u_Client_s; static PyObject *__pyx_kp_u_Client_s_releases_keys_s; static PyObject *__pyx_kp_u_Client_s_requests_to_cancel_d_ke; static PyObject *__pyx_kp_u_Client_s_requests_to_retry_d_key; static PyObject *__pyx_kp_u_Close_client_connection_s; static PyObject *__pyx_kp_u_Closing_worker_s; static PyObject *__pyx_n_s_CollectTaskMetaDataPlugin; static PyObject *__pyx_n_s_CollectTaskMetaDataPlugin___init; static PyObject *__pyx_n_s_CollectTaskMetaDataPlugin_transi; static PyObject *__pyx_n_s_CollectTaskMetaDataPlugin_update; static PyObject *__pyx_n_s_CommClosedError; static PyObject *__pyx_kp_u_Communication_failed_during_repl; static PyObject *__pyx_kp_u_Couldn_t_gather_keys_s_state_s_w; static PyObject *__pyx_n_s_DEFAULT_EXTENSIONS; static PyObject *__pyx_kp_u_Dask_Performance_Report; static PyObject *__pyx_n_s_Div; static PyObject *__pyx_kp_s_Dynamic_distributed_task_schedul; static PyObject *__pyx_n_s_EnvironmentError; static PyObject *__pyx_kp_u_Error_in_reevaluate_occupancy; static PyObject *__pyx_kp_u_Error_transitioning_r_from_r_to; static PyObject *__pyx_n_s_EventExtension; static PyObject *__pyx_kp_u_Exception_while_restarting_This; static PyObject *__pyx_kp_u_Expected_to_find_exactly_one_Col; static PyObject *__pyx_kp_u_Find_workers_that_we_can_close; static PyObject *__pyx_kp_u_Finished_handling_client_s; static PyObject *__pyx_n_s_IOLoop; static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_kp_u_Impossible_transition_from_r_to; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x38; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x3d; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x69; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x81; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x9b; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xeb; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_kp_u_Key_lost_s; static PyObject *__pyx_n_s_KilledWorker; static PyObject *__pyx_n_s_KilledWorker___init; static PyObject *__pyx_n_s_LOG_PDB; static PyObject *__pyx_n_s_Lock; static PyObject *__pyx_n_s_LockExtension; static PyObject *__pyx_kp_u_Lost_all_workers; static PyObject *__pyx_n_s_Mapping; static PyObject *__pyx_kp_u_Moving_d_keys_to_other_workers; static PyObject *__pyx_kp_u_Nannies_didn_t_report_back_resta; static PyObject *__pyx_kp_u_No_workers_found; static PyObject *__pyx_kp_u_None; static PyObject *__pyx_kp_u_Not_all_workers_responded_positi; static PyObject *__pyx_n_s_Number; static PyObject *__pyx_n_u_OK; static PyObject *__pyx_n_s_OptionalStateLegacyMapping; static PyObject *__pyx_n_s_OptionalStateLegacyMapping___ge; static PyObject *__pyx_n_s_OptionalStateLegacyMapping___it; static PyObject *__pyx_n_s_OptionalStateLegacyMapping___le; static PyObject *__pyx_n_s_OptionalStateLegacyMapping___le_2; static PyObject *__pyx_n_s_Panel; static PyObject *__pyx_n_s_PeriodicCallback; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_kp_u_Plugin_failed_with_exception; static PyObject *__pyx_n_s_Process; static PyObject *__pyx_n_s_PubSubSchedulerExtension; static PyObject *__pyx_n_s_PublishExtension; static PyObject *__pyx_n_s_Py_hash_t; static PyObject *__pyx_n_s_Py_ssize_t; static PyObject *__pyx_n_u_Py_ssize_t; static PyObject *__pyx_n_s_QueueExtension; static PyObject *__pyx_kp_u_Receive_client_connection_s; static PyObject *__pyx_kp_u_Received_already_computed_task_w; static PyObject *__pyx_kp_u_Received_long_running_signal_fro; static PyObject *__pyx_kp_u_Register_worker_s; static PyObject *__pyx_kp_u_Remove_client_s; static PyObject *__pyx_kp_u_Remove_worker_s; static PyObject *__pyx_kp_u_Removed_worker_s; static PyObject *__pyx_n_s_ReplayExceptionScheduler; static PyObject *__pyx_kp_u_Retire_worker_names_s; static PyObject *__pyx_kp_u_Retire_workers_s; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_Scheduler; static PyObject *__pyx_n_s_SchedulerPlugin; static PyObject *__pyx_n_s_SchedulerState; static PyObject *__pyx_kp_u_Scheduler_2; static PyObject *__pyx_kp_u_Scheduler_Broadcast; static PyObject *__pyx_kp_u_Scheduler_Client; static PyObject *__pyx_kp_u_Scheduler_Profile_administrative; static PyObject *__pyx_n_s_Scheduler___init; static PyObject *__pyx_n_s_Scheduler___init___locals_lambda; static PyObject *__pyx_n_s_Scheduler___repr; static PyObject *__pyx_n_s_Scheduler__delete_worker_data; static PyObject *__pyx_n_s_Scheduler__transition; static PyObject *__pyx_kp_u_Scheduler__transition_line_5845; static PyObject *__pyx_n_s_Scheduler_adaptive_target; static PyObject *__pyx_n_s_Scheduler_add_client; static PyObject *__pyx_n_s_Scheduler_add_keys; static PyObject *__pyx_n_s_Scheduler_add_plugin; static PyObject *__pyx_n_s_Scheduler_add_plugin_locals_gene; static PyObject *__pyx_n_s_Scheduler_add_resources; static PyObject *__pyx_n_s_Scheduler_add_worker; static PyObject *__pyx_kp_u_Scheduler_at_25s; static PyObject *__pyx_n_s_Scheduler_broadcast; static PyObject *__pyx_n_s_Scheduler_broadcast_locals_send; static PyObject *__pyx_n_s_Scheduler_cancel_key; static PyObject *__pyx_n_s_Scheduler_cancel_key_locals_lamb; static PyObject *__pyx_kp_u_Scheduler_cancels_key_s_Force_s; static PyObject *__pyx_n_s_Scheduler_check_idle; static PyObject *__pyx_n_s_Scheduler_check_worker_ttl; static PyObject *__pyx_n_s_Scheduler_clear_task_state; static PyObject *__pyx_n_s_Scheduler_client_desires_keys; static PyObject *__pyx_n_s_Scheduler_client_heartbeat; static PyObject *__pyx_n_s_Scheduler_client_releases_keys; static PyObject *__pyx_n_s_Scheduler_client_send; static PyObject *__pyx_n_s_Scheduler_close; static PyObject *__pyx_n_s_Scheduler_close_worker; static PyObject *__pyx_kp_u_Scheduler_closing; static PyObject *__pyx_kp_u_Scheduler_closing_after_being_id; static PyObject *__pyx_kp_u_Scheduler_closing_all_comms; static PyObject *__pyx_n_s_Scheduler_coerce_address; static PyObject *__pyx_kp_u_Scheduler_connection_to_worker; static PyObject *__pyx_n_s_Scheduler_feed; static PyObject *__pyx_n_s_Scheduler_gather; static PyObject *__pyx_n_s_Scheduler_get_call_stack; static PyObject *__pyx_n_s_Scheduler_get_call_stack_locals; static PyObject *__pyx_n_s_Scheduler_get_events; static PyObject *__pyx_n_s_Scheduler_get_has_what; static PyObject *__pyx_n_s_Scheduler_get_metadata; static PyObject *__pyx_n_s_Scheduler_get_nbytes; static PyObject *__pyx_n_s_Scheduler_get_nbytes_locals_lamb; static PyObject *__pyx_n_s_Scheduler_get_ncores; static PyObject *__pyx_n_s_Scheduler_get_processing; static PyObject *__pyx_n_s_Scheduler_get_profile; static PyObject *__pyx_n_s_Scheduler_get_profile_locals_gen; static PyObject *__pyx_n_s_Scheduler_get_profile_metadata; static PyObject *__pyx_n_s_Scheduler_get_profile_metadata_l; static PyObject *__pyx_n_s_Scheduler_get_profile_metadata_l_2; static PyObject *__pyx_n_s_Scheduler_get_task_status; static PyObject *__pyx_n_s_Scheduler_get_task_stream; static PyObject *__pyx_n_s_Scheduler_get_who_has; static PyObject *__pyx_n_s_Scheduler_get_worker_logs; static PyObject *__pyx_n_s_Scheduler_get_worker_service_add; static PyObject *__pyx_n_s_Scheduler_handle_long_running; static PyObject *__pyx_n_s_Scheduler_handle_missing_data; static PyObject *__pyx_n_s_Scheduler_handle_release_data; static PyObject *__pyx_n_s_Scheduler_handle_task_erred; static PyObject *__pyx_n_s_Scheduler_handle_task_finished; static PyObject *__pyx_n_s_Scheduler_handle_uncaught_error; static PyObject *__pyx_n_s_Scheduler_handle_worker; static PyObject *__pyx_n_s_Scheduler_heartbeat_worker; static PyObject *__pyx_n_s_Scheduler_identity; static PyObject *__pyx_n_s_Scheduler_log_event; static PyObject *__pyx_n_s_Scheduler_log_worker_event; static PyObject *__pyx_n_s_Scheduler_new_task; static PyObject *__pyx_n_s_Scheduler_performance_report; static PyObject *__pyx_n_s_Scheduler_performance_report_loc; static PyObject *__pyx_n_s_Scheduler_proxy; static PyObject *__pyx_n_s_Scheduler_rebalance; static PyObject *__pyx_n_s_Scheduler_rebalance_locals_genex; static PyObject *__pyx_n_s_Scheduler_rebalance_locals_lambd; static PyObject *__pyx_n_s_Scheduler_reevaluate_occupancy; static PyObject *__pyx_n_s_Scheduler_register_worker_plugin; static PyObject *__pyx_n_s_Scheduler_release_worker_data; static PyObject *__pyx_n_s_Scheduler_remove_client; static PyObject *__pyx_n_s_Scheduler_remove_client_locals_r; static PyObject *__pyx_n_s_Scheduler_remove_plugin; static PyObject *__pyx_n_s_Scheduler_remove_resources; static PyObject *__pyx_n_s_Scheduler_remove_worker; static PyObject *__pyx_n_s_Scheduler_remove_worker_locals_r; static PyObject *__pyx_n_s_Scheduler_replicate; static PyObject *__pyx_n_s_Scheduler_replicate_locals_genex; static PyObject *__pyx_n_s_Scheduler_report; static PyObject *__pyx_n_s_Scheduler_report_on_key; static PyObject *__pyx_n_s_Scheduler_reschedule; static PyObject *__pyx_n_s_Scheduler_restart; static PyObject *__pyx_n_s_Scheduler_restart_locals_genexpr; static PyObject *__pyx_n_s_Scheduler_retire_workers; static PyObject *__pyx_n_s_Scheduler_run_function; static PyObject *__pyx_n_s_Scheduler_scatter; static PyObject *__pyx_n_s_Scheduler_send_all; static PyObject *__pyx_n_s_Scheduler_send_task_to_worker; static PyObject *__pyx_n_s_Scheduler_set_metadata; static PyObject *__pyx_n_s_Scheduler_start; static PyObject *__pyx_n_s_Scheduler_start_ipython; static PyObject *__pyx_n_s_Scheduler_start_locals_del_sched; static PyObject *__pyx_n_s_Scheduler_start_task_metadata; static PyObject *__pyx_n_s_Scheduler_stimulus_cancel; static PyObject *__pyx_n_s_Scheduler_stimulus_missing_data; static PyObject *__pyx_n_s_Scheduler_stimulus_retry; static PyObject *__pyx_n_s_Scheduler_stimulus_task_erred; static PyObject *__pyx_n_s_Scheduler_stimulus_task_finished; static PyObject *__pyx_n_s_Scheduler_stop_task_metadata; static PyObject *__pyx_n_s_Scheduler_story; static PyObject *__pyx_n_s_Scheduler_subscribe_worker_statu; static PyObject *__pyx_n_s_Scheduler_transition; static PyObject *__pyx_kp_u_Scheduler_transition_line_5989; static PyObject *__pyx_n_s_Scheduler_transitions; static PyObject *__pyx_n_s_Scheduler_update_data; static PyObject *__pyx_n_s_Scheduler_update_graph; static PyObject *__pyx_n_s_Scheduler_update_graph_hlg; static PyObject *__pyx_n_s_Scheduler_update_graph_locals_ge; static PyObject *__pyx_n_s_Scheduler_validate_erred; static PyObject *__pyx_n_s_Scheduler_validate_key; static PyObject *__pyx_n_s_Scheduler_validate_memory; static PyObject *__pyx_n_s_Scheduler_validate_no_worker; static PyObject *__pyx_n_s_Scheduler_validate_processing; static PyObject *__pyx_n_s_Scheduler_validate_released; static PyObject *__pyx_n_s_Scheduler_validate_state; static PyObject *__pyx_n_s_Scheduler_validate_state_locals; static PyObject *__pyx_n_s_Scheduler_validate_waiting; static PyObject *__pyx_n_s_Scheduler_worker_send; static PyObject *__pyx_n_s_Scheduler_workers_list; static PyObject *__pyx_n_s_Scheduler_workers_to_close; static PyObject *__pyx_kp_u_Scheduler_workers_to_close_line; static PyObject *__pyx_n_s_Scheduler_workers_to_close_local; static PyObject *__pyx_n_s_Security; static PyObject *__pyx_n_s_SemaphoreExtension; static PyObject *__pyx_kp_u_Send_kill_signal_to_nannies_s; static PyObject *__pyx_kp_u_Send_lost_future_signal_to_clien; static PyObject *__pyx_n_s_ServerNode; static PyObject *__pyx_n_s_Set; static PyObject *__pyx_kp_s_Similar_to__StateLegacyMapping; static PyObject *__pyx_kp_s_Similar_to__StateLegacyMapping_2; static PyObject *__pyx_n_s_SortedDict; static PyObject *__pyx_kp_u_Starting_worker_compute_stream_s; static PyObject *__pyx_n_s_StateLegacyMapping; static PyObject *__pyx_n_s_StateLegacyMapping___getitem; static PyObject *__pyx_n_s_StateLegacyMapping___init; static PyObject *__pyx_n_s_StateLegacyMapping___iter; static PyObject *__pyx_n_s_StateLegacyMapping___len; static PyObject *__pyx_n_s_StateLegacyMapping___repr; static PyObject *__pyx_n_s_StateLegacySet; static PyObject *__pyx_n_s_StateLegacySet___contains; static PyObject *__pyx_n_s_StateLegacySet___init; static PyObject *__pyx_n_s_StateLegacySet___iter; static PyObject *__pyx_n_s_StateLegacySet___iter___locals; static PyObject *__pyx_n_s_StateLegacySet___len; static PyObject *__pyx_n_s_StateLegacySet___repr; static PyObject *__pyx_n_s_Status; static PyObject *__pyx_kp_u_Stimulus_missing_data_s_s; static PyObject *__pyx_kp_u_Stimulus_task_erred_s_s; static PyObject *__pyx_kp_u_Stimulus_task_finished_s_s; static PyObject *__pyx_n_s_StopIteration; static PyObject *__pyx_kp_u_Suggest_closing_workers_s; static PyObject *__pyx_n_u_Summary; static PyObject *__pyx_n_s_T; static PyObject *__pyx_n_s_Tabs; static PyObject *__pyx_kp_u_Task; static PyObject *__pyx_n_s_TaskGroup; static PyObject *__pyx_n_s_TaskPrefix; static PyObject *__pyx_n_s_TaskState; static PyObject *__pyx_n_u_TaskState; static PyObject *__pyx_n_s_TaskStreamPlugin; static PyObject *__pyx_kp_u_Task_Stream; static PyObject *__pyx_kp_u_Task_s_marked_as_failed_because; static PyObject *__pyx_kp_u_This_Worker; static PyObject *__pyx_n_s_TimeoutError; static PyObject *__pyx_kp_u_Transition_a_key_from_its_curren; static PyObject *__pyx_kp_u_Transition_a_key_from_its_curren_2; static PyObject *__pyx_kp_u_Transitioned_r_s_s_actual_s_Cons; static PyObject *__pyx_kp_u_Tried_to_call_feed_route_with_cu; static PyObject *__pyx_kp_u_Tried_writing_to_closed_comm_s; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_u_Unexpected_worker_completed_task; static PyObject *__pyx_kp_u_Update_data_s; static PyObject *__pyx_kp_u_User_asked_for_computation_on_lo; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_VariableExtension; static PyObject *__pyx_n_s_WeakSet; static PyObject *__pyx_n_s_WorkStealing; static PyObject *__pyx_kp_u_Worker; static PyObject *__pyx_n_s_WorkerState; static PyObject *__pyx_kp_u_WorkerState_ncores_has_moved_to; static PyObject *__pyx_n_s_WorkerStatusPlugin; static PyObject *__pyx_n_s_WorkerStatusPlugin___init; static PyObject *__pyx_n_s_WorkerStatusPlugin_add_worker; static PyObject *__pyx_n_s_WorkerStatusPlugin_remove_worker; static PyObject *__pyx_n_s_WorkerStatusPlugin_teardown; static PyObject *__pyx_n_u_Worker_2; static PyObject *__pyx_kp_u_Worker_Profile_administrative; static PyObject *__pyx_kp_u_Worker_Profile_compute; static PyObject *__pyx_kp_u_Worker_already_exists_s; static PyObject *__pyx_kp_u_Worker_failed_to_heartbeat_withi; static PyObject *__pyx_kp_u_Worker_holding_Actor_was_lost; static PyObject *__pyx_kp_u_Worker_tried_to_connect_with_a_d; static PyObject *__pyx_kp_u_Workers_don_t_have_promised_key; static PyObject *__pyx_kp_u_Workers_not_the_same_in_all_coll; static PyObject *__pyx_kp_u__14; static PyObject *__pyx_kp_u__3; static PyObject *__pyx_kp_u__4; static PyObject *__pyx_kp_u__48; static PyObject *__pyx_kp_u__5; static PyObject *__pyx_n_s__50; static PyObject *__pyx_kp_u__50; static PyObject *__pyx_kp_u__51; static PyObject *__pyx_kp_u__53; static PyObject *__pyx_kp_u__6; static PyObject *__pyx_kp_u__60; static PyObject *__pyx_n_u__61; static PyObject *__pyx_kp_u__7; static PyObject *__pyx_kp_u__8; static PyObject *__pyx_kp_u__84; static PyObject *__pyx_kp_u__9; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_s_a_cmsgs; static PyObject *__pyx_n_s_a_recs; static PyObject *__pyx_n_s_a_wmsgs; static PyObject *__pyx_n_s_abort; static PyObject *__pyx_n_s_abspath; static PyObject *__pyx_n_s_accessor; static PyObject *__pyx_n_s_accessor_2; static PyObject *__pyx_n_u_action; static PyObject *__pyx_n_s_active; static PyObject *__pyx_n_s_actor; static PyObject *__pyx_n_u_actor; static PyObject *__pyx_n_u_actor_2; static PyObject *__pyx_n_s_actors; static PyObject *__pyx_n_u_actors_2; static PyObject *__pyx_n_s_actual_total_occupancy; static PyObject *__pyx_n_s_adaptive_target; static PyObject *__pyx_n_u_adaptive_target; static PyObject *__pyx_n_s_add; static PyObject *__pyx_n_u_add; static PyObject *__pyx_n_s_add_callback; static PyObject *__pyx_n_s_add_client; static PyObject *__pyx_kp_u_add_client_2; static PyObject *__pyx_kp_u_add_keys; static PyObject *__pyx_n_s_add_keys_2; static PyObject *__pyx_n_u_add_keys_2; static PyObject *__pyx_n_s_add_plugin; static PyObject *__pyx_n_s_add_resources; static PyObject *__pyx_n_s_add_timeout; static PyObject *__pyx_n_s_add_worker; static PyObject *__pyx_kp_u_add_worker_2; static PyObject *__pyx_n_s_addr; static PyObject *__pyx_n_s_address; static PyObject *__pyx_n_u_address; static PyObject *__pyx_n_u_address_2; static PyObject *__pyx_n_s_addresses; static PyObject *__pyx_n_u_addresses; static PyObject *__pyx_n_s_addresses_from_user_args; static PyObject *__pyx_kp_u_addresses_should_be_strings_or_t; static PyObject *__pyx_n_s_aenter; static PyObject *__pyx_n_s_aexit; static PyObject *__pyx_n_s_aliases; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_u_all; static PyObject *__pyx_n_s_all_forgotten; static PyObject *__pyx_n_s_allow_offload; static PyObject *__pyx_n_u_allow_other_workers; static PyObject *__pyx_n_s_allow_overlap; static PyObject *__pyx_n_s_allowed_failures; static PyObject *__pyx_n_s_alpha; static PyObject *__pyx_n_s_already_in_memory; static PyObject *__pyx_kp_u_already_removed; static PyObject *__pyx_n_s_annotations; static PyObject *__pyx_n_u_annotations_2; static PyObject *__pyx_n_s_any; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_asyncio; static PyObject *__pyx_n_s_asyncio_coroutines; static PyObject *__pyx_n_s_asyncio_tasks; static PyObject *__pyx_n_s_attrgetter; static PyObject *__pyx_n_s_attribute; static PyObject *__pyx_n_s_avg; static PyObject *__pyx_n_s_avg_duration; static PyObject *__pyx_n_s_await; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_b_cmsgs; static PyObject *__pyx_n_s_b_recs; static PyObject *__pyx_n_s_b_wmsgs; static PyObject *__pyx_n_u_bandwidth; static PyObject *__pyx_n_u_bandwidth_2; static PyObject *__pyx_n_s_bandwidth_types; static PyObject *__pyx_n_s_bandwidth_workers; static PyObject *__pyx_n_s_batched; static PyObject *__pyx_n_s_bcomm; static PyObject *__pyx_n_s_bint; static PyObject *__pyx_n_s_bokeh_core_templates; static PyObject *__pyx_n_s_bokeh_models; static PyObject *__pyx_n_s_bokeh_plotting; static PyObject *__pyx_n_s_branching_factor; static PyObject *__pyx_kp_u_branching_factor_2; static PyObject *__pyx_n_s_broadcast; static PyObject *__pyx_n_u_broadcast; static PyObject *__pyx_kp_u_but_found; static PyObject *__pyx_n_s_bw; static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_s_c_double; static PyObject *__pyx_n_s_c_ssize_t; static PyObject *__pyx_n_s_call_later; static PyObject *__pyx_n_s_call_stack; static PyObject *__pyx_n_u_call_stack; static PyObject *__pyx_n_s_cancel; static PyObject *__pyx_n_u_cancel; static PyObject *__pyx_n_s_cancel_key; static PyObject *__pyx_kp_u_cancelled_key; static PyObject *__pyx_n_s_cast; static PyObject *__pyx_n_s_cause; static PyObject *__pyx_n_s_ccall; static PyObject *__pyx_n_s_cclass; static PyObject *__pyx_n_s_ceil; static PyObject *__pyx_n_s_cfunc; static PyObject *__pyx_n_s_check_idle; static PyObject *__pyx_n_s_check_idle_saturated; static PyObject *__pyx_n_s_check_worker_ttl; static PyObject *__pyx_n_s_child; static PyObject *__pyx_n_s_child_deps; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_clean_exception; static PyObject *__pyx_n_s_cleanup_delay; static PyObject *__pyx_n_s_clear; static PyObject *__pyx_n_s_clear_task_state; static PyObject *__pyx_n_s_client; static PyObject *__pyx_n_u_client; static PyObject *__pyx_n_s_client_comms; static PyObject *__pyx_kp_u_client_desires_keys; static PyObject *__pyx_n_s_client_desires_keys_2; static PyObject *__pyx_n_s_client_handlers; static PyObject *__pyx_n_s_client_heartbeat; static PyObject *__pyx_n_u_client_key; static PyObject *__pyx_n_s_client_keys; static PyObject *__pyx_n_s_client_msgs; static PyObject *__pyx_n_s_client_name; static PyObject *__pyx_kp_u_client_releases_keys; static PyObject *__pyx_n_s_client_releases_keys_2; static PyObject *__pyx_n_s_client_send; static PyObject *__pyx_n_s_clients; static PyObject *__pyx_n_u_clients; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_u_close; static PyObject *__pyx_kp_u_close_client; static PyObject *__pyx_n_u_close_gracefully; static PyObject *__pyx_n_s_close_rpc; static PyObject *__pyx_kp_u_close_stream; static PyObject *__pyx_n_s_close_worker; static PyObject *__pyx_kp_u_close_worker_2; static PyObject *__pyx_n_s_close_workers; static PyObject *__pyx_n_s_closed; static PyObject *__pyx_n_s_closing; static PyObject *__pyx_n_s_closing_gracefully; static PyObject *__pyx_n_s_cls; static PyObject *__pyx_n_s_code; static PyObject *__pyx_n_s_coerce_address; static PyObject *__pyx_n_s_coerce_hostname; static PyObject *__pyx_n_s_collect; static PyObject *__pyx_n_s_collection; static PyObject *__pyx_n_s_collections; static PyObject *__pyx_n_s_collections_abc; static PyObject *__pyx_n_s_comm; static PyObject *__pyx_n_s_comm_addressing; static PyObject *__pyx_n_s_compose; static PyObject *__pyx_n_u_compression; static PyObject *__pyx_n_s_compute; static PyObject *__pyx_n_u_compute; static PyObject *__pyx_n_s_compute_duration; static PyObject *__pyx_kp_u_compute_task; static PyObject *__pyx_n_s_concat; static PyObject *__pyx_n_s_config; static PyObject *__pyx_n_s_connect; static PyObject *__pyx_n_s_connection_args; static PyObject *__pyx_n_s_connection_limit; static PyObject *__pyx_n_s_consume_resources; static PyObject *__pyx_n_s_contact_address; static PyObject *__pyx_n_s_contains; static PyObject *__pyx_n_s_contextlib; static PyObject *__pyx_n_s_core; static PyObject *__pyx_kp_u_cores; static PyObject *__pyx_n_s_count; static PyObject *__pyx_n_u_count; static PyObject *__pyx_n_s_counts; static PyObject *__pyx_n_u_counts; static PyObject *__pyx_n_s_cpu; static PyObject *__pyx_n_s_cpu_percent; static PyObject *__pyx_n_s_critical; static PyObject *__pyx_n_s_cs; static PyObject *__pyx_n_s_cts; static PyObject *__pyx_n_s_ctypes; static PyObject *__pyx_n_s_current; static PyObject *__pyx_n_s_d; static PyObject *__pyx_n_u_d; static PyObject *__pyx_n_s_dashboard; static PyObject *__pyx_n_u_dashboard; static PyObject *__pyx_n_s_dashboard_address; static PyObject *__pyx_n_s_dashboard_components_scheduler; static PyObject *__pyx_n_s_dask; static PyObject *__pyx_kp_u_dask_scheduler; static PyObject *__pyx_kp_u_dask_scheduler_closed; static PyObject *__pyx_kp_u_dask_scheduler_closing; static PyObject *__pyx_kp_u_dask_scheduler_not_started; static PyObject *__pyx_n_s_dask_version; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_u_data; static PyObject *__pyx_n_s_datasets; static PyObject *__pyx_n_s_datetime; static PyObject *__pyx_n_s_debug; static PyObject *__pyx_n_s_decide_worker; static PyObject *__pyx_n_s_declare; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_default_port; static PyObject *__pyx_n_s_defaultdict; static PyObject *__pyx_n_s_del_candidates; static PyObject *__pyx_n_s_del_scheduler_file; static PyObject *__pyx_n_s_del_worker_tasks; static PyObject *__pyx_n_s_delay; static PyObject *__pyx_n_s_delete; static PyObject *__pyx_kp_u_delete_data; static PyObject *__pyx_n_s_delete_data_2; static PyObject *__pyx_n_s_delete_interval; static PyObject *__pyx_n_s_delete_worker_data; static PyObject *__pyx_n_s_dep; static PyObject *__pyx_kp_u_dep_missing; static PyObject *__pyx_n_s_dependencies; static PyObject *__pyx_n_u_dependencies; static PyObject *__pyx_n_u_dependencies_2; static PyObject *__pyx_n_s_dependents; static PyObject *__pyx_n_u_dependents; static PyObject *__pyx_n_u_dependents_2; static PyObject *__pyx_n_s_deps; static PyObject *__pyx_n_s_deque; static PyObject *__pyx_n_s_deserialize; static PyObject *__pyx_n_s_diagnostics_plugin; static PyObject *__pyx_n_s_diagnostics_task_stream; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_u_dict_2; static PyObject *__pyx_n_s_digests; static PyObject *__pyx_n_s_dirname; static PyObject *__pyx_n_s_disable_gc_diagnosis; static PyObject *__pyx_n_s_discard; static PyObject *__pyx_n_s_distributed; static PyObject *__pyx_kp_u_distributed_adaptive_target_dura; static PyObject *__pyx_kp_u_distributed_admin_pdb_on_err; static PyObject *__pyx_n_s_distributed_dashboard_components; static PyObject *__pyx_n_s_distributed_dashboard_scheduler; static PyObject *__pyx_n_s_distributed_diagnostics_task_str; static PyObject *__pyx_kp_u_distributed_http_scheduler_missi; static PyObject *__pyx_n_s_distributed_scheduler; static PyObject *__pyx_kp_u_distributed_scheduler_allowed_fa; static PyObject *__pyx_kp_u_distributed_scheduler_bandwidth; static PyObject *__pyx_kp_u_distributed_scheduler_default_da; static PyObject *__pyx_kp_u_distributed_scheduler_default_ta; static PyObject *__pyx_kp_u_distributed_scheduler_events_cle; static PyObject *__pyx_kp_u_distributed_scheduler_http_route; static PyObject *__pyx_kp_u_distributed_scheduler_idle_timeo; static PyObject *__pyx_kp_u_distributed_scheduler_pickle; static PyObject *__pyx_kp_u_distributed_scheduler_preload; static PyObject *__pyx_kp_u_distributed_scheduler_preload_ar; static PyObject *__pyx_kp_s_distributed_scheduler_py; static PyObject *__pyx_kp_u_distributed_scheduler_transition; static PyObject *__pyx_kp_u_distributed_scheduler_unknown_ta; static PyObject *__pyx_kp_u_distributed_scheduler_validate; static PyObject *__pyx_kp_u_distributed_scheduler_work_steal; static PyObject *__pyx_kp_u_distributed_scheduler_worker_ttl; static PyObject *__pyx_n_s_distributed_version; static PyObject *__pyx_kp_u_distributed_worker_profile_cycle; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_done; static PyObject *__pyx_n_s_double; static PyObject *__pyx_n_s_dsk; static PyObject *__pyx_n_s_dsk_keys; static PyObject *__pyx_n_s_dt; static PyObject *__pyx_n_s_dts; static PyObject *__pyx_n_s_dump; static PyObject *__pyx_n_s_dumps; static PyObject *__pyx_n_s_duration; static PyObject *__pyx_n_u_duration; static PyObject *__pyx_n_s_e; static PyObject *__pyx_n_s_empty_context; static PyObject *__pyx_n_s_enable_gc_diagnosis; static PyObject *__pyx_n_s_end; static PyObject *__pyx_n_s_ensure; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_errant_worker; static PyObject *__pyx_n_u_erred; static PyObject *__pyx_n_s_erred_deps; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_u_error; static PyObject *__pyx_n_s_error_message; static PyObject *__pyx_n_s_event; static PyObject *__pyx_n_s_event_counts; static PyObject *__pyx_n_s_events; static PyObject *__pyx_n_u_events; static PyObject *__pyx_n_s_exc_info; static PyObject *__pyx_n_s_exception; static PyObject *__pyx_n_u_exception; static PyObject *__pyx_n_u_exception_2; static PyObject *__pyx_n_s_exception_blame; static PyObject *__pyx_n_u_exception_blame; static PyObject *__pyx_n_u_exception_blame_2; static PyObject *__pyx_n_u_exceptions; static PyObject *__pyx_n_u_exceptions_blame; static PyObject *__pyx_n_s_exceptval; static PyObject *__pyx_n_s_exceptval_locals_wrapper; static PyObject *__pyx_n_s_executing; static PyObject *__pyx_n_u_executing_2; static PyObject *__pyx_n_s_executor_wait; static PyObject *__pyx_n_s_exists; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_kp_u_expected_Status_or_str_got; static PyObject *__pyx_n_s_ext; static PyObject *__pyx_n_s_extend; static PyObject *__pyx_n_s_extension; static PyObject *__pyx_n_s_extensions; static PyObject *__pyx_n_u_extensions; static PyObject *__pyx_n_s_extensions_2; static PyObject *__pyx_n_s_extra; static PyObject *__pyx_n_u_extra_2; static PyObject *__pyx_n_s_f; static PyObject *__pyx_n_s_fast; static PyObject *__pyx_n_s_feed; static PyObject *__pyx_n_u_feed; static PyObject *__pyx_n_s_fifo_timeout; static PyObject *__pyx_n_s_fig; static PyObject *__pyx_n_s_figure; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_filename; static PyObject *__pyx_n_s_final; static PyObject *__pyx_n_s_finalize; static PyObject *__pyx_n_s_finish; static PyObject *__pyx_n_s_finish2; static PyObject *__pyx_n_s_finished; static PyObject *__pyx_kp_u_fire_and_forget; static PyObject *__pyx_n_s_first; static PyObject *__pyx_n_s_fn; static PyObject *__pyx_n_s_force; static PyObject *__pyx_n_u_force; static PyObject *__pyx_n_u_forgotten; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_format_bytes; static PyObject *__pyx_n_s_format_time; static PyObject *__pyx_n_s_frac; static PyObject *__pyx_n_s_func; static PyObject *__pyx_n_s_function; static PyObject *__pyx_n_u_function; static PyObject *__pyx_n_s_functools; static PyObject *__pyx_n_s_future; static PyObject *__pyx_n_s_futures; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_gather; static PyObject *__pyx_n_u_gather; static PyObject *__pyx_n_s_gather_from_workers; static PyObject *__pyx_n_s_gathers; static PyObject *__pyx_n_s_generation; static PyObject *__pyx_n_s_genexpr; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_getLogger; static PyObject *__pyx_n_s_get_address_host; static PyObject *__pyx_n_s_get_call_stack; static PyObject *__pyx_n_s_get_comm_cost; static PyObject *__pyx_n_s_get_connection_args; static PyObject *__pyx_n_s_get_connection_info; static PyObject *__pyx_n_s_get_env; static PyObject *__pyx_n_s_get_events; static PyObject *__pyx_n_s_get_fileno_limit; static PyObject *__pyx_n_s_get_handlers; static PyObject *__pyx_n_s_get_has_what; static PyObject *__pyx_n_s_get_listen_args; static PyObject *__pyx_n_s_get_logs; static PyObject *__pyx_n_u_get_logs; static PyObject *__pyx_n_s_get_metadata; static PyObject *__pyx_n_u_get_metadata; static PyObject *__pyx_n_s_get_nbytes; static PyObject *__pyx_n_s_get_ncores; static PyObject *__pyx_n_s_get_processing; static PyObject *__pyx_n_s_get_profile; static PyObject *__pyx_n_s_get_profile_metadata; static PyObject *__pyx_n_s_get_task_duration; static PyObject *__pyx_n_s_get_task_status; static PyObject *__pyx_n_u_get_task_status; static PyObject *__pyx_n_s_get_task_stream; static PyObject *__pyx_n_u_get_task_stream; static PyObject *__pyx_n_s_get_template; static PyObject *__pyx_n_s_get_versions; static PyObject *__pyx_n_s_get_who_has; static PyObject *__pyx_n_s_get_worker_logs; static PyObject *__pyx_n_s_get_worker_service_addr; static PyObject *__pyx_n_s_getitem; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_group; static PyObject *__pyx_n_u_group_2; static PyObject *__pyx_n_s_group_bytes; static PyObject *__pyx_n_u_group_key; static PyObject *__pyx_n_s_group_key_2; static PyObject *__pyx_n_s_groupby; static PyObject *__pyx_n_s_groups; static PyObject *__pyx_n_s_groups1; static PyObject *__pyx_n_s_groups2; static PyObject *__pyx_kp_u_h1_Dask_Performance_Report_h1_i; static PyObject *__pyx_n_s_handle_long_running; static PyObject *__pyx_n_s_handle_missing_data; static PyObject *__pyx_kp_u_handle_missing_data_key_s_worker; static PyObject *__pyx_n_s_handle_release_data; static PyObject *__pyx_n_s_handle_stream; static PyObject *__pyx_n_s_handle_task_erred; static PyObject *__pyx_n_s_handle_task_finished; static PyObject *__pyx_n_s_handle_uncaught_error; static PyObject *__pyx_n_s_handle_worker; static PyObject *__pyx_n_s_handlers; static PyObject *__pyx_n_s_handshake_overrides; static PyObject *__pyx_n_u_handshake_overrides; static PyObject *__pyx_n_u_has_lost_dependencies; static PyObject *__pyx_n_s_has_what; static PyObject *__pyx_n_u_has_what; static PyObject *__pyx_n_u_has_what_2; static PyObject *__pyx_n_u_hash; static PyObject *__pyx_n_u_heartbeat; static PyObject *__pyx_kp_u_heartbeat_client; static PyObject *__pyx_kp_u_heartbeat_interval; static PyObject *__pyx_n_s_heartbeat_interval_2; static PyObject *__pyx_n_s_heartbeat_worker; static PyObject *__pyx_n_u_heartbeat_worker; static PyObject *__pyx_n_s_highlevelgraph_unpack; static PyObject *__pyx_n_s_hlg; static PyObject *__pyx_n_s_host; static PyObject *__pyx_n_u_host; static PyObject *__pyx_n_s_host_info; static PyObject *__pyx_n_u_host_info; static PyObject *__pyx_n_u_host_restrictions; static PyObject *__pyx_n_u_host_restrictions_2; static PyObject *__pyx_n_s_hosts; static PyObject *__pyx_kp_u_html; static PyObject *__pyx_n_s_html_2; static PyObject *__pyx_n_s_http; static PyObject *__pyx_n_s_http_application; static PyObject *__pyx_n_s_http_prefix; static PyObject *__pyx_n_s_http_server; static PyObject *__pyx_n_s_http_server_modules; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_u_id; static PyObject *__pyx_n_s_idempotent; static PyObject *__pyx_n_s_ident; static PyObject *__pyx_n_s_identity; static PyObject *__pyx_n_s_idle; static PyObject *__pyx_n_u_idle; static PyObject *__pyx_n_s_idle_since; static PyObject *__pyx_n_s_idle_timeout; static PyObject *__pyx_kp_u_idle_timeout_2; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_indent; static PyObject *__pyx_n_s_info; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_inline; static PyObject *__pyx_kp_u_inproc; static PyObject *__pyx_n_s_inspect; static PyObject *__pyx_n_s_instances; static PyObject *__pyx_n_s_interface; static PyObject *__pyx_n_s_intersection; static PyObject *__pyx_n_s_interval; static PyObject *__pyx_n_s_io_loop; static PyObject *__pyx_n_s_ip; static PyObject *__pyx_n_s_ipython_kernel; static PyObject *__pyx_n_s_ipython_utils; static PyObject *__pyx_n_s_is_idle; static PyObject *__pyx_n_s_isawaitable; static PyObject *__pyx_n_s_issubset; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_s_iter; static PyObject *__pyx_n_s_itertools; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_json; static PyObject *__pyx_n_s_k; static PyObject *__pyx_kp_u_keep_alive; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_u_key; static PyObject *__pyx_n_s_key_2; static PyObject *__pyx_n_u_key_2; static PyObject *__pyx_kp_u_key_count; static PyObject *__pyx_kp_u_key_in_memory; static PyObject *__pyx_n_s_key_split; static PyObject *__pyx_n_s_key_split_group; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_u_keys; static PyObject *__pyx_n_s_kv; static PyObject *__pyx_n_s_kwargs; static PyObject *__pyx_n_s_last; static PyObject *__pyx_n_s_last_client; static PyObject *__pyx_n_u_last_seen; static PyObject *__pyx_kp_u_last_seen_2; static PyObject *__pyx_n_u_last_seen_3; static PyObject *__pyx_n_s_last_time; static PyObject *__pyx_n_s_last_worker; static PyObject *__pyx_n_s_legacy_client_key_set; static PyObject *__pyx_n_s_legacy_task_key_dict; static PyObject *__pyx_n_s_legacy_task_key_set; static PyObject *__pyx_n_s_legacy_worker_key_set; static PyObject *__pyx_n_s_len; static PyObject *__pyx_n_s_len_2; static PyObject *__pyx_kp_u_li; static PyObject *__pyx_kp_u_li_2; static PyObject *__pyx_n_s_limit; static PyObject *__pyx_n_s_limit_bytes; static PyObject *__pyx_n_s_listen; static PyObject *__pyx_n_s_listen_address; static PyObject *__pyx_n_s_listen_ip; static PyObject *__pyx_n_s_listener; static PyObject *__pyx_n_s_listeners; static PyObject *__pyx_n_s_loader; static PyObject *__pyx_n_s_loads; static PyObject *__pyx_n_s_local_directory; static PyObject *__pyx_n_u_local_directory; static PyObject *__pyx_n_u_local_directory_2; static PyObject *__pyx_n_s_local_now; static PyObject *__pyx_n_u_localhost; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_lock_2; static PyObject *__pyx_n_s_log; static PyObject *__pyx_n_s_log_errors; static PyObject *__pyx_kp_u_log_event; static PyObject *__pyx_n_s_log_event_2; static PyObject *__pyx_n_u_log_event_2; static PyObject *__pyx_n_s_log_worker_event; static PyObject *__pyx_n_s_logger; static PyObject *__pyx_n_s_logging; static PyObject *__pyx_n_u_logs; static PyObject *__pyx_kp_u_long_running; static PyObject *__pyx_n_s_loop; static PyObject *__pyx_n_s_loose_restrictions; static PyObject *__pyx_n_u_loose_restrictions; static PyObject *__pyx_n_u_loose_restrictions_2; static PyObject *__pyx_kp_u_lost_data; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_map; static PyObject *__pyx_n_s_math; static PyObject *__pyx_n_s_maxlen; static PyObject *__pyx_kp_u_memory; static PyObject *__pyx_n_s_memory_2; static PyObject *__pyx_n_u_memory_2; static PyObject *__pyx_n_s_memory_limit; static PyObject *__pyx_n_u_memory_limit; static PyObject *__pyx_n_u_memory_limit_2; static PyObject *__pyx_n_s_memory_ratio; static PyObject *__pyx_n_s_merge; static PyObject *__pyx_n_s_merge_sorted; static PyObject *__pyx_n_s_merge_with; static PyObject *__pyx_n_s_merge_workers; static PyObject *__pyx_n_u_message; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_metadata; static PyObject *__pyx_n_u_metadata; static PyObject *__pyx_n_u_metadata_2; static PyObject *__pyx_n_s_metrics; static PyObject *__pyx_n_u_metrics; static PyObject *__pyx_n_u_metrics_2; static PyObject *__pyx_n_s_min; static PyObject *__pyx_n_s_minimum; static PyObject *__pyx_n_u_missing; static PyObject *__pyx_n_s_missing_bokeh; static PyObject *__pyx_kp_u_missing_data; static PyObject *__pyx_n_s_missing_data_2; static PyObject *__pyx_n_s_missing_keys; static PyObject *__pyx_n_s_missing_states; static PyObject *__pyx_n_s_missing_workers; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_modules; static PyObject *__pyx_n_u_moved_keys; static PyObject *__pyx_kp_u_moved_keys_2; static PyObject *__pyx_n_u_ms; static PyObject *__pyx_n_s_msg; static PyObject *__pyx_n_s_msg_key; static PyObject *__pyx_n_s_msgs; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_u_n; static PyObject *__pyx_n_s_n_missing; static PyObject *__pyx_n_s_n_remain; static PyObject *__pyx_n_u_n_tasks; static PyObject *__pyx_n_s_n_workers; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_u_name; static PyObject *__pyx_kp_u_name_2; static PyObject *__pyx_n_s_name_3; static PyObject *__pyx_n_u_name_4; static PyObject *__pyx_kp_u_name_taken_s; static PyObject *__pyx_n_s_names; static PyObject *__pyx_n_s_nannies; static PyObject *__pyx_n_s_nanny; static PyObject *__pyx_n_u_nanny; static PyObject *__pyx_n_u_nanny_2; static PyObject *__pyx_n_s_nanny_addr; static PyObject *__pyx_n_s_nanny_address; static PyObject *__pyx_n_s_nb; static PyObject *__pyx_n_s_nbytes; static PyObject *__pyx_n_u_nbytes; static PyObject *__pyx_n_u_nbytes_2; static PyObject *__pyx_n_u_ncores; static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_new_2; static PyObject *__pyx_n_s_new_attr; static PyObject *__pyx_n_s_new_cmsgs; static PyObject *__pyx_n_s_new_duration; static PyObject *__pyx_n_s_new_msgs; static PyObject *__pyx_n_s_new_recs; static PyObject *__pyx_n_s_new_task; static PyObject *__pyx_n_s_new_wmsgs; static PyObject *__pyx_n_s_next_time; static PyObject *__pyx_n_s_no_default; static PyObject *__pyx_kp_u_no_group; static PyObject *__pyx_kp_u_no_worker; static PyObject *__pyx_n_s_node; static PyObject *__pyx_n_s_nogil; static PyObject *__pyx_n_s_normalize_address; static PyObject *__pyx_kp_u_not_found; static PyObject *__pyx_kp_u_not_in_dependency_s_dependents; static PyObject *__pyx_kp_u_not_in_dependent_s_dependencies; static PyObject *__pyx_kp_u_not_in_has_what_who_has; static PyObject *__pyx_kp_u_not_in_wants_what_who_wants; static PyObject *__pyx_kp_u_not_in_who_has_has_what; static PyObject *__pyx_kp_u_not_in_who_wants_wants_what; static PyObject *__pyx_n_s_now; static PyObject *__pyx_n_s_ns; static PyObject *__pyx_n_s_ntasks; static PyObject *__pyx_n_s_nthreads; static PyObject *__pyx_n_u_nthreads; static PyObject *__pyx_n_u_nthreads_2; static PyObject *__pyx_n_s_numbers; static PyObject *__pyx_n_s_nworkers; static PyObject *__pyx_n_s_occ; static PyObject *__pyx_n_u_occupancy; static PyObject *__pyx_n_u_occupancy_2; static PyObject *__pyx_n_s_old_attr; static PyObject *__pyx_n_s_old_duration; static PyObject *__pyx_n_s_op; static PyObject *__pyx_n_u_op; static PyObject *__pyx_n_s_open; static PyObject *__pyx_n_s_operator; static PyObject *__pyx_n_s_order; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_other; static PyObject *__pyx_n_s_other_workers; static PyObject *__pyx_n_s_out; static PyObject *__pyx_n_s_output_file; static PyObject *__pyx_n_s_p; static PyObject *__pyx_n_s_parent; static PyObject *__pyx_n_s_parse_bytes; static PyObject *__pyx_n_s_parse_timedelta; static PyObject *__pyx_n_s_partial; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_pc; static PyObject *__pyx_n_s_pdb; static PyObject *__pyx_n_s_performance_report; static PyObject *__pyx_n_u_performance_report; static PyObject *__pyx_kp_u_performance_report_html; static PyObject *__pyx_n_s_periodic_callbacks; static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pickle5; static PyObject *__pyx_kp_u_pickle_protocol; static PyObject *__pyx_n_s_pid; static PyObject *__pyx_n_u_pid_2; static PyObject *__pyx_n_s_plot_data; static PyObject *__pyx_n_s_plot_figure; static PyObject *__pyx_n_s_pluck; static PyObject *__pyx_n_s_plugin; static PyObject *__pyx_n_u_plugin; static PyObject *__pyx_kp_u_plugin_add; static PyObject *__pyx_n_s_plugins; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_popitem; static PyObject *__pyx_n_s_port; static PyObject *__pyx_n_u_port; static PyObject *__pyx_n_s_prefix; static PyObject *__pyx_n_u_prefix_2; static PyObject *__pyx_n_s_prefix_key; static PyObject *__pyx_n_s_preload; static PyObject *__pyx_n_s_preload_argv; static PyObject *__pyx_n_s_preloading; static PyObject *__pyx_n_s_preloads; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_priority; static PyObject *__pyx_n_u_priority; static PyObject *__pyx_n_u_priority_2; static PyObject *__pyx_n_s_proc; static PyObject *__pyx_n_s_process_preloads; static PyObject *__pyx_kp_u_processes; static PyObject *__pyx_kp_u_processing; static PyObject *__pyx_n_s_processing_2; static PyObject *__pyx_n_u_processing_2; static PyObject *__pyx_n_u_processing_3; static PyObject *__pyx_n_u_processing_on; static PyObject *__pyx_n_u_processing_on_2; static PyObject *__pyx_kp_u_processing_tasks; static PyObject *__pyx_n_s_proctitle; static PyObject *__pyx_n_s_profile; static PyObject *__pyx_n_u_profile; static PyObject *__pyx_n_s_profile_cycle_interval; static PyObject *__pyx_n_s_profile_metadata; static PyObject *__pyx_n_s_profile_to_figure; static PyObject *__pyx_n_s_protocol; static PyObject *__pyx_n_u_protocol; static PyObject *__pyx_n_s_protocol_highlevelgraph; static PyObject *__pyx_kp_u_protocol_s_host_s_port_d; static PyObject *__pyx_n_s_proxy; static PyObject *__pyx_n_u_proxy; static PyObject *__pyx_n_s_psutil; static PyObject *__pyx_n_s_publish; static PyObject *__pyx_n_s_pubsub; static PyObject *__pyx_n_s_put_key_in_stealable; static PyObject *__pyx_n_s_pyx_PickleError; static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_result; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_type; static PyObject *__pyx_n_s_pyx_unpickle_ClientState; static PyObject *__pyx_n_s_pyx_unpickle_SchedulerState; static PyObject *__pyx_n_s_pyx_unpickle_TaskGroup; static PyObject *__pyx_n_s_pyx_unpickle_TaskPrefix; static PyObject *__pyx_n_s_pyx_unpickle_TaskState; static PyObject *__pyx_n_s_pyx_unpickle_WorkerState; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_quantity; static PyObject *__pyx_n_s_queues; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_random; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_read; static PyObject *__pyx_n_s_rebalance; static PyObject *__pyx_n_u_rebalance; static PyObject *__pyx_n_s_recipient; static PyObject *__pyx_n_s_recipients; static PyObject *__pyx_n_u_recipients; static PyObject *__pyx_n_s_recommendations; static PyObject *__pyx_n_s_recreate_exceptions; static PyObject *__pyx_n_s_rectangles; static PyObject *__pyx_n_s_rects; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_reevaluate_occupancy; static PyObject *__pyx_kp_u_register_client; static PyObject *__pyx_kp_u_register_worker; static PyObject *__pyx_n_s_register_worker_plugin; static PyObject *__pyx_n_u_register_worker_plugin; static PyObject *__pyx_n_u_release; static PyObject *__pyx_n_s_release_resources; static PyObject *__pyx_kp_u_release_task; static PyObject *__pyx_kp_u_release_worker_data; static PyObject *__pyx_n_s_release_worker_data_2; static PyObject *__pyx_n_u_released; static PyObject *__pyx_n_s_remove; static PyObject *__pyx_n_u_remove; static PyObject *__pyx_n_s_remove_client; static PyObject *__pyx_kp_u_remove_client_2; static PyObject *__pyx_n_s_remove_client_from_events; static PyObject *__pyx_n_s_remove_key; static PyObject *__pyx_n_s_remove_key_from_stealable; static PyObject *__pyx_n_s_remove_plugin; static PyObject *__pyx_n_s_remove_resources; static PyObject *__pyx_n_s_remove_worker; static PyObject *__pyx_kp_u_remove_worker_2; static PyObject *__pyx_kp_u_remove_worker_data; static PyObject *__pyx_n_s_remove_worker_from_events; static PyObject *__pyx_n_s_removed_tasks; static PyObject *__pyx_n_s_replicate; static PyObject *__pyx_n_u_replicate; static PyObject *__pyx_kp_u_replicate_add; static PyObject *__pyx_n_s_report; static PyObject *__pyx_n_u_report; static PyObject *__pyx_kp_u_report_key; static PyObject *__pyx_n_s_report_msg; static PyObject *__pyx_n_s_report_on_key; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_n_s_repr___locals_genexpr; static PyObject *__pyx_n_s_reschedule; static PyObject *__pyx_n_u_reschedule; static PyObject *__pyx_n_s_resolve; static PyObject *__pyx_n_s_resolve_address; static PyObject *__pyx_n_s_resource; static PyObject *__pyx_n_u_resource_restrictions; static PyObject *__pyx_n_u_resource_restrictions_2; static PyObject *__pyx_n_s_resources; static PyObject *__pyx_n_u_resources; static PyObject *__pyx_n_u_resources_2; static PyObject *__pyx_n_s_resp; static PyObject *__pyx_n_s_response; static PyObject *__pyx_n_s_responses; static PyObject *__pyx_n_s_resps; static PyObject *__pyx_n_s_restart; static PyObject *__pyx_n_u_restart; static PyObject *__pyx_n_s_restrictions; static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_results; static PyObject *__pyx_n_s_retire_workers; static PyObject *__pyx_n_u_retire_workers; static PyObject *__pyx_kp_u_retire_workers_2; static PyObject *__pyx_n_u_retired; static PyObject *__pyx_n_s_retries; static PyObject *__pyx_n_u_retries; static PyObject *__pyx_n_u_retries_2; static PyObject *__pyx_n_u_retry; static PyObject *__pyx_n_s_retry_operation; static PyObject *__pyx_n_s_return; static PyObject *__pyx_n_s_return_exceptions; static PyObject *__pyx_n_s_reuse; static PyObject *__pyx_n_s_reverse; static PyObject *__pyx_n_s_reverse_dict; static PyObject *__pyx_n_s_reversed; static PyObject *__pyx_n_s_roots; static PyObject *__pyx_n_s_round_robin; static PyObject *__pyx_n_s_routes; static PyObject *__pyx_n_s_rpc; static PyObject *__pyx_n_u_rprocessing; static PyObject *__pyx_n_s_run; static PyObject *__pyx_n_s_run_function; static PyObject *__pyx_n_u_run_function; static PyObject *__pyx_kp_u_run_function_2; static PyObject *__pyx_n_s_run_spec; static PyObject *__pyx_n_u_run_spec_2; static PyObject *__pyx_n_s_runnables; static PyObject *__pyx_n_s_running; static PyObject *__pyx_n_s_s; static PyObject *__pyx_n_s_safe; static PyObject *__pyx_n_s_sample; static PyObject *__pyx_n_u_saturated; static PyObject *__pyx_n_s_save; static PyObject *__pyx_n_s_scatter; static PyObject *__pyx_n_u_scatter; static PyObject *__pyx_n_s_scatter_to_workers; static PyObject *__pyx_n_s_scheduler; static PyObject *__pyx_n_u_scheduler; static PyObject *__pyx_n_s_scheduler_file; static PyObject *__pyx_n_s_searchpath; static PyObject *__pyx_n_s_second; static PyObject *__pyx_n_s_seconds; static PyObject *__pyx_n_s_security; static PyObject *__pyx_n_s_seen; static PyObject *__pyx_n_s_self; static PyObject *__pyx_kp_u_self_validate__s_not_found; static PyObject *__pyx_n_s_semaphore; static PyObject *__pyx_n_s_send; static PyObject *__pyx_n_s_send_all; static PyObject *__pyx_n_s_send_message; static PyObject *__pyx_n_s_send_recv; static PyObject *__pyx_n_s_send_task_to_worker; static PyObject *__pyx_n_s_sender; static PyObject *__pyx_n_s_sender_keys; static PyObject *__pyx_n_u_senders; static PyObject *__pyx_n_s_serializers; static PyObject *__pyx_n_s_server; static PyObject *__pyx_n_s_service_kwargs; static PyObject *__pyx_n_s_service_name; static PyObject *__pyx_n_s_service_specs; static PyObject *__pyx_n_s_services; static PyObject *__pyx_n_u_services; static PyObject *__pyx_n_u_services_2; static PyObject *__pyx_n_s_set_duration_estimate; static PyObject *__pyx_n_s_set_metadata; static PyObject *__pyx_n_u_set_metadata; static PyObject *__pyx_n_u_set_resources; static PyObject *__pyx_n_s_set_trace; static PyObject *__pyx_n_s_setproctitle; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_setup; static PyObject *__pyx_n_s_setup_logging; static PyObject *__pyx_n_s_show_dashboard; static PyObject *__pyx_n_s_shutting_down; static PyObject *__pyx_n_s_sizing_mode; static PyObject *__pyx_n_s_sleep; static PyObject *__pyx_n_s_slots; static PyObject *__pyx_n_s_sort; static PyObject *__pyx_n_s_sorted; static PyObject *__pyx_n_s_sorted_workers; static PyObject *__pyx_n_s_sortedcontainers; static PyObject *__pyx_n_s_source; static PyObject *__pyx_n_s_spec; static PyObject *__pyx_n_s_st; static PyObject *__pyx_n_s_stack; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_u_start; static PyObject *__pyx_n_s_start_address; static PyObject *__pyx_n_s_start_finish; static PyObject *__pyx_n_s_start_http_server; static PyObject *__pyx_n_s_start_ipython; static PyObject *__pyx_n_u_start_ipython; static PyObject *__pyx_n_s_start_periodic_callbacks; static PyObject *__pyx_n_s_start_services; static PyObject *__pyx_n_s_start_task_metadata; static PyObject *__pyx_n_u_start_task_metadata; static PyObject *__pyx_n_u_started; static PyObject *__pyx_n_s_startstops; static PyObject *__pyx_n_u_startstops; static PyObject *__pyx_n_s_startswith; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_u_state; static PyObject *__pyx_n_u_state_2; static PyObject *__pyx_n_s_states; static PyObject *__pyx_n_s_states_2; static PyObject *__pyx_n_s_status; static PyObject *__pyx_n_u_status; static PyObject *__pyx_n_u_status_2; static PyObject *__pyx_n_s_stealing; static PyObject *__pyx_n_u_stealing; static PyObject *__pyx_n_s_stimulus_cancel; static PyObject *__pyx_n_s_stimulus_missing_data; static PyObject *__pyx_n_s_stimulus_retry; static PyObject *__pyx_n_s_stimulus_task_erred; static PyObject *__pyx_n_s_stimulus_task_finished; static PyObject *__pyx_n_s_stop; static PyObject *__pyx_n_u_stop; static PyObject *__pyx_n_s_stop_services; static PyObject *__pyx_n_s_stop_task_metadata; static PyObject *__pyx_n_u_stop_task_metadata; static PyObject *__pyx_n_s_story; static PyObject *__pyx_n_s_stream; static PyObject *__pyx_kp_u_stream_closed; static PyObject *__pyx_n_s_stream_comms; static PyObject *__pyx_n_s_stream_handlers; static PyObject *__pyx_kp_u_stream_start; static PyObject *__pyx_n_u_stretch_both; static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_stripped_deps; static PyObject *__pyx_n_s_submitting_task; static PyObject *__pyx_n_s_subscribe_worker_status; static PyObject *__pyx_n_u_subscribe_worker_status; static PyObject *__pyx_n_s_sum; static PyObject *__pyx_n_s_summary; static PyObject *__pyx_n_s_super; static PyObject *__pyx_n_s_suppress; static PyObject *__pyx_n_u_suspicious; static PyObject *__pyx_n_u_suspicious_2; static PyObject *__pyx_n_u_suspicious_tasks; static PyObject *__pyx_n_s_synchronize_worker_interval; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_t; static PyObject *__pyx_n_s_tabs; static PyObject *__pyx_n_s_target; static PyObject *__pyx_n_s_target_duration; static PyObject *__pyx_n_s_task; static PyObject *__pyx_n_u_task; static PyObject *__pyx_n_s_task_dict; static PyObject *__pyx_kp_u_task_erred; static PyObject *__pyx_kp_u_task_finished; static PyObject *__pyx_n_u_task_groups; static PyObject *__pyx_n_s_task_key_or_none; static PyObject *__pyx_n_u_task_prefixes; static PyObject *__pyx_kp_u_task_processing_without_all_deps; static PyObject *__pyx_kp_u_task_retried; static PyObject *__pyx_n_s_task_state_collections; static PyObject *__pyx_n_s_task_stream; static PyObject *__pyx_n_s_task_stream_figure; static PyObject *__pyx_n_s_tasks; static PyObject *__pyx_n_u_tasks; static PyObject *__pyx_n_s_tasks_by_worker; static PyObject *__pyx_n_s_tasks_processing; static PyObject *__pyx_n_s_tasks_timings; static PyObject *__pyx_n_s_teardown; static PyObject *__pyx_n_s_template; static PyObject *__pyx_n_s_template_directory; static PyObject *__pyx_n_s_template_environment; static PyObject *__pyx_n_u_templates; static PyObject *__pyx_n_u_terminate; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text; static PyObject *__pyx_n_s_tg; static PyObject *__pyx_n_s_threads; static PyObject *__pyx_n_s_throw; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_u_time; static PyObject *__pyx_kp_u_time_2; static PyObject *__pyx_n_u_time_delay; static PyObject *__pyx_n_s_time_started; static PyObject *__pyx_n_s_timedelta; static PyObject *__pyx_n_s_timeout; static PyObject *__pyx_n_s_timespent; static PyObject *__pyx_n_s_title; static PyObject *__pyx_n_s_tlz; static PyObject *__pyx_n_s_tmpfile; static PyObject *__pyx_n_s_to_close; static PyObject *__pyx_n_s_to_recipients; static PyObject *__pyx_n_s_to_senders; static PyObject *__pyx_n_s_topic; static PyObject *__pyx_n_s_tornado_ioloop; static PyObject *__pyx_n_s_total; static PyObject *__pyx_n_u_total; static PyObject *__pyx_kp_u_total_keys; static PyObject *__pyx_n_u_total_nthreads; static PyObject *__pyx_n_u_total_occupancy; static PyObject *__pyx_n_s_total_tasks; static PyObject *__pyx_n_s_touched_keys; static PyObject *__pyx_n_s_touched_tasks; static PyObject *__pyx_n_s_tp; static PyObject *__pyx_n_s_traceback; static PyObject *__pyx_n_u_traceback; static PyObject *__pyx_n_u_traceback_2; static PyObject *__pyx_n_u_tracebacks; static PyObject *__pyx_n_s_transition; static PyObject *__pyx_n_s_transition_2; static PyObject *__pyx_n_s_transition_erred_released; static PyObject *__pyx_n_s_transition_log; static PyObject *__pyx_n_s_transition_memory_forgotten; static PyObject *__pyx_n_s_transition_memory_released; static PyObject *__pyx_n_s_transition_no_worker_released; static PyObject *__pyx_n_s_transition_no_worker_waiting; static PyObject *__pyx_n_s_transition_processing_erred; static PyObject *__pyx_n_s_transition_processing_memory; static PyObject *__pyx_n_s_transition_processing_released; static PyObject *__pyx_n_s_transition_released_erred; static PyObject *__pyx_n_s_transition_released_forgotten; static PyObject *__pyx_n_s_transition_released_waiting; static PyObject *__pyx_n_s_transition_story; static PyObject *__pyx_n_s_transition_waiting_memory; static PyObject *__pyx_n_s_transition_waiting_processing; static PyObject *__pyx_n_s_transition_waiting_released; static PyObject *__pyx_n_s_transitions; static PyObject *__pyx_n_s_transitions_2; static PyObject *__pyx_n_s_ts; static PyObject *__pyx_n_s_tsp; static PyObject *__pyx_n_s_tt; static PyObject *__pyx_n_s_typ; static PyObject *__pyx_n_s_type; static PyObject *__pyx_n_u_type; static PyObject *__pyx_n_u_type_2; static PyObject *__pyx_n_s_typename; static PyObject *__pyx_n_s_types; static PyObject *__pyx_n_u_types; static PyObject *__pyx_n_s_undefined; static PyObject *__pyx_n_u_unicode; static PyObject *__pyx_n_s_union; static PyObject *__pyx_n_u_unknown_durations; static PyObject *__pyx_kp_u_unneeded_task_in_memory; static PyObject *__pyx_n_s_unparse_host_port; static PyObject *__pyx_n_u_unregister; static PyObject *__pyx_n_s_unrunnable; static PyObject *__pyx_n_u_unrunnable; static PyObject *__pyx_n_s_update; static PyObject *__pyx_kp_u_update_data; static PyObject *__pyx_n_s_update_data_2; static PyObject *__pyx_n_u_update_data_2; static PyObject *__pyx_kp_u_update_graph; static PyObject *__pyx_n_s_update_graph_2; static PyObject *__pyx_n_u_update_graph_2; static PyObject *__pyx_kp_u_update_graph_duration; static PyObject *__pyx_kp_u_update_graph_hlg; static PyObject *__pyx_n_s_update_graph_hlg_2; static PyObject *__pyx_n_u_used_resources; static PyObject *__pyx_n_u_used_resources_2; static PyObject *__pyx_n_s_user_priority; static PyObject *__pyx_n_s_utils; static PyObject *__pyx_n_s_utils_comm; static PyObject *__pyx_n_s_utils_perf; static PyObject *__pyx_n_s_v; static PyObject *__pyx_n_s_valid; static PyObject *__pyx_n_s_valid_workers; static PyObject *__pyx_n_s_validate; static PyObject *__pyx_n_u_validate; static PyObject *__pyx_n_u_validate_2; static PyObject *__pyx_n_s_validate_erred; static PyObject *__pyx_n_s_validate_key; static PyObject *__pyx_n_s_validate_memory; static PyObject *__pyx_n_s_validate_no_worker; static PyObject *__pyx_n_s_validate_processing; static PyObject *__pyx_n_s_validate_released; static PyObject *__pyx_n_s_validate_state; static PyObject *__pyx_n_s_validate_task_state; static PyObject *__pyx_n_s_validate_waiting; static PyObject *__pyx_n_s_validate_worker_state; static PyObject *__pyx_n_s_valmap; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_variable; static PyObject *__pyx_n_s_version; static PyObject *__pyx_n_s_version_info; static PyObject *__pyx_n_s_version_module; static PyObject *__pyx_n_s_version_warning; static PyObject *__pyx_n_s_versions; static PyObject *__pyx_n_u_versions; static PyObject *__pyx_n_u_versions_2; static PyObject *__pyx_n_s_vv; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_u_w; static PyObject *__pyx_n_s_wait; static PyObject *__pyx_n_s_wait_for; static PyObject *__pyx_kp_u_waiter_not_in_play; static PyObject *__pyx_n_u_waiters; static PyObject *__pyx_n_u_waiters_2; static PyObject *__pyx_kp_u_waiters_not_subset_of_dependents; static PyObject *__pyx_n_u_waiting; static PyObject *__pyx_n_u_waiting_data; static PyObject *__pyx_kp_u_waiting_not_subset_of_dependenci; static PyObject *__pyx_n_u_waiting_on; static PyObject *__pyx_n_u_waiting_on_2; static PyObject *__pyx_kp_u_waiting_on_in_memory_dep; static PyObject *__pyx_kp_u_waiting_on_released_dep; static PyObject *__pyx_n_u_wants_what; static PyObject *__pyx_n_u_wants_what_2; static PyObject *__pyx_n_s_warn; static PyObject *__pyx_n_s_warning; static PyObject *__pyx_n_s_warnings; static PyObject *__pyx_n_s_weakref; static PyObject *__pyx_n_s_wh; static PyObject *__pyx_n_s_who_has; static PyObject *__pyx_n_u_who_has; static PyObject *__pyx_n_u_who_has_2; static PyObject *__pyx_n_u_who_wants; static PyObject *__pyx_n_u_who_wants_2; static PyObject *__pyx_n_s_worker; static PyObject *__pyx_n_u_worker; static PyObject *__pyx_n_s_worker_address; static PyObject *__pyx_n_s_worker_bytes; static PyObject *__pyx_n_u_worker_bytes; static PyObject *__pyx_n_s_worker_collections; static PyObject *__pyx_n_s_worker_comm; static PyObject *__pyx_n_s_worker_coroutines; static PyObject *__pyx_n_s_worker_handlers; static PyObject *__pyx_n_s_worker_index; static PyObject *__pyx_n_u_worker_info; static PyObject *__pyx_n_s_worker_keys; static PyObject *__pyx_n_u_worker_logs; static PyObject *__pyx_n_s_worker_msgs; static PyObject *__pyx_n_s_worker_objective; static PyObject *__pyx_n_s_worker_plugins; static PyObject *__pyx_kp_u_worker_plugins_2; static PyObject *__pyx_n_u_worker_resources; static PyObject *__pyx_n_u_worker_restrictions; static PyObject *__pyx_n_u_worker_restrictions_2; static PyObject *__pyx_n_s_worker_send; static PyObject *__pyx_n_s_worker_ttl; static PyObject *__pyx_kp_u_worker_ttl_2; static PyObject *__pyx_n_s_workers; static PyObject *__pyx_n_u_workers; static PyObject *__pyx_n_s_workers_by_task; static PyObject *__pyx_n_s_workers_list; static PyObject *__pyx_n_s_workers_to_close; static PyObject *__pyx_n_u_workers_to_close; static PyObject *__pyx_n_s_wrap; static PyObject *__pyx_n_s_wrapper; static PyObject *__pyx_n_s_write; static PyObject *__pyx_n_s_ws; static PyObject *__pyx_n_s_ww; static PyObject *__pyx_n_s_wws; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_zip; static PyObject *__pyx_pf_11distributed_9scheduler_cast(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_T, PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_a, CYTHON_UNUSED PyObject *__pyx_v_k); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_2ccall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_4cclass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_6cfunc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_8declare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, CYTHON_UNUSED PyObject *__pyx_v_k); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9exceptval_wrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10exceptval(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_a, CYTHON_UNUSED PyObject *__pyx_v_k); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_12final(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14inline(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_16nogil(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ static int __pyx_pf_11distributed_9scheduler_11ClientState___init__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_versions); /* proto */ static Py_hash_t __pyx_pf_11distributed_9scheduler_11ClientState_2__hash__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_4__eq__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_6__repr__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_8__str__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_10client_key___get__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_10wants_what___get__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_9last_seen___get__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_8versions___get__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_10__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_12__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11distributed_9scheduler_11WorkerState___init__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, PyObject *__pyx_v_address, Py_ssize_t __pyx_v_pid, PyObject *__pyx_v_name, Py_ssize_t __pyx_v_nthreads, Py_ssize_t __pyx_v_memory_limit, PyObject *__pyx_v_local_directory, PyObject *__pyx_v_services, PyObject *__pyx_v_versions, PyObject *__pyx_v_nanny, PyObject *__pyx_v_extra); /* proto */ static Py_hash_t __pyx_pf_11distributed_9scheduler_11WorkerState_2__hash__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_4__eq__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6actors___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_7address___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9bandwidth___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9executing___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_5extra___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8has_what___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_4host___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9last_seen___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_15local_directory___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_12memory_limit___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_7metrics___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_4name___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_5nanny___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6nbytes___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static int __pyx_pf_11distributed_9scheduler_11WorkerState_6nbytes_2__set__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, Py_ssize_t __pyx_v_v); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8nthreads___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9occupancy___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static int __pyx_pf_11distributed_9scheduler_11WorkerState_9occupancy_2__set__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, double __pyx_v_v); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_3pid___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_10processing___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9resources___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8services___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6status___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static int __pyx_pf_11distributed_9scheduler_11WorkerState_6status_2__set__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, PyObject *__pyx_v_new_status); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_10time_delay___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_14used_resources___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8versions___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6clean(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8__repr__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_10identity(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6ncores___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_12__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_14__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11distributed_9scheduler_10TaskPrefix___init__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_4name___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_13all_durations___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_16duration_average___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_10suspicious___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_6groups___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_6states___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_6active___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_13active_states___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_8__repr___genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_2__repr__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_16nbytes_in_memory___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_12nbytes_total___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_pf_11distributed_9scheduler_10TaskPrefix_4__len__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_8duration___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_5types___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_6__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_8__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11distributed_9scheduler_9TaskGroup___init__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_4name___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_6prefix___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_6states___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_12dependencies___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_12nbytes_total___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_16nbytes_in_memory___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_8duration___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_5types___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_2add(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self, PyObject *__pyx_v_o); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_8__repr___genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_4__repr__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_pf_11distributed_9scheduler_9TaskGroup_6__len__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_8__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_10__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11distributed_9scheduler_9TaskState___init__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_run_spec); /* proto */ static Py_hash_t __pyx_pf_11distributed_9scheduler_9TaskState_2__hash__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_4__eq__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_3key___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_6prefix___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_8run_spec___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_8priority___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_5state___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static int __pyx_pf_11distributed_9scheduler_9TaskState_5state_2__set__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_12dependencies___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10dependents___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_21has_lost_dependencies___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10waiting_on___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_7waiters___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_9who_wants___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_7who_has___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_13processing_on___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static int __pyx_pf_11distributed_9scheduler_9TaskState_13processing_on_2__set__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_v); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_7retries___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_6nbytes___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static int __pyx_pf_11distributed_9scheduler_9TaskState_6nbytes_2__set__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, Py_ssize_t __pyx_v_v); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_4type___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_9exception___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_9traceback___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_15exception_blame___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10suspicious___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_17host_restrictions___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_19worker_restrictions___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_21resource_restrictions___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_18loose_restrictions___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_8metadata___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_11annotations___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_5actor___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_5group___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_9group_key___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10prefix_key___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_6add_dependency(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_8get_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10set_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_12__repr__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_14validate(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_16get_nbytes_deps(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_18__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_20__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_states, PyObject *__pyx_v_accessor); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_4__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_6__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping___iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_7__len___genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_3__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_5__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_states, PyObject *__pyx_v_accessor); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_8__iter___genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_4__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_6__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_k); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_18_legacy_task_key_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tasks); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_20_legacy_client_key_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_clients); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_22_legacy_worker_key_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_workers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_24_legacy_task_key_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task_dict); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_26_task_key_or_none(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task); /* proto */ static int __pyx_pf_11distributed_9scheduler_14SchedulerState___init__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_aliases, PyObject *__pyx_v_clients, PyObject *__pyx_v_workers, PyObject *__pyx_v_host_info, PyObject *__pyx_v_resources, PyObject *__pyx_v_tasks, PyObject *__pyx_v_unrunnable, int __pyx_v_validate, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_7aliases___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9bandwidth___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_7clients___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_10extensions___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9host_info___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_4idle___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_7n_tasks___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9resources___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9saturated___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_5tasks___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_11task_groups___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_13task_prefixes___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_13task_metadata___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_14total_nthreads___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_15total_occupancy___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static int __pyx_pf_11distributed_9scheduler_14SchedulerState_15total_occupancy_2__set__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, double __pyx_v_v); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_17unknown_durations___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_10unrunnable___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_8validate___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static int __pyx_pf_11distributed_9scheduler_14SchedulerState_8validate_2__set__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, int __pyx_v_v); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_7workers___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9__pdict_____get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_2transition_released_waiting(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_4transition_no_worker_waiting(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_6decide_worker(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_8set_duration_estimate(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_10transition_waiting_processing(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_12transition_waiting_memory(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_type, PyObject *__pyx_v_typename, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_14transition_processing_memory(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_type, PyObject *__pyx_v_typename, PyObject *__pyx_v_worker, PyObject *__pyx_v_startstops, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_16transition_memory_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_v_safe); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_18transition_released_erred(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_20transition_erred_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_22transition_waiting_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_24transition_processing_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_26transition_processing_erred(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_cause, PyObject *__pyx_v_exception, PyObject *__pyx_v_traceback, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_28transition_no_worker_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_30remove_key(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_32transition_memory_forgotten(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_34transition_released_forgotten(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_36check_idle_saturated(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, double __pyx_v_occ); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_38get_comm_cost(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_40get_task_duration(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, double __pyx_v_default); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_42valid_workers(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_44consume_resources(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_46release_resources(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_48coerce_hostname(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_host); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_50worker_objective(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_52__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_54__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_delete_interval, PyObject *__pyx_v_synchronize_worker_interval, PyObject *__pyx_v_services, PyObject *__pyx_v_service_kwargs, PyObject *__pyx_v_allowed_failures, PyObject *__pyx_v_extensions, PyObject *__pyx_v_validate, PyObject *__pyx_v_scheduler_file, PyObject *__pyx_v_security, PyObject *__pyx_v_worker_ttl, PyObject *__pyx_v_idle_timeout, PyObject *__pyx_v_interface, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_protocol, PyObject *__pyx_v_dashboard_address, PyObject *__pyx_v_dashboard, PyObject *__pyx_v_http_prefix, PyObject *__pyx_v_preload, PyObject *__pyx_v_preload_argv, PyObject *__pyx_v_plugins, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_4identity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_6get_worker_service_addr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, PyObject *__pyx_v_service_name, PyObject *__pyx_v_protocol); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_8start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_5start_del_scheduler_file(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_11close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, CYTHON_UNUSED PyObject *__pyx_v_fast, PyObject *__pyx_v_close_workers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_14close_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_worker, PyObject *__pyx_v_safe); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_17heartbeat_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_address, PyObject *__pyx_v_resolve_address, PyObject *__pyx_v_now, PyObject *__pyx_v_resources, PyObject *__pyx_v_host_info, PyObject *__pyx_v_metrics, PyObject *__pyx_v_executing); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_19add_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_address, CYTHON_UNUSED PyObject *__pyx_v_keys, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_name, PyObject *__pyx_v_resolve_address, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_types, PyObject *__pyx_v_now, PyObject *__pyx_v_resources, PyObject *__pyx_v_host_info, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_metrics, PyObject *__pyx_v_pid, PyObject *__pyx_v_services, PyObject *__pyx_v_local_directory, PyObject *__pyx_v_versions, PyObject *__pyx_v_nanny, PyObject *__pyx_v_extra); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_22update_graph_hlg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_hlg, PyObject *__pyx_v_keys, PyObject *__pyx_v_dependencies, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_priority, PyObject *__pyx_v_loose_restrictions, PyObject *__pyx_v_resources, PyObject *__pyx_v_submitting_task, PyObject *__pyx_v_retries, PyObject *__pyx_v_user_priority, PyObject *__pyx_v_actors, PyObject *__pyx_v_fifo_timeout, PyObject *__pyx_v_annotations); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_3genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_6genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_24update_graph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_tasks, PyObject *__pyx_v_keys, PyObject *__pyx_v_dependencies, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_priority, PyObject *__pyx_v_loose_restrictions, PyObject *__pyx_v_resources, PyObject *__pyx_v_submitting_task, PyObject *__pyx_v_retries, PyObject *__pyx_v_user_priority, PyObject *__pyx_v_actors, PyObject *__pyx_v_fifo_timeout, PyObject *__pyx_v_annotations); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_26new_task(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_spec, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_28stimulus_task_finished(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_30stimulus_task_erred(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, PyObject *__pyx_v_exception, PyObject *__pyx_v_traceback, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_32stimulus_missing_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cause, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_ensure, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_34stimulus_retry(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_client); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_36remove_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_address, PyObject *__pyx_v_safe, PyObject *__pyx_v_close); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_13remove_worker_remove_worker_from_events(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_39stimulus_cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_client, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda9(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_41cancel_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_client, PyObject *__pyx_v_retries, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_43client_desires_keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_client); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_45client_releases_keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_client); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_47client_heartbeat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_49validate_released(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_51validate_waiting(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_53validate_processing(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_55validate_memory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_57validate_no_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_59validate_erred(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_61validate_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_14validate_state_9genexpr47_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_63validate_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_allow_overlap); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_65report(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_msg, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, PyObject *__pyx_v_client); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_67add_client(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_client, PyObject *__pyx_v_versions); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_13remove_client_remove_client_from_events(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_70remove_client(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_72send_task_to_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, PyObject *__pyx_v_duration); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_74handle_uncaught_error(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_76handle_task_finished(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_78handle_task_erred(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_80handle_release_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_client, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_82handle_missing_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_errant_worker, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_84release_worker_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_worker); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_86handle_long_running(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, CYTHON_UNUSED PyObject *__pyx_v_worker, PyObject *__pyx_v_compute_duration); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_88handle_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_worker); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_10add_plugin_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_91add_plugin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_plugin, PyObject *__pyx_v_idempotent, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_93remove_plugin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_plugin); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_95worker_send(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_97client_send(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_99send_all(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client_msgs, PyObject *__pyx_v_worker_msgs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_101scatter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_data, PyObject *__pyx_v_workers, PyObject *__pyx_v_client, PyObject *__pyx_v_broadcast, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_104gather(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_serializers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_107clear_task_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_7restart_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_109restart(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_112broadcast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_msg, PyObject *__pyx_v_workers, PyObject *__pyx_v_hosts, PyObject *__pyx_v_nanny, PyObject *__pyx_v_serializers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9broadcast_send_message(PyObject *__pyx_self, PyObject *__pyx_v_addr); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_115proxy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_msg, PyObject *__pyx_v_worker, PyObject *__pyx_v_serializers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_118_delete_worker_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker_address, PyObject *__pyx_v_keys); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_9genexpr77_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda14(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_1genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_4genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_7genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_10genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_121rebalance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_workers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9replicate_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_124replicate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_n, PyObject *__pyx_v_workers, PyObject *__pyx_v_branching_factor, PyObject *__pyx_v_delete, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_16workers_to_close__key(PyObject *__pyx_self, PyObject *__pyx_v_group); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_127workers_to_close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_memory_ratio, PyObject *__pyx_v_n, PyObject *__pyx_v_key, PyObject *__pyx_v_minimum, PyObject *__pyx_v_target, PyObject *__pyx_v_attribute); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_129retire_workers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers, PyObject *__pyx_v_remove, PyObject *__pyx_v_close_workers, PyObject *__pyx_v_names, PyObject *__pyx_v_lock, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_132add_keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_worker, PyObject *__pyx_v_keys); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_134update_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_who_has, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_client, CYTHON_UNUSED PyObject *__pyx_v_serializers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_136report_on_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, PyObject *__pyx_v_client); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_138feed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_function, PyObject *__pyx_v_setup, PyObject *__pyx_v_teardown, PyObject *__pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_141log_worker_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_worker, PyObject *__pyx_v_topic, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_143subscribe_worker_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_145get_processing(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_147get_who_has(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_149get_has_what(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_151get_ncores(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_14get_call_stack_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_153get_call_stack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda21(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_156get_nbytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_summary); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_158run_function(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_wait); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_160set_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_162get_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_164get_task_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_166get_task_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_168start_task_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_170stop_task_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_172register_worker_plugin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_plugin, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_175_transition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_finish, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_177transition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_finish, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_179transitions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_recommendations); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_181story(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_183reschedule(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_185add_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_worker, PyObject *__pyx_v_resources); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_187remove_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_189coerce_address(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_resolve); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_191workers_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_workers); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_193start_ipython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_11get_profile_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_195get_profile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers, PyObject *__pyx_v_scheduler, PyObject *__pyx_v_server, PyObject *__pyx_v_merge_workers, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_20get_profile_metadata_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda24(PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_198get_profile_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers, CYTHON_UNUSED PyObject *__pyx_v_merge_workers, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_profile_cycle_interval); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_201performance_report(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_start, PyObject *__pyx_v_code); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_18performance_report_profile_to_figure(PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_204get_worker_logs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_n, PyObject *__pyx_v_workers, PyObject *__pyx_v_nanny); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_207log_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_209get_events(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_topic); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_211reevaluate_occupancy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, Py_ssize_t __pyx_v_worker_index); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_213check_worker_ttl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_216check_idle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_218adaptive_target(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_target_duration); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_28validate_task_state(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_30validate_worker_state(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_32validate_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tasks, PyObject *__pyx_v_workers, PyObject *__pyx_v_clients); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_34heartbeat_interval(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_12KilledWorker___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task, PyObject *__pyx_v_last_worker); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scheduler, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_2add_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_4remove_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_6teardown(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scheduler, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin_2update_graph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_scheduler, CYTHON_UNUSED PyObject *__pyx_v_dsk, PyObject *__pyx_v_keys, CYTHON_UNUSED PyObject *__pyx_v_restrictions, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin_4transition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, CYTHON_UNUSED PyObject *__pyx_v_start, PyObject *__pyx_v_finish, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_36__pyx_unpickle_ClientState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_38__pyx_unpickle_WorkerState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_40__pyx_unpickle_TaskPrefix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_42__pyx_unpickle_TaskGroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_44__pyx_unpickle_TaskState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11distributed_9scheduler_46__pyx_unpickle_SchedulerState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11distributed_9scheduler_ClientState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler_WorkerState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler_TaskPrefix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler_TaskGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler_TaskState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler_SchedulerState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct____repr__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_2___repr__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_4___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_5___len__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_7___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_9_start(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_10_close(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_11_close_worker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_12_add_worker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_13_update_graph(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_16_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_17_remove_worker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_18_cancel_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_19_validate_state(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_21_add_client(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_22_remove_client(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_23_handle_worker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_24_add_plugin(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_26_scatter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_27_gather(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_28_restart(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_30_broadcast(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_31_send_message(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_32_proxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_34_rebalance(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_35_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_36_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_37_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_38_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_39_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_40_replicate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_41_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_43_retire_workers(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_44_feed(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_46_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_48_get_profile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_49_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_51_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_52_performance_report(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_popitem = {0, &__pyx_n_s_popitem, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values = {0, &__pyx_n_s_values, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_update = {0, &__pyx_n_s_update, 0, 0, 0}; static PyObject *__pyx_float_0_1; static PyObject *__pyx_float_0_2; static PyObject *__pyx_float_0_5; static PyObject *__pyx_float_0_6; static PyObject *__pyx_float_0_8; static PyObject *__pyx_float_0_01; static PyObject *__pyx_float_0_05; static PyObject *__pyx_float_1eneg_8; static PyObject *__pyx_float_0_005; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_int_5; static PyObject *__pyx_int_8; static PyObject *__pyx_int_10; static PyObject *__pyx_int_50; static PyObject *__pyx_int_200; static PyObject *__pyx_int_8786; static PyObject *__pyx_int_8787; static PyObject *__pyx_int_100000; static PyObject *__pyx_int_59694385; static PyObject *__pyx_int_64377685; static PyObject *__pyx_int_110416975; static PyObject *__pyx_int_135525525; static PyObject *__pyx_int_163323807; static PyObject *__pyx_int_247120481; static PyObject *__pyx_int_neg_1; static double __pyx_k__13; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__57; static PyObject *__pyx_slice__83; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__77; static PyObject *__pyx_tuple__78; static PyObject *__pyx_tuple__86; static PyObject *__pyx_tuple__90; static PyObject *__pyx_tuple__93; static PyObject *__pyx_tuple__95; static PyObject *__pyx_tuple__97; static PyObject *__pyx_tuple__99; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_tuple__101; static PyObject *__pyx_tuple__103; static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__107; static PyObject *__pyx_tuple__109; static PyObject *__pyx_tuple__111; static PyObject *__pyx_tuple__113; static PyObject *__pyx_tuple__114; static PyObject *__pyx_tuple__115; static PyObject *__pyx_tuple__116; static PyObject *__pyx_tuple__117; static PyObject *__pyx_tuple__118; static PyObject *__pyx_tuple__119; static PyObject *__pyx_tuple__120; static PyObject *__pyx_tuple__122; static PyObject *__pyx_tuple__124; static PyObject *__pyx_tuple__126; static PyObject *__pyx_tuple__128; static PyObject *__pyx_tuple__130; static PyObject *__pyx_tuple__131; static PyObject *__pyx_tuple__133; static PyObject *__pyx_tuple__135; static PyObject *__pyx_tuple__137; static PyObject *__pyx_tuple__139; static PyObject *__pyx_tuple__141; static PyObject *__pyx_tuple__143; static PyObject *__pyx_tuple__145; static PyObject *__pyx_tuple__147; static PyObject *__pyx_tuple__149; static PyObject *__pyx_tuple__151; static PyObject *__pyx_tuple__153; static PyObject *__pyx_tuple__155; static PyObject *__pyx_tuple__157; static PyObject *__pyx_tuple__158; static PyObject *__pyx_tuple__160; static PyObject *__pyx_tuple__162; static PyObject *__pyx_tuple__163; static PyObject *__pyx_tuple__165; static PyObject *__pyx_tuple__166; static PyObject *__pyx_tuple__167; static PyObject *__pyx_tuple__168; static PyObject *__pyx_tuple__169; static PyObject *__pyx_tuple__170; static PyObject *__pyx_tuple__171; static PyObject *__pyx_tuple__173; static PyObject *__pyx_tuple__174; static PyObject *__pyx_tuple__175; static PyObject *__pyx_tuple__176; static PyObject *__pyx_tuple__178; static PyObject *__pyx_tuple__179; static PyObject *__pyx_tuple__181; static PyObject *__pyx_tuple__182; static PyObject *__pyx_tuple__184; static PyObject *__pyx_tuple__186; static PyObject *__pyx_tuple__187; static PyObject *__pyx_tuple__189; static PyObject *__pyx_tuple__190; static PyObject *__pyx_tuple__192; static PyObject *__pyx_tuple__193; static PyObject *__pyx_tuple__195; static PyObject *__pyx_tuple__196; static PyObject *__pyx_tuple__197; static PyObject *__pyx_tuple__198; static PyObject *__pyx_tuple__200; static PyObject *__pyx_tuple__201; static PyObject *__pyx_tuple__203; static PyObject *__pyx_tuple__204; static PyObject *__pyx_tuple__206; static PyObject *__pyx_tuple__207; static PyObject *__pyx_tuple__209; static PyObject *__pyx_tuple__210; static PyObject *__pyx_tuple__212; static PyObject *__pyx_tuple__213; static PyObject *__pyx_tuple__215; static PyObject *__pyx_tuple__217; static PyObject *__pyx_tuple__219; static PyObject *__pyx_tuple__221; static PyObject *__pyx_tuple__223; static PyObject *__pyx_tuple__225; static PyObject *__pyx_tuple__227; static PyObject *__pyx_tuple__228; static PyObject *__pyx_tuple__230; static PyObject *__pyx_tuple__231; static PyObject *__pyx_tuple__233; static PyObject *__pyx_tuple__234; static PyObject *__pyx_tuple__235; static PyObject *__pyx_tuple__236; static PyObject *__pyx_tuple__238; static PyObject *__pyx_tuple__239; static PyObject *__pyx_tuple__241; static PyObject *__pyx_tuple__242; static PyObject *__pyx_tuple__244; static PyObject *__pyx_tuple__246; static PyObject *__pyx_tuple__247; static PyObject *__pyx_tuple__249; static PyObject *__pyx_tuple__250; static PyObject *__pyx_tuple__252; static PyObject *__pyx_tuple__253; static PyObject *__pyx_tuple__255; static PyObject *__pyx_tuple__256; static PyObject *__pyx_tuple__258; static PyObject *__pyx_tuple__259; static PyObject *__pyx_tuple__261; static PyObject *__pyx_tuple__262; static PyObject *__pyx_tuple__263; static PyObject *__pyx_tuple__264; static PyObject *__pyx_tuple__266; static PyObject *__pyx_tuple__267; static PyObject *__pyx_tuple__269; static PyObject *__pyx_tuple__271; static PyObject *__pyx_tuple__273; static PyObject *__pyx_tuple__275; static PyObject *__pyx_tuple__276; static PyObject *__pyx_tuple__277; static PyObject *__pyx_tuple__278; static PyObject *__pyx_tuple__279; static PyObject *__pyx_tuple__281; static PyObject *__pyx_tuple__282; static PyObject *__pyx_tuple__283; static PyObject *__pyx_tuple__284; static PyObject *__pyx_tuple__285; static PyObject *__pyx_tuple__286; static PyObject *__pyx_tuple__287; static PyObject *__pyx_tuple__288; static PyObject *__pyx_tuple__289; static PyObject *__pyx_tuple__290; static PyObject *__pyx_tuple__291; static PyObject *__pyx_tuple__292; static PyObject *__pyx_tuple__294; static PyObject *__pyx_tuple__295; static PyObject *__pyx_tuple__296; static PyObject *__pyx_tuple__297; static PyObject *__pyx_tuple__299; static PyObject *__pyx_tuple__300; static PyObject *__pyx_tuple__302; static PyObject *__pyx_tuple__303; static PyObject *__pyx_tuple__305; static PyObject *__pyx_tuple__306; static PyObject *__pyx_tuple__307; static PyObject *__pyx_tuple__308; static PyObject *__pyx_tuple__310; static PyObject *__pyx_tuple__311; static PyObject *__pyx_tuple__313; static PyObject *__pyx_tuple__314; static PyObject *__pyx_tuple__316; static PyObject *__pyx_tuple__317; static PyObject *__pyx_tuple__319; static PyObject *__pyx_tuple__320; static PyObject *__pyx_tuple__322; static PyObject *__pyx_tuple__323; static PyObject *__pyx_tuple__325; static PyObject *__pyx_tuple__326; static PyObject *__pyx_tuple__327; static PyObject *__pyx_tuple__328; static PyObject *__pyx_tuple__330; static PyObject *__pyx_tuple__331; static PyObject *__pyx_tuple__333; static PyObject *__pyx_tuple__335; static PyObject *__pyx_tuple__336; static PyObject *__pyx_tuple__338; static PyObject *__pyx_tuple__340; static PyObject *__pyx_tuple__341; static PyObject *__pyx_tuple__343; static PyObject *__pyx_tuple__344; static PyObject *__pyx_tuple__346; static PyObject *__pyx_tuple__347; static PyObject *__pyx_tuple__349; static PyObject *__pyx_tuple__350; static PyObject *__pyx_tuple__351; static PyObject *__pyx_tuple__352; static PyObject *__pyx_tuple__354; static PyObject *__pyx_tuple__356; static PyObject *__pyx_tuple__358; static PyObject *__pyx_tuple__360; static PyObject *__pyx_tuple__362; static PyObject *__pyx_tuple__363; static PyObject *__pyx_tuple__365; static PyObject *__pyx_tuple__366; static PyObject *__pyx_tuple__368; static PyObject *__pyx_tuple__370; static PyObject *__pyx_tuple__371; static PyObject *__pyx_tuple__373; static PyObject *__pyx_tuple__375; static PyObject *__pyx_tuple__376; static PyObject *__pyx_tuple__377; static PyObject *__pyx_tuple__378; static PyObject *__pyx_tuple__379; static PyObject *__pyx_tuple__380; static PyObject *__pyx_tuple__381; static PyObject *__pyx_tuple__382; static PyObject *__pyx_tuple__383; static PyObject *__pyx_tuple__384; static PyObject *__pyx_tuple__386; static PyObject *__pyx_tuple__388; static PyObject *__pyx_tuple__389; static PyObject *__pyx_tuple__391; static PyObject *__pyx_tuple__392; static PyObject *__pyx_tuple__394; static PyObject *__pyx_tuple__396; static PyObject *__pyx_tuple__397; static PyObject *__pyx_tuple__399; static PyObject *__pyx_tuple__401; static PyObject *__pyx_tuple__403; static PyObject *__pyx_tuple__405; static PyObject *__pyx_tuple__407; static PyObject *__pyx_tuple__409; static PyObject *__pyx_tuple__411; static PyObject *__pyx_tuple__412; static PyObject *__pyx_tuple__414; static PyObject *__pyx_tuple__415; static PyObject *__pyx_tuple__417; static PyObject *__pyx_tuple__419; static PyObject *__pyx_tuple__421; static PyObject *__pyx_tuple__422; static PyObject *__pyx_tuple__424; static PyObject *__pyx_tuple__426; static PyObject *__pyx_tuple__428; static PyObject *__pyx_tuple__430; static PyObject *__pyx_tuple__432; static PyObject *__pyx_tuple__434; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__49; static PyObject *__pyx_codeobj__52; static PyObject *__pyx_codeobj__54; static PyObject *__pyx_codeobj__55; static PyObject *__pyx_codeobj__56; static PyObject *__pyx_codeobj__58; static PyObject *__pyx_codeobj__59; static PyObject *__pyx_codeobj__63; static PyObject *__pyx_codeobj__64; static PyObject *__pyx_codeobj__65; static PyObject *__pyx_codeobj__66; static PyObject *__pyx_codeobj__67; static PyObject *__pyx_codeobj__68; static PyObject *__pyx_codeobj__70; static PyObject *__pyx_codeobj__72; static PyObject *__pyx_codeobj__73; static PyObject *__pyx_codeobj__74; static PyObject *__pyx_codeobj__75; static PyObject *__pyx_codeobj__76; static PyObject *__pyx_codeobj__79; static PyObject *__pyx_codeobj__80; static PyObject *__pyx_codeobj__81; static PyObject *__pyx_codeobj__82; static PyObject *__pyx_codeobj__85; static PyObject *__pyx_codeobj__87; static PyObject *__pyx_codeobj__88; static PyObject *__pyx_codeobj__89; static PyObject *__pyx_codeobj__91; static PyObject *__pyx_codeobj__92; static PyObject *__pyx_codeobj__94; static PyObject *__pyx_codeobj__96; static PyObject *__pyx_codeobj__98; static PyObject *__pyx_codeobj__100; static PyObject *__pyx_codeobj__102; static PyObject *__pyx_codeobj__104; static PyObject *__pyx_codeobj__106; static PyObject *__pyx_codeobj__108; static PyObject *__pyx_codeobj__110; static PyObject *__pyx_codeobj__112; static PyObject *__pyx_codeobj__121; static PyObject *__pyx_codeobj__123; static PyObject *__pyx_codeobj__125; static PyObject *__pyx_codeobj__127; static PyObject *__pyx_codeobj__129; static PyObject *__pyx_codeobj__132; static PyObject *__pyx_codeobj__134; static PyObject *__pyx_codeobj__136; static PyObject *__pyx_codeobj__138; static PyObject *__pyx_codeobj__140; static PyObject *__pyx_codeobj__142; static PyObject *__pyx_codeobj__144; static PyObject *__pyx_codeobj__146; static PyObject *__pyx_codeobj__148; static PyObject *__pyx_codeobj__150; static PyObject *__pyx_codeobj__152; static PyObject *__pyx_codeobj__154; static PyObject *__pyx_codeobj__156; static PyObject *__pyx_codeobj__159; static PyObject *__pyx_codeobj__161; static PyObject *__pyx_codeobj__164; static PyObject *__pyx_codeobj__172; static PyObject *__pyx_codeobj__177; static PyObject *__pyx_codeobj__180; static PyObject *__pyx_codeobj__183; static PyObject *__pyx_codeobj__185; static PyObject *__pyx_codeobj__188; static PyObject *__pyx_codeobj__191; static PyObject *__pyx_codeobj__194; static PyObject *__pyx_codeobj__199; static PyObject *__pyx_codeobj__202; static PyObject *__pyx_codeobj__205; static PyObject *__pyx_codeobj__208; static PyObject *__pyx_codeobj__211; static PyObject *__pyx_codeobj__214; static PyObject *__pyx_codeobj__216; static PyObject *__pyx_codeobj__218; static PyObject *__pyx_codeobj__220; static PyObject *__pyx_codeobj__222; static PyObject *__pyx_codeobj__224; static PyObject *__pyx_codeobj__226; static PyObject *__pyx_codeobj__229; static PyObject *__pyx_codeobj__232; static PyObject *__pyx_codeobj__237; static PyObject *__pyx_codeobj__240; static PyObject *__pyx_codeobj__243; static PyObject *__pyx_codeobj__245; static PyObject *__pyx_codeobj__248; static PyObject *__pyx_codeobj__251; static PyObject *__pyx_codeobj__254; static PyObject *__pyx_codeobj__257; static PyObject *__pyx_codeobj__260; static PyObject *__pyx_codeobj__265; static PyObject *__pyx_codeobj__268; static PyObject *__pyx_codeobj__270; static PyObject *__pyx_codeobj__272; static PyObject *__pyx_codeobj__274; static PyObject *__pyx_codeobj__280; static PyObject *__pyx_codeobj__293; static PyObject *__pyx_codeobj__298; static PyObject *__pyx_codeobj__301; static PyObject *__pyx_codeobj__304; static PyObject *__pyx_codeobj__309; static PyObject *__pyx_codeobj__312; static PyObject *__pyx_codeobj__315; static PyObject *__pyx_codeobj__318; static PyObject *__pyx_codeobj__321; static PyObject *__pyx_codeobj__324; static PyObject *__pyx_codeobj__329; static PyObject *__pyx_codeobj__332; static PyObject *__pyx_codeobj__334; static PyObject *__pyx_codeobj__337; static PyObject *__pyx_codeobj__339; static PyObject *__pyx_codeobj__342; static PyObject *__pyx_codeobj__345; static PyObject *__pyx_codeobj__348; static PyObject *__pyx_codeobj__353; static PyObject *__pyx_codeobj__355; static PyObject *__pyx_codeobj__357; static PyObject *__pyx_codeobj__359; static PyObject *__pyx_codeobj__361; static PyObject *__pyx_codeobj__364; static PyObject *__pyx_codeobj__367; static PyObject *__pyx_codeobj__369; static PyObject *__pyx_codeobj__372; static PyObject *__pyx_codeobj__374; static PyObject *__pyx_codeobj__385; static PyObject *__pyx_codeobj__387; static PyObject *__pyx_codeobj__390; static PyObject *__pyx_codeobj__393; static PyObject *__pyx_codeobj__395; static PyObject *__pyx_codeobj__398; static PyObject *__pyx_codeobj__400; static PyObject *__pyx_codeobj__402; static PyObject *__pyx_codeobj__404; static PyObject *__pyx_codeobj__406; static PyObject *__pyx_codeobj__408; static PyObject *__pyx_codeobj__410; static PyObject *__pyx_codeobj__413; static PyObject *__pyx_codeobj__416; static PyObject *__pyx_codeobj__418; static PyObject *__pyx_codeobj__420; static PyObject *__pyx_codeobj__423; static PyObject *__pyx_codeobj__425; static PyObject *__pyx_codeobj__427; static PyObject *__pyx_codeobj__429; static PyObject *__pyx_codeobj__431; static PyObject *__pyx_codeobj__433; static PyObject *__pyx_codeobj__435; /* Late includes */ /* "distributed/scheduler.py":119 * bint = bool * * def cast(T, v, *a, **k): # <<<<<<<<<<<<<< * return v * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_1cast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_1cast = {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_1cast, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_1cast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_T = 0; PyObject *__pyx_v_v = 0; CYTHON_UNUSED PyObject *__pyx_v_a = 0; CYTHON_UNUSED PyObject *__pyx_v_k = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cast (wrapper)", 0); __pyx_v_k = PyDict_New(); if (unlikely(!__pyx_v_k)) return NULL; __Pyx_GOTREF(__pyx_v_k); if (PyTuple_GET_SIZE(__pyx_args) > 2) { __pyx_v_a = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_a)) { __Pyx_DECREF(__pyx_v_k); __pyx_v_k = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_a); } else { __pyx_v_a = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T,&__pyx_n_s_v,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("cast", 0, 2, 2, 1); __PYX_ERR(0, 119, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_k, values, used_pos_args, "cast") < 0)) __PYX_ERR(0, 119, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_T = values[0]; __pyx_v_v = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("cast", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_a); __pyx_v_a = 0; __Pyx_DECREF(__pyx_v_k); __pyx_v_k = 0; __Pyx_AddTraceback("distributed.scheduler.cast", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_cast(__pyx_self, __pyx_v_T, __pyx_v_v, __pyx_v_a, __pyx_v_k); /* function exit code */ __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_k); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_cast(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_T, PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_a, CYTHON_UNUSED PyObject *__pyx_v_k) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cast", 0); /* "distributed/scheduler.py":120 * * def cast(T, v, *a, **k): * return v # <<<<<<<<<<<<<< * * def ccall(func): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_v); __pyx_r = __pyx_v_v; goto __pyx_L0; /* "distributed/scheduler.py":119 * bint = bool * * def cast(T, v, *a, **k): # <<<<<<<<<<<<<< * return v * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":122 * return v * * def ccall(func): # <<<<<<<<<<<<<< * return func * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_3ccall(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_3ccall = {"ccall", (PyCFunction)__pyx_pw_11distributed_9scheduler_3ccall, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_3ccall(PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ccall (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_2ccall(__pyx_self, ((PyObject *)__pyx_v_func)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_2ccall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ccall", 0); /* "distributed/scheduler.py":123 * * def ccall(func): * return func # <<<<<<<<<<<<<< * * def cclass(cls): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_func); __pyx_r = __pyx_v_func; goto __pyx_L0; /* "distributed/scheduler.py":122 * return v * * def ccall(func): # <<<<<<<<<<<<<< * return func * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":125 * return func * * def cclass(cls): # <<<<<<<<<<<<<< * return cls * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_5cclass(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_5cclass = {"cclass", (PyCFunction)__pyx_pw_11distributed_9scheduler_5cclass, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_5cclass(PyObject *__pyx_self, PyObject *__pyx_v_cls) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cclass (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_4cclass(__pyx_self, ((PyObject *)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_4cclass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cclass", 0); /* "distributed/scheduler.py":126 * * def cclass(cls): * return cls # <<<<<<<<<<<<<< * * def cfunc(func): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cls); __pyx_r = __pyx_v_cls; goto __pyx_L0; /* "distributed/scheduler.py":125 * return func * * def cclass(cls): # <<<<<<<<<<<<<< * return cls * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":128 * return cls * * def cfunc(func): # <<<<<<<<<<<<<< * return func * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_7cfunc(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_7cfunc = {"cfunc", (PyCFunction)__pyx_pw_11distributed_9scheduler_7cfunc, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_7cfunc(PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cfunc (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_6cfunc(__pyx_self, ((PyObject *)__pyx_v_func)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_6cfunc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cfunc", 0); /* "distributed/scheduler.py":129 * * def cfunc(func): * return func # <<<<<<<<<<<<<< * * def declare(*a, **k): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_func); __pyx_r = __pyx_v_func; goto __pyx_L0; /* "distributed/scheduler.py":128 * return cls * * def cfunc(func): # <<<<<<<<<<<<<< * return func * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":131 * return func * * def declare(*a, **k): # <<<<<<<<<<<<<< * if len(a) == 2: * return a[1] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9declare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9declare = {"declare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9declare, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9declare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_a = 0; CYTHON_UNUSED PyObject *__pyx_v_k = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("declare (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "declare", 1))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_a = __pyx_args; __pyx_r = __pyx_pf_11distributed_9scheduler_8declare(__pyx_self, __pyx_v_a, __pyx_v_k); /* function exit code */ __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_k); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_8declare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, CYTHON_UNUSED PyObject *__pyx_v_k) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("declare", 0); /* "distributed/scheduler.py":132 * * def declare(*a, **k): * if len(a) == 2: # <<<<<<<<<<<<<< * return a[1] * else: */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_a); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 2) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":133 * def declare(*a, **k): * if len(a) == 2: * return a[1] # <<<<<<<<<<<<<< * else: * pass */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":132 * * def declare(*a, **k): * if len(a) == 2: # <<<<<<<<<<<<<< * return a[1] * else: */ } /* "distributed/scheduler.py":135 * return a[1] * else: * pass # <<<<<<<<<<<<<< * * def exceptval(*a, **k): */ /*else*/ { } /* "distributed/scheduler.py":131 * return func * * def declare(*a, **k): # <<<<<<<<<<<<<< * if len(a) == 2: * return a[1] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.declare", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":137 * pass * * def exceptval(*a, **k): # <<<<<<<<<<<<<< * def wrapper(func): * return func */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11exceptval(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_11exceptval = {"exceptval", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_11exceptval, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_11exceptval(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_a = 0; CYTHON_UNUSED PyObject *__pyx_v_k = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("exceptval (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "exceptval", 1))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_a = __pyx_args; __pyx_r = __pyx_pf_11distributed_9scheduler_10exceptval(__pyx_self, __pyx_v_a, __pyx_v_k); /* function exit code */ __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_k); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":138 * * def exceptval(*a, **k): * def wrapper(func): # <<<<<<<<<<<<<< * return func * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9exceptval_1wrapper(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9exceptval_1wrapper = {"wrapper", (PyCFunction)__pyx_pw_11distributed_9scheduler_9exceptval_1wrapper, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9exceptval_1wrapper(PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9exceptval_wrapper(__pyx_self, ((PyObject *)__pyx_v_func)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9exceptval_wrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wrapper", 0); /* "distributed/scheduler.py":139 * def exceptval(*a, **k): * def wrapper(func): * return func # <<<<<<<<<<<<<< * * return wrapper */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_func); __pyx_r = __pyx_v_func; goto __pyx_L0; /* "distributed/scheduler.py":138 * * def exceptval(*a, **k): * def wrapper(func): # <<<<<<<<<<<<<< * return func * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":137 * pass * * def exceptval(*a, **k): # <<<<<<<<<<<<<< * def wrapper(func): * return func */ static PyObject *__pyx_pf_11distributed_9scheduler_10exceptval(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_a, CYTHON_UNUSED PyObject *__pyx_v_k) { PyObject *__pyx_v_wrapper = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exceptval", 0); /* "distributed/scheduler.py":138 * * def exceptval(*a, **k): * def wrapper(func): # <<<<<<<<<<<<<< * return func * */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9exceptval_1wrapper, 0, __pyx_n_s_exceptval_locals_wrapper, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_wrapper = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":141 * return func * * return wrapper # <<<<<<<<<<<<<< * * def final(cls): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_wrapper); __pyx_r = __pyx_v_wrapper; goto __pyx_L0; /* "distributed/scheduler.py":137 * pass * * def exceptval(*a, **k): # <<<<<<<<<<<<<< * def wrapper(func): * return func */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.exceptval", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_wrapper); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":143 * return wrapper * * def final(cls): # <<<<<<<<<<<<<< * return cls * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_13final(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_13final = {"final", (PyCFunction)__pyx_pw_11distributed_9scheduler_13final, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_13final(PyObject *__pyx_self, PyObject *__pyx_v_cls) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("final (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_12final(__pyx_self, ((PyObject *)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_12final(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("final", 0); /* "distributed/scheduler.py":144 * * def final(cls): * return cls # <<<<<<<<<<<<<< * * def inline(func): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cls); __pyx_r = __pyx_v_cls; goto __pyx_L0; /* "distributed/scheduler.py":143 * return wrapper * * def final(cls): # <<<<<<<<<<<<<< * return cls * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":146 * return cls * * def inline(func): # <<<<<<<<<<<<<< * return func * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_15inline(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_15inline = {"inline", (PyCFunction)__pyx_pw_11distributed_9scheduler_15inline, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_15inline(PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inline (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14inline(__pyx_self, ((PyObject *)__pyx_v_func)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14inline(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inline", 0); /* "distributed/scheduler.py":147 * * def inline(func): * return func # <<<<<<<<<<<<<< * * def nogil(func): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_func); __pyx_r = __pyx_v_func; goto __pyx_L0; /* "distributed/scheduler.py":146 * return cls * * def inline(func): # <<<<<<<<<<<<<< * return func * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":149 * return func * * def nogil(func): # <<<<<<<<<<<<<< * return func * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_17nogil(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_17nogil = {"nogil", (PyCFunction)__pyx_pw_11distributed_9scheduler_17nogil, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_17nogil(PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("nogil (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_16nogil(__pyx_self, ((PyObject *)__pyx_v_func)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_16nogil(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("nogil", 0); /* "distributed/scheduler.py":150 * * def nogil(func): * return func # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_func); __pyx_r = __pyx_v_func; goto __pyx_L0; /* "distributed/scheduler.py":149 * return func * * def nogil(func): # <<<<<<<<<<<<<< * return func * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":222 * __slots__ = ("_client_key", "_hash", "_wants_what", "_last_seen", "_versions") * * def __init__(self, client: str, versions: dict = None): # <<<<<<<<<<<<<< * self._client_key = client * self._hash = hash(client) */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_11ClientState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11distributed_9scheduler_11ClientState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_client = 0; PyObject *__pyx_v_versions = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_client,&__pyx_n_s_versions,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject*)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_versions); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 222, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_client = ((PyObject*)values[0]); __pyx_v_versions = ((PyObject*)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 222, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.ClientState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), (&PyUnicode_Type), 1, "client", 1))) __PYX_ERR(0, 222, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_versions), (&PyDict_Type), 1, "versions", 1))) __PYX_ERR(0, 222, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState___init__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self), __pyx_v_client, __pyx_v_versions); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_11ClientState___init__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_versions) { int __pyx_r; __Pyx_RefNannyDeclarations Py_hash_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; double __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":223 * * def __init__(self, client: str, versions: dict = None): * self._client_key = client # <<<<<<<<<<<<<< * self._hash = hash(client) * self._wants_what = set() */ __Pyx_INCREF(__pyx_v_client); __Pyx_GIVEREF(__pyx_v_client); __Pyx_GOTREF(__pyx_v_self->_client_key); __Pyx_DECREF(__pyx_v_self->_client_key); __pyx_v_self->_client_key = __pyx_v_client; /* "distributed/scheduler.py":224 * def __init__(self, client: str, versions: dict = None): * self._client_key = client * self._hash = hash(client) # <<<<<<<<<<<<<< * self._wants_what = set() * self._last_seen = time() */ __pyx_t_1 = PyObject_Hash(__pyx_v_client); if (unlikely(__pyx_t_1 == ((Py_hash_t)-1))) __PYX_ERR(0, 224, __pyx_L1_error) __pyx_v_self->_hash = __pyx_t_1; /* "distributed/scheduler.py":225 * self._client_key = client * self._hash = hash(client) * self._wants_what = set() # <<<<<<<<<<<<<< * self._last_seen = time() * self._versions = versions or {} */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_wants_what); __Pyx_DECREF(__pyx_v_self->_wants_what); __pyx_v_self->_wants_what = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":226 * self._hash = hash(client) * self._wants_what = set() * self._last_seen = time() # <<<<<<<<<<<<<< * self._versions = versions or {} * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->_last_seen = __pyx_t_5; /* "distributed/scheduler.py":227 * self._wants_what = set() * self._last_seen = time() * self._versions = versions or {} # <<<<<<<<<<<<<< * * def __hash__(self): */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_versions); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 227, __pyx_L1_error) if (!__pyx_t_6) { } else { __Pyx_INCREF(__pyx_v_versions); __pyx_t_2 = __pyx_v_versions; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_versions); __Pyx_DECREF(__pyx_v_self->_versions); __pyx_v_self->_versions = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":222 * __slots__ = ("_client_key", "_hash", "_wants_what", "_last_seen", "_versions") * * def __init__(self, client: str, versions: dict = None): # <<<<<<<<<<<<<< * self._client_key = client * self._hash = hash(client) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.ClientState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":229 * self._versions = versions or {} * * def __hash__(self): # <<<<<<<<<<<<<< * return self._hash * */ /* Python wrapper */ static Py_hash_t __pyx_pw_11distributed_9scheduler_11ClientState_3__hash__(PyObject *__pyx_v_self); /*proto*/ static Py_hash_t __pyx_pw_11distributed_9scheduler_11ClientState_3__hash__(PyObject *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_2__hash__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_hash_t __pyx_pf_11distributed_9scheduler_11ClientState_2__hash__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__", 0); /* "distributed/scheduler.py":230 * * def __hash__(self): * return self._hash # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __pyx_r = __pyx_v_self->_hash; goto __pyx_L0; /* "distributed/scheduler.py":229 * self._versions = versions or {} * * def __hash__(self): # <<<<<<<<<<<<<< * return self._hash * */ /* function exit code */ __pyx_L0:; if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":232 * return self._hash * * def __eq__(self, other): # <<<<<<<<<<<<<< * typ_self: type = type(self) * typ_other: type = type(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_4__eq__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_4__eq__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self, PyObject *__pyx_v_other) { PyTypeObject *__pyx_v_typ_self = 0; PyTypeObject *__pyx_v_typ_other = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_other_cs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 0); /* "distributed/scheduler.py":233 * * def __eq__(self, other): * typ_self: type = type(self) # <<<<<<<<<<<<<< * typ_other: type = type(other) * if typ_self == typ_other: */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_v_typ_self = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); /* "distributed/scheduler.py":234 * def __eq__(self, other): * typ_self: type = type(self) * typ_other: type = type(other) # <<<<<<<<<<<<<< * if typ_self == typ_other: * other_cs: ClientState = other */ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other))); __pyx_v_typ_other = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_other))); /* "distributed/scheduler.py":235 * typ_self: type = type(self) * typ_other: type = type(other) * if typ_self == typ_other: # <<<<<<<<<<<<<< * other_cs: ClientState = other * return self._client_key == other_cs._client_key */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_typ_self), ((PyObject *)__pyx_v_typ_other), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":236 * typ_other: type = type(other) * if typ_self == typ_other: * other_cs: ClientState = other # <<<<<<<<<<<<<< * return self._client_key == other_cs._client_key * else: */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 236, __pyx_L1_error) __pyx_t_1 = __pyx_v_other; __Pyx_INCREF(__pyx_t_1); __pyx_v_other_cs = ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":237 * if typ_self == typ_other: * other_cs: ClientState = other * return self._client_key == other_cs._client_key # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_client_key, __pyx_v_other_cs->_client_key, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":235 * typ_self: type = type(self) * typ_other: type = type(other) * if typ_self == typ_other: # <<<<<<<<<<<<<< * other_cs: ClientState = other * return self._client_key == other_cs._client_key */ } /* "distributed/scheduler.py":239 * return self._client_key == other_cs._client_key * else: * return False # <<<<<<<<<<<<<< * * def __repr__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "distributed/scheduler.py":232 * return self._hash * * def __eq__(self, other): # <<<<<<<<<<<<<< * typ_self: type = type(self) * typ_other: type = type(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.ClientState.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_typ_self); __Pyx_XDECREF(__pyx_v_typ_other); __Pyx_XDECREF((PyObject *)__pyx_v_other_cs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":241 * return False * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % self._client_key * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_7__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_7__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_6__repr__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_6__repr__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "distributed/scheduler.py":242 * * def __repr__(self): * return "" % self._client_key # <<<<<<<<<<<<<< * * def __str__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Client_s, __pyx_v_self->_client_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":241 * return False * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % self._client_key * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.ClientState.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":244 * return "" % self._client_key * * def __str__(self): # <<<<<<<<<<<<<< * return self._client_key * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_9__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_9__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_8__str__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_8__str__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__", 0); /* "distributed/scheduler.py":245 * * def __str__(self): * return self._client_key # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_client_key); __pyx_r = __pyx_v_self->_client_key; goto __pyx_L0; /* "distributed/scheduler.py":244 * return "" % self._client_key * * def __str__(self): # <<<<<<<<<<<<<< * return self._client_key * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":248 * * @property * def client_key(self): # <<<<<<<<<<<<<< * return self._client_key * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_10client_key_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_10client_key_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_10client_key___get__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_10client_key___get__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":249 * @property * def client_key(self): * return self._client_key # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_client_key); __pyx_r = __pyx_v_self->_client_key; goto __pyx_L0; /* "distributed/scheduler.py":248 * * @property * def client_key(self): # <<<<<<<<<<<<<< * return self._client_key * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":252 * * @property * def wants_what(self): # <<<<<<<<<<<<<< * return self._wants_what * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_10wants_what_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_10wants_what_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_10wants_what___get__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_10wants_what___get__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":253 * @property * def wants_what(self): * return self._wants_what # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_wants_what); __pyx_r = __pyx_v_self->_wants_what; goto __pyx_L0; /* "distributed/scheduler.py":252 * * @property * def wants_what(self): # <<<<<<<<<<<<<< * return self._wants_what * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":256 * * @property * def last_seen(self): # <<<<<<<<<<<<<< * return self._last_seen * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_9last_seen_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_9last_seen_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_9last_seen___get__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_9last_seen___get__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":257 * @property * def last_seen(self): * return self._last_seen # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_last_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":256 * * @property * def last_seen(self): # <<<<<<<<<<<<<< * return self._last_seen * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.ClientState.last_seen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":260 * * @property * def versions(self): # <<<<<<<<<<<<<< * return self._versions * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_8versions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_8versions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_8versions___get__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_8versions___get__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":261 * @property * def versions(self): * return self._versions # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_versions); __pyx_r = __pyx_v_self->_versions; goto __pyx_L0; /* "distributed/scheduler.py":260 * * @property * def versions(self): # <<<<<<<<<<<<<< * return self._versions * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_10__reduce_cython__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_10__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._client_key, self._hash, self._last_seen, self._versions, self._wants_what) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyInt_FromHash_t(__pyx_v_self->_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_last_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->_client_key); __Pyx_GIVEREF(__pyx_v_self->_client_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->_client_key); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __Pyx_INCREF(__pyx_v_self->_versions); __Pyx_GIVEREF(__pyx_v_self->_versions); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->_versions); __Pyx_INCREF(__pyx_v_self->_wants_what); __Pyx_GIVEREF(__pyx_v_self->_wants_what); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->_wants_what); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_state = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._client_key, self._hash, self._last_seen, self._versions, self._wants_what) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v__dict = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":7 * state = (self._client_key, self._hash, self._last_seen, self._versions, self._wants_what) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_4 = (__pyx_v__dict != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._client_key is not None or self._versions is not None or self._wants_what is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._client_key, self._hash, self._last_seen, self._versions, self._wants_what) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._client_key is not None or self._versions is not None or self._wants_what is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, None), state */ /*else*/ { __pyx_t_4 = (__pyx_v_self->_client_key != ((PyObject*)Py_None)); __pyx_t_6 = (__pyx_t_4 != 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->_versions != ((PyObject*)Py_None)); __pyx_t_4 = (__pyx_t_6 != 0); if (!__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_self->_wants_what != ((PyObject*)Py_None)); __pyx_t_6 = (__pyx_t_4 != 0); __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_5; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._client_key is not None or self._versions is not None or self._wants_what is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, None), state * else: */ __pyx_t_5 = (__pyx_v_use_setstate != 0); if (__pyx_t_5) { /* "(tree fragment)":13 * use_setstate = self._client_key is not None or self._versions is not None or self._wants_what is not None * if use_setstate: * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_ClientState); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_59694385); __Pyx_GIVEREF(__pyx_int_59694385); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_59694385); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._client_key is not None or self._versions is not None or self._wants_what is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, None), state * else: * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_ClientState__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_ClientState); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_59694385); __Pyx_GIVEREF(__pyx_int_59694385); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_59694385); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.ClientState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_ClientState__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11ClientState_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11ClientState_12__setstate_cython__(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11ClientState_12__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_ClientState__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11distributed_9scheduler___pyx_unpickle_ClientState__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_ClientState, (type(self), 0x38edd31, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_ClientState__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.ClientState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":405 * ) * * def __init__( # <<<<<<<<<<<<<< * self, * address: str = None, */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_11WorkerState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11distributed_9scheduler_11WorkerState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_address = 0; Py_ssize_t __pyx_v_pid; PyObject *__pyx_v_name = 0; Py_ssize_t __pyx_v_nthreads; Py_ssize_t __pyx_v_memory_limit; PyObject *__pyx_v_local_directory = 0; PyObject *__pyx_v_services = 0; PyObject *__pyx_v_versions = 0; PyObject *__pyx_v_nanny = 0; PyObject *__pyx_v_extra = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,&__pyx_n_s_pid,&__pyx_n_s_name,&__pyx_n_s_nthreads,&__pyx_n_s_memory_limit,&__pyx_n_s_local_directory,&__pyx_n_s_services,&__pyx_n_s_versions,&__pyx_n_s_nanny,&__pyx_n_s_extra,0}; PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":407 * def __init__( * self, * address: str = None, # <<<<<<<<<<<<<< * pid: Py_ssize_t = 0, * name: object = None, */ values[0] = ((PyObject*)Py_None); /* "distributed/scheduler.py":409 * address: str = None, * pid: Py_ssize_t = 0, * name: object = None, # <<<<<<<<<<<<<< * nthreads: Py_ssize_t = 0, * memory_limit: Py_ssize_t = 0, */ values[2] = ((PyObject *)Py_None); /* "distributed/scheduler.py":412 * nthreads: Py_ssize_t = 0, * memory_limit: Py_ssize_t = 0, * local_directory: str = None, # <<<<<<<<<<<<<< * services: dict = None, * versions: dict = None, */ values[5] = ((PyObject*)Py_None); /* "distributed/scheduler.py":413 * memory_limit: Py_ssize_t = 0, * local_directory: str = None, * services: dict = None, # <<<<<<<<<<<<<< * versions: dict = None, * nanny: str = None, */ values[6] = ((PyObject*)Py_None); /* "distributed/scheduler.py":414 * local_directory: str = None, * services: dict = None, * versions: dict = None, # <<<<<<<<<<<<<< * nanny: str = None, * extra: dict = None, */ values[7] = ((PyObject*)Py_None); /* "distributed/scheduler.py":415 * services: dict = None, * versions: dict = None, * nanny: str = None, # <<<<<<<<<<<<<< * extra: dict = None, * ): */ values[8] = ((PyObject*)Py_None); /* "distributed/scheduler.py":416 * versions: dict = None, * nanny: str = None, * extra: dict = None, # <<<<<<<<<<<<<< * ): * self._address = address */ values[9] = ((PyObject*)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_address); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nthreads); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_limit); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local_directory); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_services); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_versions); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nanny); if (value) { values[8] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extra); if (value) { values[9] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 405, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_address = ((PyObject*)values[0]); if (values[1]) { __pyx_v_pid = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_pid == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) } else { __pyx_v_pid = ((Py_ssize_t)0); } __pyx_v_name = values[2]; if (values[3]) { __pyx_v_nthreads = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_nthreads == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error) } else { __pyx_v_nthreads = ((Py_ssize_t)0); } if (values[4]) { __pyx_v_memory_limit = __Pyx_PyIndex_AsSsize_t(values[4]); if (unlikely((__pyx_v_memory_limit == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L3_error) } else { __pyx_v_memory_limit = ((Py_ssize_t)0); } __pyx_v_local_directory = ((PyObject*)values[5]); __pyx_v_services = ((PyObject*)values[6]); __pyx_v_versions = ((PyObject*)values[7]); __pyx_v_nanny = ((PyObject*)values[8]); __pyx_v_extra = ((PyObject*)values[9]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 405, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.WorkerState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyUnicode_Type), 1, "address", 1))) __PYX_ERR(0, 407, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_local_directory), (&PyUnicode_Type), 1, "local_directory", 1))) __PYX_ERR(0, 412, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_services), (&PyDict_Type), 1, "services", 1))) __PYX_ERR(0, 413, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_versions), (&PyDict_Type), 1, "versions", 1))) __PYX_ERR(0, 414, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nanny), (&PyUnicode_Type), 1, "nanny", 1))) __PYX_ERR(0, 415, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra), (&PyDict_Type), 1, "extra", 1))) __PYX_ERR(0, 416, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState___init__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self), __pyx_v_address, __pyx_v_pid, __pyx_v_name, __pyx_v_nthreads, __pyx_v_memory_limit, __pyx_v_local_directory, __pyx_v_services, __pyx_v_versions, __pyx_v_nanny, __pyx_v_extra); /* "distributed/scheduler.py":405 * ) * * def __init__( # <<<<<<<<<<<<<< * self, * address: str = None, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_11WorkerState___init__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, PyObject *__pyx_v_address, Py_ssize_t __pyx_v_pid, PyObject *__pyx_v_name, Py_ssize_t __pyx_v_nthreads, Py_ssize_t __pyx_v_memory_limit, PyObject *__pyx_v_local_directory, PyObject *__pyx_v_services, PyObject *__pyx_v_versions, PyObject *__pyx_v_nanny, PyObject *__pyx_v_extra) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_hash_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; double __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":418 * extra: dict = None, * ): * self._address = address # <<<<<<<<<<<<<< * self._pid = pid * self._name = name */ __Pyx_INCREF(__pyx_v_address); __Pyx_GIVEREF(__pyx_v_address); __Pyx_GOTREF(__pyx_v_self->_address); __Pyx_DECREF(__pyx_v_self->_address); __pyx_v_self->_address = __pyx_v_address; /* "distributed/scheduler.py":419 * ): * self._address = address * self._pid = pid # <<<<<<<<<<<<<< * self._name = name * self._nthreads = nthreads */ __pyx_v_self->_pid = __pyx_v_pid; /* "distributed/scheduler.py":420 * self._address = address * self._pid = pid * self._name = name # <<<<<<<<<<<<<< * self._nthreads = nthreads * self._memory_limit = memory_limit */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = __pyx_v_name; /* "distributed/scheduler.py":421 * self._pid = pid * self._name = name * self._nthreads = nthreads # <<<<<<<<<<<<<< * self._memory_limit = memory_limit * self._local_directory = local_directory */ __pyx_v_self->_nthreads = __pyx_v_nthreads; /* "distributed/scheduler.py":422 * self._name = name * self._nthreads = nthreads * self._memory_limit = memory_limit # <<<<<<<<<<<<<< * self._local_directory = local_directory * self._services = services or {} */ __pyx_v_self->_memory_limit = __pyx_v_memory_limit; /* "distributed/scheduler.py":423 * self._nthreads = nthreads * self._memory_limit = memory_limit * self._local_directory = local_directory # <<<<<<<<<<<<<< * self._services = services or {} * self._versions = versions or {} */ __Pyx_INCREF(__pyx_v_local_directory); __Pyx_GIVEREF(__pyx_v_local_directory); __Pyx_GOTREF(__pyx_v_self->_local_directory); __Pyx_DECREF(__pyx_v_self->_local_directory); __pyx_v_self->_local_directory = __pyx_v_local_directory; /* "distributed/scheduler.py":424 * self._memory_limit = memory_limit * self._local_directory = local_directory * self._services = services or {} # <<<<<<<<<<<<<< * self._versions = versions or {} * self._nanny = nanny */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_services); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 424, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_services); __pyx_t_1 = __pyx_v_services; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_services); __Pyx_DECREF(__pyx_v_self->_services); __pyx_v_self->_services = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":425 * self._local_directory = local_directory * self._services = services or {} * self._versions = versions or {} # <<<<<<<<<<<<<< * self._nanny = nanny * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_versions); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 425, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_versions); __pyx_t_1 = __pyx_v_versions; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L5_bool_binop_done:; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_versions); __Pyx_DECREF(__pyx_v_self->_versions); __pyx_v_self->_versions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":426 * self._services = services or {} * self._versions = versions or {} * self._nanny = nanny # <<<<<<<<<<<<<< * * self._hash = hash(address) */ __Pyx_INCREF(__pyx_v_nanny); __Pyx_GIVEREF(__pyx_v_nanny); __Pyx_GOTREF(__pyx_v_self->_nanny); __Pyx_DECREF(__pyx_v_self->_nanny); __pyx_v_self->_nanny = __pyx_v_nanny; /* "distributed/scheduler.py":428 * self._nanny = nanny * * self._hash = hash(address) # <<<<<<<<<<<<<< * self._status = Status.running * self._nbytes = 0 */ __pyx_t_4 = PyObject_Hash(__pyx_v_address); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(0, 428, __pyx_L1_error) __pyx_v_self->_hash = __pyx_t_4; /* "distributed/scheduler.py":429 * * self._hash = hash(address) * self._status = Status.running # <<<<<<<<<<<<<< * self._nbytes = 0 * self._occupancy = 0 */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_running); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_status); __Pyx_DECREF(__pyx_v_self->_status); __pyx_v_self->_status = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":430 * self._hash = hash(address) * self._status = Status.running * self._nbytes = 0 # <<<<<<<<<<<<<< * self._occupancy = 0 * self._metrics = {} */ __pyx_v_self->_nbytes = 0; /* "distributed/scheduler.py":431 * self._status = Status.running * self._nbytes = 0 * self._occupancy = 0 # <<<<<<<<<<<<<< * self._metrics = {} * self._last_seen = 0 */ __pyx_v_self->_occupancy = 0.0; /* "distributed/scheduler.py":432 * self._nbytes = 0 * self._occupancy = 0 * self._metrics = {} # <<<<<<<<<<<<<< * self._last_seen = 0 * self._time_delay = 0 */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_metrics); __Pyx_DECREF(__pyx_v_self->_metrics); __pyx_v_self->_metrics = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":433 * self._occupancy = 0 * self._metrics = {} * self._last_seen = 0 # <<<<<<<<<<<<<< * self._time_delay = 0 * self._bandwidth = float( */ __pyx_v_self->_last_seen = 0.0; /* "distributed/scheduler.py":434 * self._metrics = {} * self._last_seen = 0 * self._time_delay = 0 # <<<<<<<<<<<<<< * self._bandwidth = float( * parse_bytes(dask.config.get("distributed.scheduler.bandwidth")) */ __pyx_v_self->_time_delay = 0.0; /* "distributed/scheduler.py":436 * self._time_delay = 0 * self._bandwidth = float( * parse_bytes(dask.config.get("distributed.scheduler.bandwidth")) # <<<<<<<<<<<<<< * ) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_dask); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_kp_u_distributed_scheduler_bandwidth) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_distributed_scheduler_bandwidth); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":435 * self._last_seen = 0 * self._time_delay = 0 * self._bandwidth = float( # <<<<<<<<<<<<<< * parse_bytes(dask.config.get("distributed.scheduler.bandwidth")) * ) */ __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_8 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->_bandwidth = __pyx_t_8; /* "distributed/scheduler.py":439 * ) * * self._actors = set() # <<<<<<<<<<<<<< * self._has_what = set() * self._processing = {} */ __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_actors); __Pyx_DECREF(__pyx_v_self->_actors); __pyx_v_self->_actors = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":440 * * self._actors = set() * self._has_what = set() # <<<<<<<<<<<<<< * self._processing = {} * self._executing = {} */ __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_has_what); __Pyx_DECREF(__pyx_v_self->_has_what); __pyx_v_self->_has_what = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":441 * self._actors = set() * self._has_what = set() * self._processing = {} # <<<<<<<<<<<<<< * self._executing = {} * self._resources = {} */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_processing); __Pyx_DECREF(__pyx_v_self->_processing); __pyx_v_self->_processing = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":442 * self._has_what = set() * self._processing = {} * self._executing = {} # <<<<<<<<<<<<<< * self._resources = {} * self._used_resources = {} */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_executing); __Pyx_DECREF(__pyx_v_self->_executing); __pyx_v_self->_executing = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":443 * self._processing = {} * self._executing = {} * self._resources = {} # <<<<<<<<<<<<<< * self._used_resources = {} * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_resources); __Pyx_DECREF(__pyx_v_self->_resources); __pyx_v_self->_resources = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":444 * self._executing = {} * self._resources = {} * self._used_resources = {} # <<<<<<<<<<<<<< * * self._extra = extra or {} */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_used_resources); __Pyx_DECREF(__pyx_v_self->_used_resources); __pyx_v_self->_used_resources = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":446 * self._used_resources = {} * * self._extra = extra or {} # <<<<<<<<<<<<<< * * def __hash__(self): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extra); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 446, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_extra); __pyx_t_3 = __pyx_v_extra; goto __pyx_L7_bool_binop_done; } __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_L7_bool_binop_done:; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_extra); __Pyx_DECREF(__pyx_v_self->_extra); __pyx_v_self->_extra = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":405 * ) * * def __init__( # <<<<<<<<<<<<<< * self, * address: str = None, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.WorkerState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":448 * self._extra = extra or {} * * def __hash__(self): # <<<<<<<<<<<<<< * return self._hash * */ /* Python wrapper */ static Py_hash_t __pyx_pw_11distributed_9scheduler_11WorkerState_3__hash__(PyObject *__pyx_v_self); /*proto*/ static Py_hash_t __pyx_pw_11distributed_9scheduler_11WorkerState_3__hash__(PyObject *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_2__hash__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_hash_t __pyx_pf_11distributed_9scheduler_11WorkerState_2__hash__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__", 0); /* "distributed/scheduler.py":449 * * def __hash__(self): * return self._hash # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __pyx_r = __pyx_v_self->_hash; goto __pyx_L0; /* "distributed/scheduler.py":448 * self._extra = extra or {} * * def __hash__(self): # <<<<<<<<<<<<<< * return self._hash * */ /* function exit code */ __pyx_L0:; if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":451 * return self._hash * * def __eq__(self, other): # <<<<<<<<<<<<<< * typ_self: type = type(self) * typ_other: type = type(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_4__eq__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_4__eq__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, PyObject *__pyx_v_other) { PyTypeObject *__pyx_v_typ_self = 0; PyTypeObject *__pyx_v_typ_other = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_other_ws = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 0); /* "distributed/scheduler.py":452 * * def __eq__(self, other): * typ_self: type = type(self) # <<<<<<<<<<<<<< * typ_other: type = type(other) * if typ_self == typ_other: */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_v_typ_self = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); /* "distributed/scheduler.py":453 * def __eq__(self, other): * typ_self: type = type(self) * typ_other: type = type(other) # <<<<<<<<<<<<<< * if typ_self == typ_other: * other_ws: WorkerState = other */ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other))); __pyx_v_typ_other = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_other))); /* "distributed/scheduler.py":454 * typ_self: type = type(self) * typ_other: type = type(other) * if typ_self == typ_other: # <<<<<<<<<<<<<< * other_ws: WorkerState = other * return self._address == other_ws._address */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_typ_self), ((PyObject *)__pyx_v_typ_other), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":455 * typ_other: type = type(other) * if typ_self == typ_other: * other_ws: WorkerState = other # <<<<<<<<<<<<<< * return self._address == other_ws._address * else: */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 455, __pyx_L1_error) __pyx_t_1 = __pyx_v_other; __Pyx_INCREF(__pyx_t_1); __pyx_v_other_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":456 * if typ_self == typ_other: * other_ws: WorkerState = other * return self._address == other_ws._address # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_address, __pyx_v_other_ws->_address, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":454 * typ_self: type = type(self) * typ_other: type = type(other) * if typ_self == typ_other: # <<<<<<<<<<<<<< * other_ws: WorkerState = other * return self._address == other_ws._address */ } /* "distributed/scheduler.py":458 * return self._address == other_ws._address * else: * return False # <<<<<<<<<<<<<< * * @property */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "distributed/scheduler.py":451 * return self._hash * * def __eq__(self, other): # <<<<<<<<<<<<<< * typ_self: type = type(self) * typ_other: type = type(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_typ_self); __Pyx_XDECREF(__pyx_v_typ_other); __Pyx_XDECREF((PyObject *)__pyx_v_other_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":461 * * @property * def actors(self): # <<<<<<<<<<<<<< * return self._actors * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_6actors_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_6actors_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_6actors___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6actors___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":462 * @property * def actors(self): * return self._actors # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_actors); __pyx_r = __pyx_v_self->_actors; goto __pyx_L0; /* "distributed/scheduler.py":461 * * @property * def actors(self): # <<<<<<<<<<<<<< * return self._actors * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":465 * * @property * def address(self): # <<<<<<<<<<<<<< * return self._address * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_7address_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_7address_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_7address___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_7address___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":466 * @property * def address(self): * return self._address # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_address); __pyx_r = __pyx_v_self->_address; goto __pyx_L0; /* "distributed/scheduler.py":465 * * @property * def address(self): # <<<<<<<<<<<<<< * return self._address * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":469 * * @property * def bandwidth(self): # <<<<<<<<<<<<<< * return self._bandwidth * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9bandwidth_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9bandwidth_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_9bandwidth___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9bandwidth___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":470 * @property * def bandwidth(self): * return self._bandwidth # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_bandwidth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":469 * * @property * def bandwidth(self): # <<<<<<<<<<<<<< * return self._bandwidth * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.bandwidth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":473 * * @property * def executing(self): # <<<<<<<<<<<<<< * return self._executing * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9executing_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9executing_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_9executing___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9executing___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":474 * @property * def executing(self): * return self._executing # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_executing); __pyx_r = __pyx_v_self->_executing; goto __pyx_L0; /* "distributed/scheduler.py":473 * * @property * def executing(self): # <<<<<<<<<<<<<< * return self._executing * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":477 * * @property * def extra(self): # <<<<<<<<<<<<<< * return self._extra * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_5extra_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_5extra_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_5extra___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_5extra___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":478 * @property * def extra(self): * return self._extra # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_extra); __pyx_r = __pyx_v_self->_extra; goto __pyx_L0; /* "distributed/scheduler.py":477 * * @property * def extra(self): # <<<<<<<<<<<<<< * return self._extra * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":481 * * @property * def has_what(self): # <<<<<<<<<<<<<< * return self._has_what * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_8has_what_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_8has_what_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_8has_what___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8has_what___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":482 * @property * def has_what(self): * return self._has_what # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_has_what); __pyx_r = __pyx_v_self->_has_what; goto __pyx_L0; /* "distributed/scheduler.py":481 * * @property * def has_what(self): # <<<<<<<<<<<<<< * return self._has_what * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":485 * * @property * def host(self): # <<<<<<<<<<<<<< * return get_address_host(self.address) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_4host_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_4host_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_4host___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_4host___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":486 * @property * def host(self): * return get_address_host(self.address) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_address_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":485 * * @property * def host(self): # <<<<<<<<<<<<<< * return get_address_host(self.address) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.WorkerState.host.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":489 * * @property * def last_seen(self): # <<<<<<<<<<<<<< * return self._last_seen * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9last_seen_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9last_seen_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_9last_seen___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9last_seen___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":490 * @property * def last_seen(self): * return self._last_seen # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_last_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":489 * * @property * def last_seen(self): # <<<<<<<<<<<<<< * return self._last_seen * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.last_seen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":493 * * @property * def local_directory(self): # <<<<<<<<<<<<<< * return self._local_directory * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_15local_directory_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_15local_directory_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_15local_directory___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_15local_directory___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":494 * @property * def local_directory(self): * return self._local_directory # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_local_directory); __pyx_r = __pyx_v_self->_local_directory; goto __pyx_L0; /* "distributed/scheduler.py":493 * * @property * def local_directory(self): # <<<<<<<<<<<<<< * return self._local_directory * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":497 * * @property * def memory_limit(self): # <<<<<<<<<<<<<< * return self._memory_limit * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_12memory_limit_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_12memory_limit_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_12memory_limit___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_12memory_limit___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":498 * @property * def memory_limit(self): * return self._memory_limit # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_memory_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":497 * * @property * def memory_limit(self): # <<<<<<<<<<<<<< * return self._memory_limit * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.memory_limit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":501 * * @property * def metrics(self): # <<<<<<<<<<<<<< * return self._metrics * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_7metrics_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_7metrics_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_7metrics___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_7metrics___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":502 * @property * def metrics(self): * return self._metrics # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_metrics); __pyx_r = __pyx_v_self->_metrics; goto __pyx_L0; /* "distributed/scheduler.py":501 * * @property * def metrics(self): # <<<<<<<<<<<<<< * return self._metrics * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":505 * * @property * def name(self): # <<<<<<<<<<<<<< * return self._name * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_4name___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_4name___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":506 * @property * def name(self): * return self._name # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_name); __pyx_r = __pyx_v_self->_name; goto __pyx_L0; /* "distributed/scheduler.py":505 * * @property * def name(self): # <<<<<<<<<<<<<< * return self._name * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":509 * * @property * def nanny(self): # <<<<<<<<<<<<<< * return self._nanny * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_5nanny_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_5nanny_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_5nanny___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_5nanny___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":510 * @property * def nanny(self): * return self._nanny # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_nanny); __pyx_r = __pyx_v_self->_nanny; goto __pyx_L0; /* "distributed/scheduler.py":509 * * @property * def nanny(self): # <<<<<<<<<<<<<< * return self._nanny * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":513 * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self._nbytes * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_6nbytes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_6nbytes___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6nbytes___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":514 * @property * def nbytes(self): * return self._nbytes # <<<<<<<<<<<<<< * * @nbytes.setter */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":513 * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self._nbytes * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":517 * * @nbytes.setter * def nbytes(self, v: Py_ssize_t): # <<<<<<<<<<<<<< * self._nbytes = v * */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_11WorkerState_6nbytes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ static int __pyx_pw_11distributed_9scheduler_11WorkerState_6nbytes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { Py_ssize_t __pyx_v_v; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_v); { __pyx_v_v = __Pyx_PyIndex_AsSsize_t(__pyx_arg_v); if (unlikely((__pyx_v_v == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.WorkerState.nbytes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_6nbytes_2__set__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self), ((Py_ssize_t)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_11WorkerState_6nbytes_2__set__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, Py_ssize_t __pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); /* "distributed/scheduler.py":518 * @nbytes.setter * def nbytes(self, v: Py_ssize_t): * self._nbytes = v # <<<<<<<<<<<<<< * * @property */ __pyx_v_self->_nbytes = __pyx_v_v; /* "distributed/scheduler.py":517 * * @nbytes.setter * def nbytes(self, v: Py_ssize_t): # <<<<<<<<<<<<<< * self._nbytes = v * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":521 * * @property * def nthreads(self): # <<<<<<<<<<<<<< * return self._nthreads * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_8nthreads_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_8nthreads_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_8nthreads___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8nthreads___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":522 * @property * def nthreads(self): * return self._nthreads # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_nthreads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":521 * * @property * def nthreads(self): # <<<<<<<<<<<<<< * return self._nthreads * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.nthreads.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":525 * * @property * def occupancy(self): # <<<<<<<<<<<<<< * return self._occupancy * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9occupancy_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9occupancy_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_9occupancy___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9occupancy___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":526 * @property * def occupancy(self): * return self._occupancy # <<<<<<<<<<<<<< * * @occupancy.setter */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_occupancy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":525 * * @property * def occupancy(self): # <<<<<<<<<<<<<< * return self._occupancy * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.occupancy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":529 * * @occupancy.setter * def occupancy(self, v: double): # <<<<<<<<<<<<<< * self._occupancy = v * */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_11WorkerState_9occupancy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ static int __pyx_pw_11distributed_9scheduler_11WorkerState_9occupancy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { double __pyx_v_v; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_v); { __pyx_v_v = __pyx_PyFloat_AsDouble(__pyx_arg_v); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 529, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.WorkerState.occupancy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_9occupancy_2__set__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self), ((double)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_11WorkerState_9occupancy_2__set__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, double __pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); /* "distributed/scheduler.py":530 * @occupancy.setter * def occupancy(self, v: double): * self._occupancy = v # <<<<<<<<<<<<<< * * @property */ __pyx_v_self->_occupancy = __pyx_v_v; /* "distributed/scheduler.py":529 * * @occupancy.setter * def occupancy(self, v: double): # <<<<<<<<<<<<<< * self._occupancy = v * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":533 * * @property * def pid(self): # <<<<<<<<<<<<<< * return self._pid * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_3pid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_3pid___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_3pid___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":534 * @property * def pid(self): * return self._pid # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":533 * * @property * def pid(self): # <<<<<<<<<<<<<< * return self._pid * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":537 * * @property * def processing(self): # <<<<<<<<<<<<<< * return self._processing * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_10processing_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_10processing_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_10processing___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_10processing___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":538 * @property * def processing(self): * return self._processing # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_processing); __pyx_r = __pyx_v_self->_processing; goto __pyx_L0; /* "distributed/scheduler.py":537 * * @property * def processing(self): # <<<<<<<<<<<<<< * return self._processing * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":541 * * @property * def resources(self): # <<<<<<<<<<<<<< * return self._resources * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9resources_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9resources_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_9resources___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_9resources___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":542 * @property * def resources(self): * return self._resources # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_resources); __pyx_r = __pyx_v_self->_resources; goto __pyx_L0; /* "distributed/scheduler.py":541 * * @property * def resources(self): # <<<<<<<<<<<<<< * return self._resources * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":545 * * @property * def services(self): # <<<<<<<<<<<<<< * return self._services * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_8services_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_8services_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_8services___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8services___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":546 * @property * def services(self): * return self._services # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_services); __pyx_r = __pyx_v_self->_services; goto __pyx_L0; /* "distributed/scheduler.py":545 * * @property * def services(self): # <<<<<<<<<<<<<< * return self._services * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":549 * * @property * def status(self): # <<<<<<<<<<<<<< * return self._status * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_6status_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_6status_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_6status___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6status___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":550 * @property * def status(self): * return self._status # <<<<<<<<<<<<<< * * @status.setter */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_status); __pyx_r = __pyx_v_self->_status; goto __pyx_L0; /* "distributed/scheduler.py":549 * * @property * def status(self): # <<<<<<<<<<<<<< * return self._status * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":553 * * @status.setter * def status(self, new_status): # <<<<<<<<<<<<<< * if isinstance(new_status, Status): * self._status = new_status */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_11WorkerState_6status_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_new_status); /*proto*/ static int __pyx_pw_11distributed_9scheduler_11WorkerState_6status_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_new_status) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_6status_2__set__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self), ((PyObject *)__pyx_v_new_status)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_11WorkerState_6status_2__set__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, PyObject *__pyx_v_new_status) { PyObject *__pyx_v_corresponding_enum_variants = NULL; PyObject *__pyx_7genexpr__pyx_v_s = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "distributed/scheduler.py":554 * @status.setter * def status(self, new_status): * if isinstance(new_status, Status): # <<<<<<<<<<<<<< * self._status = new_status * elif isinstance(new_status, str) or new_status is None: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_new_status, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":555 * def status(self, new_status): * if isinstance(new_status, Status): * self._status = new_status # <<<<<<<<<<<<<< * elif isinstance(new_status, str) or new_status is None: * corresponding_enum_variants = [s for s in Status if s.value == new_status] */ __Pyx_INCREF(__pyx_v_new_status); __Pyx_GIVEREF(__pyx_v_new_status); __Pyx_GOTREF(__pyx_v_self->_status); __Pyx_DECREF(__pyx_v_self->_status); __pyx_v_self->_status = __pyx_v_new_status; /* "distributed/scheduler.py":554 * @status.setter * def status(self, new_status): * if isinstance(new_status, Status): # <<<<<<<<<<<<<< * self._status = new_status * elif isinstance(new_status, str) or new_status is None: */ goto __pyx_L3; } /* "distributed/scheduler.py":556 * if isinstance(new_status, Status): * self._status = new_status * elif isinstance(new_status, str) or new_status is None: # <<<<<<<<<<<<<< * corresponding_enum_variants = [s for s in Status if s.value == new_status] * assert len(corresponding_enum_variants) == 1 */ __pyx_t_2 = PyUnicode_Check(__pyx_v_new_status); __pyx_t_4 = (__pyx_t_2 != 0); if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_new_status == Py_None); __pyx_t_2 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (likely(__pyx_t_3)) { /* "distributed/scheduler.py":557 * self._status = new_status * elif isinstance(new_status, str) or new_status is None: * corresponding_enum_variants = [s for s in Status if s.value == new_status] # <<<<<<<<<<<<<< * assert len(corresponding_enum_variants) == 1 * self._status = corresponding_enum_variants[0] */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 557, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 557, __pyx_L8_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 557, __pyx_L8_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 557, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_s, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_s, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_status, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 557, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 557, __pyx_L8_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_3) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_s))) __PYX_ERR(0, 557, __pyx_L8_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_s); __pyx_7genexpr__pyx_v_s = 0; goto __pyx_L12_exit_scope; __pyx_L8_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_s); __pyx_7genexpr__pyx_v_s = 0; goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ __pyx_v_corresponding_enum_variants = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":558 * elif isinstance(new_status, str) or new_status is None: * corresponding_enum_variants = [s for s in Status if s.value == new_status] * assert len(corresponding_enum_variants) == 1 # <<<<<<<<<<<<<< * self._status = corresponding_enum_variants[0] * else: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = PyList_GET_SIZE(__pyx_v_corresponding_enum_variants); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 558, __pyx_L1_error) if (unlikely(!((__pyx_t_7 == 1) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 558, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":559 * corresponding_enum_variants = [s for s in Status if s.value == new_status] * assert len(corresponding_enum_variants) == 1 * self._status = corresponding_enum_variants[0] # <<<<<<<<<<<<<< * else: * raise TypeError(f"expected Status or str, got {new_status}") */ __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_corresponding_enum_variants, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_status); __Pyx_DECREF(__pyx_v_self->_status); __pyx_v_self->_status = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":556 * if isinstance(new_status, Status): * self._status = new_status * elif isinstance(new_status, str) or new_status is None: # <<<<<<<<<<<<<< * corresponding_enum_variants = [s for s in Status if s.value == new_status] * assert len(corresponding_enum_variants) == 1 */ goto __pyx_L3; } /* "distributed/scheduler.py":561 * self._status = corresponding_enum_variants[0] * else: * raise TypeError(f"expected Status or str, got {new_status}") # <<<<<<<<<<<<<< * * @property */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_new_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_expected_Status_or_str_got, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 561, __pyx_L1_error) } __pyx_L3:; /* "distributed/scheduler.py":553 * * @status.setter * def status(self, new_status): # <<<<<<<<<<<<<< * if isinstance(new_status, Status): * self._status = new_status */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("distributed.scheduler.WorkerState.status.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_corresponding_enum_variants); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_s); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":564 * * @property * def time_delay(self): # <<<<<<<<<<<<<< * return self._time_delay * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_10time_delay_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_10time_delay_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_10time_delay___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_10time_delay___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":565 * @property * def time_delay(self): * return self._time_delay # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_time_delay); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":564 * * @property * def time_delay(self): # <<<<<<<<<<<<<< * return self._time_delay * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.time_delay.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":568 * * @property * def used_resources(self): # <<<<<<<<<<<<<< * return self._used_resources * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_14used_resources_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_14used_resources_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_14used_resources___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_14used_resources___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":569 * @property * def used_resources(self): * return self._used_resources # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_used_resources); __pyx_r = __pyx_v_self->_used_resources; goto __pyx_L0; /* "distributed/scheduler.py":568 * * @property * def used_resources(self): # <<<<<<<<<<<<<< * return self._used_resources * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":572 * * @property * def versions(self): # <<<<<<<<<<<<<< * return self._versions * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_8versions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_8versions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_8versions___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8versions___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":573 * @property * def versions(self): * return self._versions # <<<<<<<<<<<<<< * * @ccall */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_versions); __pyx_r = __pyx_v_self->_versions; goto __pyx_L0; /* "distributed/scheduler.py":572 * * @property * def versions(self): # <<<<<<<<<<<<<< * return self._versions * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":576 * * @ccall * def clean(self): # <<<<<<<<<<<<<< * """ Return a version of this object that is appropriate for serialization """ * ws: WorkerState = WorkerState( */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_7clean(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_11WorkerState_clean(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_8genexpr1__pyx_v_ts = NULL; PyObject *__pyx_8genexpr1__pyx_v_cost = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_8genexpr2__pyx_v_ts = NULL; PyObject *__pyx_8genexpr2__pyx_v_duration = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clean", 0); /* "distributed/scheduler.py":579 * """ Return a version of this object that is appropriate for serialization """ * ws: WorkerState = WorkerState( * address=self._address, # <<<<<<<<<<<<<< * pid=self._pid, * name=self._name, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_address, __pyx_v_self->_address) < 0) __PYX_ERR(0, 579, __pyx_L1_error) /* "distributed/scheduler.py":580 * ws: WorkerState = WorkerState( * address=self._address, * pid=self._pid, # <<<<<<<<<<<<<< * name=self._name, * nthreads=self._nthreads, */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pid, __pyx_t_2) < 0) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":581 * address=self._address, * pid=self._pid, * name=self._name, # <<<<<<<<<<<<<< * nthreads=self._nthreads, * memory_limit=self._memory_limit, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->_name) < 0) __PYX_ERR(0, 579, __pyx_L1_error) /* "distributed/scheduler.py":582 * pid=self._pid, * name=self._name, * nthreads=self._nthreads, # <<<<<<<<<<<<<< * memory_limit=self._memory_limit, * local_directory=self._local_directory, */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_nthreads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nthreads, __pyx_t_2) < 0) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":583 * name=self._name, * nthreads=self._nthreads, * memory_limit=self._memory_limit, # <<<<<<<<<<<<<< * local_directory=self._local_directory, * services=self._services, */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_memory_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory_limit, __pyx_t_2) < 0) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":584 * nthreads=self._nthreads, * memory_limit=self._memory_limit, * local_directory=self._local_directory, # <<<<<<<<<<<<<< * services=self._services, * nanny=self._nanny, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_local_directory, __pyx_v_self->_local_directory) < 0) __PYX_ERR(0, 579, __pyx_L1_error) /* "distributed/scheduler.py":585 * memory_limit=self._memory_limit, * local_directory=self._local_directory, * services=self._services, # <<<<<<<<<<<<<< * nanny=self._nanny, * extra=self._extra, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_services, __pyx_v_self->_services) < 0) __PYX_ERR(0, 579, __pyx_L1_error) /* "distributed/scheduler.py":586 * local_directory=self._local_directory, * services=self._services, * nanny=self._nanny, # <<<<<<<<<<<<<< * extra=self._extra, * ) */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nanny, __pyx_v_self->_nanny) < 0) __PYX_ERR(0, 579, __pyx_L1_error) /* "distributed/scheduler.py":587 * services=self._services, * nanny=self._nanny, * extra=self._extra, # <<<<<<<<<<<<<< * ) * ts: TaskState */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extra, __pyx_v_self->_extra) < 0) __PYX_ERR(0, 579, __pyx_L1_error) /* "distributed/scheduler.py":578 * def clean(self): * """ Return a version of this object that is appropriate for serialization """ * ws: WorkerState = WorkerState( # <<<<<<<<<<<<<< * address=self._address, * pid=self._pid, */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11distributed_9scheduler_WorkerState), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":590 * ) * ts: TaskState * ws._processing = {ts._key: cost for ts, cost in self._processing.items()} # <<<<<<<<<<<<<< * ws._executing = {ts._key: duration for ts, duration in self._executing.items()} * return ws */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = 0; if (unlikely(__pyx_v_self->_processing == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 590, __pyx_L5_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_self->_processing, 1, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, &__pyx_t_7, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 590, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 590, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_cost, __pyx_t_7); __pyx_t_7 = 0; if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr1__pyx_v_ts->_key, (PyObject*)__pyx_8genexpr1__pyx_v_cost))) __PYX_ERR(0, 590, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_cost); __pyx_8genexpr1__pyx_v_cost = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr1__pyx_v_ts); __pyx_8genexpr1__pyx_v_ts = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_cost); __pyx_8genexpr1__pyx_v_cost = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr1__pyx_v_ts); __pyx_8genexpr1__pyx_v_ts = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_ws->_processing); __Pyx_DECREF(__pyx_v_ws->_processing); __pyx_v_ws->_processing = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":591 * ts: TaskState * ws._processing = {ts._key: cost for ts, cost in self._processing.items()} * ws._executing = {ts._key: duration for ts, duration in self._executing.items()} # <<<<<<<<<<<<<< * return ws * */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 0; if (unlikely(__pyx_v_self->_executing == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 591, __pyx_L11_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_self->_executing, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 591, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_4, &__pyx_t_7, &__pyx_t_6, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 591, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 591, __pyx_L11_error) __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_duration, __pyx_t_6); __pyx_t_6 = 0; if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr2__pyx_v_ts->_key, (PyObject*)__pyx_8genexpr2__pyx_v_duration))) __PYX_ERR(0, 591, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_duration); __pyx_8genexpr2__pyx_v_duration = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr2__pyx_v_ts); __pyx_8genexpr2__pyx_v_ts = 0; goto __pyx_L14_exit_scope; __pyx_L11_error:; __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_duration); __pyx_8genexpr2__pyx_v_duration = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr2__pyx_v_ts); __pyx_8genexpr2__pyx_v_ts = 0; goto __pyx_L1_error; __pyx_L14_exit_scope:; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_ws->_executing); __Pyx_DECREF(__pyx_v_ws->_executing); __pyx_v_ws->_executing = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":592 * ws._processing = {ts._key: cost for ts, cost in self._processing.items()} * ws._executing = {ts._key: duration for ts, duration in self._executing.items()} * return ws # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __pyx_r = ((PyObject *)__pyx_v_ws); goto __pyx_L0; /* "distributed/scheduler.py":576 * * @ccall * def clean(self): # <<<<<<<<<<<<<< * """ Return a version of this object that is appropriate for serialization """ * ws: WorkerState = WorkerState( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.WorkerState.clean", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_8genexpr1__pyx_v_ts); __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_cost); __Pyx_XDECREF((PyObject *)__pyx_8genexpr2__pyx_v_ts); __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_duration); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_7clean(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11distributed_9scheduler_11WorkerState_6clean[] = " Return a version of this object that is appropriate for serialization "; static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_7clean(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clean (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_6clean(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6clean(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clean", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_11WorkerState_clean(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.clean", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":594 * return ws * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % ( * self._address, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_9__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_8__repr__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_8__repr__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_UCS4 __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "distributed/scheduler.py":595 * * def __repr__(self): * return "" % ( # <<<<<<<<<<<<<< * self._address, * self._name, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; __Pyx_INCREF(__pyx_kp_u_Worker); __pyx_t_2 += 8; __Pyx_GIVEREF(__pyx_kp_u_Worker); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Worker); /* "distributed/scheduler.py":596 * def __repr__(self): * return "" % ( * self._address, # <<<<<<<<<<<<<< * self._name, * len(self._has_what), */ __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->_address), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_name_2); __pyx_t_2 += 8; __Pyx_GIVEREF(__pyx_kp_u_name_2); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_name_2); /* "distributed/scheduler.py":597 * return "" % ( * self._address, * self._name, # <<<<<<<<<<<<<< * len(self._has_what), * len(self._processing), */ __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_self->_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_memory); __pyx_t_2 += 10; __Pyx_GIVEREF(__pyx_kp_u_memory); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_memory); /* "distributed/scheduler.py":598 * self._address, * self._name, * len(self._has_what), # <<<<<<<<<<<<<< * len(self._processing), * ) */ __pyx_t_4 = __pyx_v_self->_has_what; __Pyx_INCREF(__pyx_t_4); if (unlikely(__pyx_t_4 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 598, __pyx_L1_error) } __pyx_t_5 = PySet_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_processing); __pyx_t_2 += 14; __Pyx_GIVEREF(__pyx_kp_u_processing); PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_processing); /* "distributed/scheduler.py":599 * self._name, * len(self._has_what), * len(self._processing), # <<<<<<<<<<<<<< * ) * */ __pyx_t_4 = __pyx_v_self->_processing; __Pyx_INCREF(__pyx_t_4); if (unlikely(__pyx_t_4 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 599, __pyx_L1_error) } __pyx_t_5 = PyDict_Size(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__3); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__3); PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__3); /* "distributed/scheduler.py":595 * * def __repr__(self): * return "" % ( # <<<<<<<<<<<<<< * self._address, * self._name, */ __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "distributed/scheduler.py":594 * return ws * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % ( * self._address, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.WorkerState.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":604 * @ccall * @exceptval(check=False) * def identity(self) -> dict: # <<<<<<<<<<<<<< * return { * "type": "Worker", */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_11identity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_11WorkerState_identity(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("identity", 0); /* "distributed/scheduler.py":605 * @exceptval(check=False) * def identity(self) -> dict: * return { # <<<<<<<<<<<<<< * "type": "Worker", * "id": self._name, */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":606 * def identity(self) -> dict: * return { * "type": "Worker", # <<<<<<<<<<<<<< * "id": self._name, * "host": self.host, */ __pyx_t_2 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_type, __pyx_n_u_Worker_2) < 0) __PYX_ERR(0, 606, __pyx_L1_error) /* "distributed/scheduler.py":607 * return { * "type": "Worker", * "id": self._name, # <<<<<<<<<<<<<< * "host": self.host, * "resources": self._resources, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_id, __pyx_v_self->_name) < 0) __PYX_ERR(0, 606, __pyx_L1_error) /* "distributed/scheduler.py":608 * "type": "Worker", * "id": self._name, * "host": self.host, # <<<<<<<<<<<<<< * "resources": self._resources, * "local_directory": self._local_directory, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_host, __pyx_t_3) < 0) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":609 * "id": self._name, * "host": self.host, * "resources": self._resources, # <<<<<<<<<<<<<< * "local_directory": self._local_directory, * "name": self._name, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_resources, __pyx_v_self->_resources) < 0) __PYX_ERR(0, 606, __pyx_L1_error) /* "distributed/scheduler.py":610 * "host": self.host, * "resources": self._resources, * "local_directory": self._local_directory, # <<<<<<<<<<<<<< * "name": self._name, * "nthreads": self._nthreads, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_local_directory, __pyx_v_self->_local_directory) < 0) __PYX_ERR(0, 606, __pyx_L1_error) /* "distributed/scheduler.py":611 * "resources": self._resources, * "local_directory": self._local_directory, * "name": self._name, # <<<<<<<<<<<<<< * "nthreads": self._nthreads, * "memory_limit": self._memory_limit, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_name, __pyx_v_self->_name) < 0) __PYX_ERR(0, 606, __pyx_L1_error) /* "distributed/scheduler.py":612 * "local_directory": self._local_directory, * "name": self._name, * "nthreads": self._nthreads, # <<<<<<<<<<<<<< * "memory_limit": self._memory_limit, * "last_seen": self._last_seen, */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->_nthreads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_nthreads, __pyx_t_3) < 0) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":613 * "name": self._name, * "nthreads": self._nthreads, * "memory_limit": self._memory_limit, # <<<<<<<<<<<<<< * "last_seen": self._last_seen, * "services": self._services, */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->_memory_limit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_memory_limit, __pyx_t_3) < 0) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":614 * "nthreads": self._nthreads, * "memory_limit": self._memory_limit, * "last_seen": self._last_seen, # <<<<<<<<<<<<<< * "services": self._services, * "metrics": self._metrics, */ __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->_last_seen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_last_seen, __pyx_t_3) < 0) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":615 * "memory_limit": self._memory_limit, * "last_seen": self._last_seen, * "services": self._services, # <<<<<<<<<<<<<< * "metrics": self._metrics, * "nanny": self._nanny, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_services, __pyx_v_self->_services) < 0) __PYX_ERR(0, 606, __pyx_L1_error) /* "distributed/scheduler.py":616 * "last_seen": self._last_seen, * "services": self._services, * "metrics": self._metrics, # <<<<<<<<<<<<<< * "nanny": self._nanny, * **self._extra, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_metrics, __pyx_v_self->_metrics) < 0) __PYX_ERR(0, 606, __pyx_L1_error) /* "distributed/scheduler.py":617 * "services": self._services, * "metrics": self._metrics, * "nanny": self._nanny, # <<<<<<<<<<<<<< * **self._extra, * } */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_nanny, __pyx_v_self->_nanny) < 0) __PYX_ERR(0, 606, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":618 * "metrics": self._metrics, * "nanny": self._nanny, * **self._extra, # <<<<<<<<<<<<<< * } * */ if (unlikely(__pyx_v_self->_extra == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(0, 618, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_1, __pyx_v_self->_extra) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_v_self->_extra); __PYX_ERR(0, 618, __pyx_L1_error) } __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":604 * @ccall * @exceptval(check=False) * def identity(self) -> dict: # <<<<<<<<<<<<<< * return { * "type": "Worker", */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.WorkerState.identity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_11identity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_11identity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("identity (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_10identity(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_10identity(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("identity", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_11WorkerState_identity(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.identity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":622 * * @property * def ncores(self): # <<<<<<<<<<<<<< * warnings.warn("WorkerState.ncores has moved to WorkerState.nthreads") * return self._nthreads */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_6ncores_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_6ncores_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_6ncores___get__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_6ncores___get__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":623 * @property * def ncores(self): * warnings.warn("WorkerState.ncores has moved to WorkerState.nthreads") # <<<<<<<<<<<<<< * return self._nthreads * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_WorkerState_ncores_has_moved_to) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_WorkerState_ncores_has_moved_to); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":624 * def ncores(self): * warnings.warn("WorkerState.ncores has moved to WorkerState.nthreads") * return self._nthreads # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_nthreads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":622 * * @property * def ncores(self): # <<<<<<<<<<<<<< * warnings.warn("WorkerState.ncores has moved to WorkerState.nthreads") * return self._nthreads */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.WorkerState.ncores.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_12__reduce_cython__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_12__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._actors, self._address, self._bandwidth, self._executing, self._extra, self._has_what, self._hash, self._last_seen, self._local_directory, self._memory_limit, self._metrics, self._name, self._nanny, self._nbytes, self._nthreads, self._occupancy, self._pid, self._processing, self._resources, self._services, self._status, self._time_delay, self._used_resources, self._versions) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_bandwidth); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_FromHash_t(__pyx_v_self->_hash); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->_last_seen); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_self->_memory_limit); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->_nthreads); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->_occupancy); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_self->_pid); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->_time_delay); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(24); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_self->_actors); __Pyx_GIVEREF(__pyx_v_self->_actors); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_self->_actors); __Pyx_INCREF(__pyx_v_self->_address); __Pyx_GIVEREF(__pyx_v_self->_address); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_self->_address); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->_executing); __Pyx_GIVEREF(__pyx_v_self->_executing); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_v_self->_executing); __Pyx_INCREF(__pyx_v_self->_extra); __Pyx_GIVEREF(__pyx_v_self->_extra); PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_v_self->_extra); __Pyx_INCREF(__pyx_v_self->_has_what); __Pyx_GIVEREF(__pyx_v_self->_has_what); PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_v_self->_has_what); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_3); __Pyx_INCREF(__pyx_v_self->_local_directory); __Pyx_GIVEREF(__pyx_v_self->_local_directory); PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_v_self->_local_directory); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_t_4); __Pyx_INCREF(__pyx_v_self->_metrics); __Pyx_GIVEREF(__pyx_v_self->_metrics); PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_v_self->_metrics); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_v_self->_name); __Pyx_INCREF(__pyx_v_self->_nanny); __Pyx_GIVEREF(__pyx_v_self->_nanny); PyTuple_SET_ITEM(__pyx_t_10, 12, __pyx_v_self->_nanny); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 13, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 14, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 15, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 16, __pyx_t_8); __Pyx_INCREF(__pyx_v_self->_processing); __Pyx_GIVEREF(__pyx_v_self->_processing); PyTuple_SET_ITEM(__pyx_t_10, 17, __pyx_v_self->_processing); __Pyx_INCREF(__pyx_v_self->_resources); __Pyx_GIVEREF(__pyx_v_self->_resources); PyTuple_SET_ITEM(__pyx_t_10, 18, __pyx_v_self->_resources); __Pyx_INCREF(__pyx_v_self->_services); __Pyx_GIVEREF(__pyx_v_self->_services); PyTuple_SET_ITEM(__pyx_t_10, 19, __pyx_v_self->_services); __Pyx_INCREF(__pyx_v_self->_status); __Pyx_GIVEREF(__pyx_v_self->_status); PyTuple_SET_ITEM(__pyx_t_10, 20, __pyx_v_self->_status); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 21, __pyx_t_9); __Pyx_INCREF(__pyx_v_self->_used_resources); __Pyx_GIVEREF(__pyx_v_self->_used_resources); PyTuple_SET_ITEM(__pyx_t_10, 22, __pyx_v_self->_used_resources); __Pyx_INCREF(__pyx_v_self->_versions); __Pyx_GIVEREF(__pyx_v_self->_versions); PyTuple_SET_ITEM(__pyx_t_10, 23, __pyx_v_self->_versions); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_v_state = ((PyObject*)__pyx_t_10); __pyx_t_10 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._actors, self._address, self._bandwidth, self._executing, self._extra, self._has_what, self._hash, self._last_seen, self._local_directory, self._memory_limit, self._metrics, self._name, self._nanny, self._nbytes, self._nthreads, self._occupancy, self._pid, self._processing, self._resources, self._services, self._status, self._time_delay, self._used_resources, self._versions) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_v__dict = __pyx_t_10; __pyx_t_10 = 0; /* "(tree fragment)":7 * state = (self._actors, self._address, self._bandwidth, self._executing, self._extra, self._has_what, self._hash, self._last_seen, self._local_directory, self._memory_limit, self._metrics, self._name, self._nanny, self._nbytes, self._nthreads, self._occupancy, self._pid, self._processing, self._resources, self._services, self._status, self._time_delay, self._used_resources, self._versions) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_11 = (__pyx_v__dict != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict); __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_9)); __pyx_t_9 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._actors is not None or self._address is not None or self._executing is not None or self._extra is not None or self._has_what is not None or self._local_directory is not None or self._metrics is not None or self._name is not None or self._nanny is not None or self._processing is not None or self._resources is not None or self._services is not None or self._status is not None or self._used_resources is not None or self._versions is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._actors, self._address, self._bandwidth, self._executing, self._extra, self._has_what, self._hash, self._last_seen, self._local_directory, self._memory_limit, self._metrics, self._name, self._nanny, self._nbytes, self._nthreads, self._occupancy, self._pid, self._processing, self._resources, self._services, self._status, self._time_delay, self._used_resources, self._versions) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._actors is not None or self._address is not None or self._executing is not None or self._extra is not None or self._has_what is not None or self._local_directory is not None or self._metrics is not None or self._name is not None or self._nanny is not None or self._processing is not None or self._resources is not None or self._services is not None or self._status is not None or self._used_resources is not None or self._versions is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, None), state */ /*else*/ { __pyx_t_11 = (__pyx_v_self->_actors != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->_address != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_executing != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->_extra != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_has_what != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->_local_directory != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_metrics != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->_name != Py_None); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_nanny != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->_processing != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_resources != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->_services != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_status != Py_None); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->_used_resources != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_versions != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); __pyx_t_12 = __pyx_t_13; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_12; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._actors is not None or self._address is not None or self._executing is not None or self._extra is not None or self._has_what is not None or self._local_directory is not None or self._metrics is not None or self._name is not None or self._nanny is not None or self._processing is not None or self._resources is not None or self._services is not None or self._status is not None or self._used_resources is not None or self._versions is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, None), state * else: */ __pyx_t_12 = (__pyx_v_use_setstate != 0); if (__pyx_t_12) { /* "(tree fragment)":13 * use_setstate = self._actors is not None or self._address is not None or self._executing is not None or self._extra is not None or self._has_what is not None or self._local_directory is not None or self._metrics is not None or self._name is not None or self._nanny is not None or self._processing is not None or self._resources is not None or self._services is not None or self._status is not None or self._used_resources is not None or self._versions is not None * if use_setstate: * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pyx_unpickle_WorkerState); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_110416975); __Pyx_GIVEREF(__pyx_int_110416975); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_110416975); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._actors is not None or self._address is not None or self._executing is not None or self._extra is not None or self._has_what is not None or self._local_directory is not None or self._metrics is not None or self._name is not None or self._nanny is not None or self._processing is not None or self._resources is not None or self._services is not None or self._status is not None or self._used_resources is not None or self._versions is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, None), state * else: * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_WorkerState__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_WorkerState); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_110416975); __Pyx_GIVEREF(__pyx_int_110416975); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_110416975); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_10 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.WorkerState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_WorkerState__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_11WorkerState_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_11WorkerState_14__setstate_cython__(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_11WorkerState_14__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_WorkerState__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11distributed_9scheduler___pyx_unpickle_WorkerState__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_WorkerState, (type(self), 0x694d44f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_WorkerState__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.WorkerState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":665 * _groups: list * * def __init__(self, name: str): # <<<<<<<<<<<<<< * self._name = name * self._groups = [] */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_10TaskPrefix_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11distributed_9scheduler_10TaskPrefix_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 665, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = ((PyObject*)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 665, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 665, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix___init__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self), __pyx_v_name); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_10TaskPrefix___init__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_v_task_durations = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; double __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":666 * * def __init__(self, name: str): * self._name = name # <<<<<<<<<<<<<< * self._groups = [] * */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = __pyx_v_name; /* "distributed/scheduler.py":667 * def __init__(self, name: str): * self._name = name * self._groups = [] # <<<<<<<<<<<<<< * * # store timings for each prefix-action */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_groups); __Pyx_DECREF(__pyx_v_self->_groups); __pyx_v_self->_groups = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":670 * * # store timings for each prefix-action * self._all_durations = defaultdict(float) # <<<<<<<<<<<<<< * * task_durations = dask.config.get("distributed.scheduler.default-task-durations") */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)(&PyFloat_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)(&PyFloat_Type))); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_all_durations); __Pyx_DECREF(__pyx_v_self->_all_durations); __pyx_v_self->_all_durations = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":672 * self._all_durations = defaultdict(float) * * task_durations = dask.config.get("distributed.scheduler.default-task-durations") # <<<<<<<<<<<<<< * if self._name in task_durations: * self._duration_average = parse_timedelta(task_durations[self._name]) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_distributed_scheduler_default_ta) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_default_ta); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_task_durations = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":673 * * task_durations = dask.config.get("distributed.scheduler.default-task-durations") * if self._name in task_durations: # <<<<<<<<<<<<<< * self._duration_average = parse_timedelta(task_durations[self._name]) * else: */ __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_self->_name, __pyx_v_task_durations, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 673, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":674 * task_durations = dask.config.get("distributed.scheduler.default-task-durations") * if self._name in task_durations: * self._duration_average = parse_timedelta(task_durations[self._name]) # <<<<<<<<<<<<<< * else: * self._duration_average = -1 */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_task_durations, __pyx_v_self->_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_duration_average = __pyx_t_7; /* "distributed/scheduler.py":673 * * task_durations = dask.config.get("distributed.scheduler.default-task-durations") * if self._name in task_durations: # <<<<<<<<<<<<<< * self._duration_average = parse_timedelta(task_durations[self._name]) * else: */ goto __pyx_L3; } /* "distributed/scheduler.py":676 * self._duration_average = parse_timedelta(task_durations[self._name]) * else: * self._duration_average = -1 # <<<<<<<<<<<<<< * self._suspicious = 0 * */ /*else*/ { __pyx_v_self->_duration_average = -1.0; } __pyx_L3:; /* "distributed/scheduler.py":677 * else: * self._duration_average = -1 * self._suspicious = 0 # <<<<<<<<<<<<<< * * @property */ __pyx_v_self->_suspicious = 0; /* "distributed/scheduler.py":665 * _groups: list * * def __init__(self, name: str): # <<<<<<<<<<<<<< * self._name = name * self._groups = [] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_task_durations); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":680 * * @property * def name(self): # <<<<<<<<<<<<<< * return self._name * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_4name___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_4name___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":681 * @property * def name(self): * return self._name # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_name); __pyx_r = __pyx_v_self->_name; goto __pyx_L0; /* "distributed/scheduler.py":680 * * @property * def name(self): # <<<<<<<<<<<<<< * return self._name * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":684 * * @property * def all_durations(self): # <<<<<<<<<<<<<< * return self._all_durations * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_13all_durations_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_13all_durations_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_13all_durations___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_13all_durations___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":685 * @property * def all_durations(self): * return self._all_durations # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_all_durations); __pyx_r = __pyx_v_self->_all_durations; goto __pyx_L0; /* "distributed/scheduler.py":684 * * @property * def all_durations(self): # <<<<<<<<<<<<<< * return self._all_durations * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":688 * * @property * def duration_average(self): # <<<<<<<<<<<<<< * return self._duration_average * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_16duration_average_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_16duration_average_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_16duration_average___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_16duration_average___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":689 * @property * def duration_average(self): * return self._duration_average # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_duration_average); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":688 * * @property * def duration_average(self): # <<<<<<<<<<<<<< * return self._duration_average * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.duration_average.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":692 * * @property * def suspicious(self): # <<<<<<<<<<<<<< * return self._suspicious * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_10suspicious_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_10suspicious_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_10suspicious___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_10suspicious___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":693 * @property * def suspicious(self): * return self._suspicious # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_suspicious); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":692 * * @property * def suspicious(self): # <<<<<<<<<<<<<< * return self._suspicious * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.suspicious.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":696 * * @property * def groups(self): # <<<<<<<<<<<<<< * return self._groups * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_6groups_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_6groups_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_6groups___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_6groups___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":697 * @property * def groups(self): * return self._groups # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_groups); __pyx_r = __pyx_v_self->_groups; goto __pyx_L0; /* "distributed/scheduler.py":696 * * @property * def groups(self): # <<<<<<<<<<<<<< * return self._groups * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":700 * * @property * def states(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return merge_with(sum, [tg._states for tg in self._groups]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_6states_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_6states_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_6states___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_6states___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_8genexpr3__pyx_v_tg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":702 * def states(self): * tg: TaskGroup * return merge_with(sum, [tg._states for tg in self._groups]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_merge_with); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_v_self->_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 702, __pyx_L5_error) } __pyx_t_4 = __pyx_v_self->_groups; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 702, __pyx_L5_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); #endif if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(0, 702, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_tg, ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_6)); __pyx_t_6 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_tg->_states))) __PYX_ERR(0, 702, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr3__pyx_v_tg); __pyx_8genexpr3__pyx_v_tg = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr3__pyx_v_tg); __pyx_8genexpr3__pyx_v_tg = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_builtin_sum, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_builtin_sum, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_builtin_sum); __Pyx_GIVEREF(__pyx_builtin_sum); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_builtin_sum); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":700 * * @property * def states(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return merge_with(sum, [tg._states for tg in self._groups]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.states.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr3__pyx_v_tg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":705 * * @property * def active(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return [ */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_6active_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_6active___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_6active___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_8genexpr4__pyx_v_tg = NULL; PyObject *__pyx_8genexpr5__pyx_v_k = NULL; PyObject *__pyx_8genexpr5__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":707 * def active(self): * tg: TaskGroup * return [ # <<<<<<<<<<<<<< * tg * for tg in self._groups */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":709 * return [ * tg * for tg in self._groups # <<<<<<<<<<<<<< * if any([v != 0 for k, v in tg._states.items() if k != "forgotten"]) * ] */ if (unlikely(__pyx_v_self->_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 709, __pyx_L5_error) } __pyx_t_2 = __pyx_v_self->_groups; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 709, __pyx_L5_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(0, 709, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_tg, ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":710 * tg * for tg in self._groups * if any([v != 0 for k, v in tg._states.items() if k != "forgotten"]) # <<<<<<<<<<<<<< * ] * */ { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 0; if (unlikely(__pyx_8genexpr4__pyx_v_tg->_states == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 710, __pyx_L11_error) } __pyx_t_9 = __Pyx_dict_iterator(__pyx_8genexpr4__pyx_v_tg->_states, 1, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 710, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_7, &__pyx_t_6, &__pyx_t_9, &__pyx_t_10, NULL, __pyx_t_8); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 710, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_k, __pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_v, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_8genexpr5__pyx_v_k, __pyx_n_u_forgotten, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 710, __pyx_L11_error) if (__pyx_t_12) { __pyx_t_10 = __Pyx_PyInt_NeObjC(__pyx_8genexpr5__pyx_v_v, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 710, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 710, __pyx_L11_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k); __pyx_8genexpr5__pyx_v_k = 0; __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_v); __pyx_8genexpr5__pyx_v_v = 0; goto __pyx_L15_exit_scope; __pyx_L11_error:; __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k); __pyx_8genexpr5__pyx_v_k = 0; __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_v); __pyx_8genexpr5__pyx_v_v = 0; goto __pyx_L5_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 710, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_12) { /* "distributed/scheduler.py":708 * tg: TaskGroup * return [ * tg # <<<<<<<<<<<<<< * for tg in self._groups * if any([v != 0 for k, v in tg._states.items() if k != "forgotten"]) */ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr4__pyx_v_tg))) __PYX_ERR(0, 707, __pyx_L5_error) /* "distributed/scheduler.py":710 * tg * for tg in self._groups * if any([v != 0 for k, v in tg._states.items() if k != "forgotten"]) # <<<<<<<<<<<<<< * ] * */ } /* "distributed/scheduler.py":709 * return [ * tg * for tg in self._groups # <<<<<<<<<<<<<< * if any([v != 0 for k, v in tg._states.items() if k != "forgotten"]) * ] */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr4__pyx_v_tg); __pyx_8genexpr4__pyx_v_tg = 0; goto __pyx_L16_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr4__pyx_v_tg); __pyx_8genexpr4__pyx_v_tg = 0; goto __pyx_L1_error; __pyx_L16_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":705 * * @property * def active(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return [ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr4__pyx_v_tg); __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k); __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":714 * * @property * def active_states(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return merge_with(sum, [tg._states for tg in self.active]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_13active_states_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_13active_states_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_13active_states___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_13active_states___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_8genexpr6__pyx_v_tg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":716 * def active_states(self): * tg: TaskGroup * return merge_with(sum, [tg._states for tg in self.active]) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_merge_with); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 716, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 716, __pyx_L5_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 716, __pyx_L5_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 716, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_4); } if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(0, 716, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_tg, ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_4)); __pyx_t_4 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_tg->_states))) __PYX_ERR(0, 716, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr6__pyx_v_tg); __pyx_8genexpr6__pyx_v_tg = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr6__pyx_v_tg); __pyx_8genexpr6__pyx_v_tg = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_5 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_builtin_sum, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_builtin_sum, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_builtin_sum); __Pyx_GIVEREF(__pyx_builtin_sum); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_builtin_sum); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":714 * * @property * def active_states(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return merge_with(sum, [tg._states for tg in self.active]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.active_states.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr6__pyx_v_tg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":718 * return merge_with(sum, [tg._states for tg in self.active]) * * def __repr__(self): # <<<<<<<<<<<<<< * return ( * "<" */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_3__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_3__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_2__repr__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_10TaskPrefix_8__repr___2generator25(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":724 * + ": " * + ", ".join( * "%s: %d" % (k, v) for (k, v) in sorted(self.states.items()) if v # <<<<<<<<<<<<<< * ) * + ">" */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_8__repr___genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_1_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 724, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_10TaskPrefix_8__repr___2generator25, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_repr___locals_genexpr, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.__repr__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_10TaskPrefix_8__repr___2generator25(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; Py_ssize_t __pyx_t_10; Py_UCS4 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 724, __pyx_L1_error) __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 724, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 724, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 724, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 724, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 724, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_v); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 724, __pyx_L1_error) if (__pyx_t_9) { __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_11 = 127; __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_v_k), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11; __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u__4); __pyx_t_10 += 2; __Pyx_GIVEREF(__pyx_kp_u__4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__4); __pyx_t_3 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_cur_scope->__pyx_v_v), __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11; __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":718 * return merge_with(sum, [tg._states for tg in self.active]) * * def __repr__(self): # <<<<<<<<<<<<<< * return ( * "<" */ static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_2__repr__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct____repr__(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct____repr__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 718, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); /* "distributed/scheduler.py":719 * * def __repr__(self): * return ( # <<<<<<<<<<<<<< * "<" * + self._name */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":721 * return ( * "<" * + self._name # <<<<<<<<<<<<<< * + ": " * + ", ".join( */ __pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_kp_u__5, __pyx_cur_scope->__pyx_v_self->_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":722 * "<" * + self._name * + ": " # <<<<<<<<<<<<<< * + ", ".join( * "%s: %d" % (k, v) for (k, v) in sorted(self.states.items()) if v */ __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":724 * + ": " * + ", ".join( * "%s: %d" % (k, v) for (k, v) in sorted(self.states.items()) if v # <<<<<<<<<<<<<< * ) * + ">" */ __pyx_t_1 = __pyx_pf_11distributed_9scheduler_10TaskPrefix_8__repr___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":723 * + self._name * + ": " * + ", ".join( # <<<<<<<<<<<<<< * "%s: %d" % (k, v) for (k, v) in sorted(self.states.items()) if v * ) */ __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":726 * "%s: %d" % (k, v) for (k, v) in sorted(self.states.items()) if v * ) * + ">" # <<<<<<<<<<<<<< * ) * */ __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_3, __pyx_kp_u__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":718 * return merge_with(sum, [tg._states for tg in self.active]) * * def __repr__(self): # <<<<<<<<<<<<<< * return ( * "<" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":730 * * @property * def nbytes_in_memory(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return sum([tg._nbytes_in_memory for tg in self._groups]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_16nbytes_in_memory_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_16nbytes_in_memory_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_16nbytes_in_memory___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_16nbytes_in_memory___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_8genexpr8__pyx_v_tg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":732 * def nbytes_in_memory(self): * tg: TaskGroup * return sum([tg._nbytes_in_memory for tg in self._groups]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_self->_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 732, __pyx_L5_error) } __pyx_t_2 = __pyx_v_self->_groups; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 732, __pyx_L5_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(0, 732, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_tg, ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyInt_FromSsize_t(__pyx_8genexpr8__pyx_v_tg->_nbytes_in_memory); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 732, __pyx_L5_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr8__pyx_v_tg); __pyx_8genexpr8__pyx_v_tg = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr8__pyx_v_tg); __pyx_8genexpr8__pyx_v_tg = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "distributed/scheduler.py":730 * * @property * def nbytes_in_memory(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return sum([tg._nbytes_in_memory for tg in self._groups]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.nbytes_in_memory.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr8__pyx_v_tg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":735 * * @property * def nbytes_total(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return sum([tg._nbytes_total for tg in self._groups]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_12nbytes_total_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_12nbytes_total_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_12nbytes_total___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_12nbytes_total___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_8genexpr9__pyx_v_tg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":737 * def nbytes_total(self): * tg: TaskGroup * return sum([tg._nbytes_total for tg in self._groups]) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_self->_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 737, __pyx_L5_error) } __pyx_t_2 = __pyx_v_self->_groups; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 737, __pyx_L5_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(0, 737, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_tg, ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyInt_FromSsize_t(__pyx_8genexpr9__pyx_v_tg->_nbytes_total); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 737, __pyx_L5_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_8genexpr9__pyx_v_tg); __pyx_8genexpr9__pyx_v_tg = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr9__pyx_v_tg); __pyx_8genexpr9__pyx_v_tg = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "distributed/scheduler.py":735 * * @property * def nbytes_total(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return sum([tg._nbytes_total for tg in self._groups]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.nbytes_total.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_8genexpr9__pyx_v_tg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":739 * return sum([tg._nbytes_total for tg in self._groups]) * * def __len__(self): # <<<<<<<<<<<<<< * return sum(map(len, self._groups)) * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11distributed_9scheduler_10TaskPrefix_5__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11distributed_9scheduler_10TaskPrefix_5__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_4__len__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11distributed_9scheduler_10TaskPrefix_4__len__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); /* "distributed/scheduler.py":740 * * def __len__(self): * return sum(map(len, self._groups)) # <<<<<<<<<<<<<< * * @property */ __pyx_t_1 = __Pyx_GetBuiltinName(__pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->_groups); __Pyx_GIVEREF(__pyx_v_self->_groups); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_groups); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; goto __pyx_L0; /* "distributed/scheduler.py":739 * return sum([tg._nbytes_total for tg in self._groups]) * * def __len__(self): # <<<<<<<<<<<<<< * return sum(map(len, self._groups)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":743 * * @property * def duration(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return sum([tg._duration for tg in self._groups]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_8duration_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_8duration_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_8duration___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_8duration___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_9genexpr10__pyx_v_tg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":745 * def duration(self): * tg: TaskGroup * return sum([tg._duration for tg in self._groups]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_self->_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 745, __pyx_L5_error) } __pyx_t_2 = __pyx_v_self->_groups; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 745, __pyx_L5_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(0, 745, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_tg, ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble(__pyx_9genexpr10__pyx_v_tg->_duration); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 745, __pyx_L5_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr10__pyx_v_tg); __pyx_9genexpr10__pyx_v_tg = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr10__pyx_v_tg); __pyx_9genexpr10__pyx_v_tg = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "distributed/scheduler.py":743 * * @property * def duration(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return sum([tg._duration for tg in self._groups]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.duration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr10__pyx_v_tg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":748 * * @property * def types(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return set().union(*[tg._types for tg in self._groups]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_5types_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_5types_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_5types___get__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_5types___get__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_9genexpr11__pyx_v_tg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":750 * def types(self): * tg: TaskGroup * return set().union(*[tg._types for tg in self._groups]) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_self->_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 750, __pyx_L5_error) } __pyx_t_3 = __pyx_v_self->_groups; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 750, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(0, 750, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_tg, ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_5)); __pyx_t_5 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr11__pyx_v_tg->_types))) __PYX_ERR(0, 750, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr11__pyx_v_tg); __pyx_9genexpr11__pyx_v_tg = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr11__pyx_v_tg); __pyx_9genexpr11__pyx_v_tg = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_3 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":748 * * @property * def types(self): # <<<<<<<<<<<<<< * tg: TaskGroup * return set().union(*[tg._types for tg in self._groups]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.types.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr11__pyx_v_tg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_6__reduce_cython__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_6__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._all_durations, self._duration_average, self._groups, self._name, self._suspicious) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_duration_average); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_suspicious); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->_all_durations); __Pyx_GIVEREF(__pyx_v_self->_all_durations); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->_all_durations); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->_groups); __Pyx_GIVEREF(__pyx_v_self->_groups); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->_groups); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->_name); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_state = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._all_durations, self._duration_average, self._groups, self._name, self._suspicious) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v__dict = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":7 * state = (self._all_durations, self._duration_average, self._groups, self._name, self._suspicious) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_4 = (__pyx_v__dict != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._all_durations is not None or self._groups is not None or self._name is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._all_durations, self._duration_average, self._groups, self._name, self._suspicious) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._all_durations is not None or self._groups is not None or self._name is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, None), state */ /*else*/ { __pyx_t_4 = (__pyx_v_self->_all_durations != Py_None); __pyx_t_6 = (__pyx_t_4 != 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->_groups != ((PyObject*)Py_None)); __pyx_t_4 = (__pyx_t_6 != 0); if (!__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_self->_name != ((PyObject*)Py_None)); __pyx_t_6 = (__pyx_t_4 != 0); __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_5; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._all_durations is not None or self._groups is not None or self._name is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, None), state * else: */ __pyx_t_5 = (__pyx_v_use_setstate != 0); if (__pyx_t_5) { /* "(tree fragment)":13 * use_setstate = self._all_durations is not None or self._groups is not None or self._name is not None * if use_setstate: * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_TaskPrefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_163323807); __Pyx_GIVEREF(__pyx_int_163323807); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_163323807); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._all_durations is not None or self._groups is not None or self._name is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, None), state * else: * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TaskPrefix__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_TaskPrefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_163323807); __Pyx_GIVEREF(__pyx_int_163323807); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_163323807); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TaskPrefix__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_10TaskPrefix_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_10TaskPrefix_8__setstate_cython__(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_10TaskPrefix_8__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TaskPrefix__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11distributed_9scheduler___pyx_unpickle_TaskPrefix__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_TaskPrefix, (type(self), 0x9bc1f9f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TaskPrefix__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskPrefix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":805 * _types: set * * def __init__(self, name: str): # <<<<<<<<<<<<<< * self._name = name * self._prefix = None */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_9TaskGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11distributed_9scheduler_9TaskGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 805, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = ((PyObject*)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 805, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.TaskGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 805, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup___init__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self), __pyx_v_name); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_9TaskGroup___init__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_9genexpr12__pyx_v_state = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":806 * * def __init__(self, name: str): * self._name = name # <<<<<<<<<<<<<< * self._prefix = None * self._states = {state: 0 for state in ALL_TASK_STATES} */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = __pyx_v_name; /* "distributed/scheduler.py":807 * def __init__(self, name: str): * self._name = name * self._prefix = None # <<<<<<<<<<<<<< * self._states = {state: 0 for state in ALL_TASK_STATES} * self._states["forgotten"] = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_prefix); __Pyx_DECREF(((PyObject *)__pyx_v_self->_prefix)); __pyx_v_self->_prefix = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)Py_None); /* "distributed/scheduler.py":808 * self._name = name * self._prefix = None * self._states = {state: 0 for state in ALL_TASK_STATES} # <<<<<<<<<<<<<< * self._states["forgotten"] = 0 * self._dependencies = set() */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_11distributed_9scheduler_ALL_TASK_STATES, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 808, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 808, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_state, __pyx_t_6); __pyx_t_6 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr12__pyx_v_state, (PyObject*)__pyx_int_0))) __PYX_ERR(0, 808, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_state); __pyx_9genexpr12__pyx_v_state = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_state); __pyx_9genexpr12__pyx_v_state = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_states); __Pyx_DECREF(__pyx_v_self->_states); __pyx_v_self->_states = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":809 * self._prefix = None * self._states = {state: 0 for state in ALL_TASK_STATES} * self._states["forgotten"] = 0 # <<<<<<<<<<<<<< * self._dependencies = set() * self._nbytes_total = 0 */ if (unlikely(__pyx_v_self->_states == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 809, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_self->_states, __pyx_n_u_forgotten, __pyx_int_0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) /* "distributed/scheduler.py":810 * self._states = {state: 0 for state in ALL_TASK_STATES} * self._states["forgotten"] = 0 * self._dependencies = set() # <<<<<<<<<<<<<< * self._nbytes_total = 0 * self._nbytes_in_memory = 0 */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_dependencies); __Pyx_DECREF(__pyx_v_self->_dependencies); __pyx_v_self->_dependencies = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":811 * self._states["forgotten"] = 0 * self._dependencies = set() * self._nbytes_total = 0 # <<<<<<<<<<<<<< * self._nbytes_in_memory = 0 * self._duration = 0 */ __pyx_v_self->_nbytes_total = 0; /* "distributed/scheduler.py":812 * self._dependencies = set() * self._nbytes_total = 0 * self._nbytes_in_memory = 0 # <<<<<<<<<<<<<< * self._duration = 0 * self._types = set() */ __pyx_v_self->_nbytes_in_memory = 0; /* "distributed/scheduler.py":813 * self._nbytes_total = 0 * self._nbytes_in_memory = 0 * self._duration = 0 # <<<<<<<<<<<<<< * self._types = set() * */ __pyx_v_self->_duration = 0.0; /* "distributed/scheduler.py":814 * self._nbytes_in_memory = 0 * self._duration = 0 * self._types = set() # <<<<<<<<<<<<<< * * @property */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_types); __Pyx_DECREF(__pyx_v_self->_types); __pyx_v_self->_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":805 * _types: set * * def __init__(self, name: str): # <<<<<<<<<<<<<< * self._name = name * self._prefix = None */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_state); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":817 * * @property * def name(self): # <<<<<<<<<<<<<< * return self._name * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_4name___get__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_4name___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":818 * @property * def name(self): * return self._name # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_name); __pyx_r = __pyx_v_self->_name; goto __pyx_L0; /* "distributed/scheduler.py":817 * * @property * def name(self): # <<<<<<<<<<<<<< * return self._name * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":821 * * @property * def prefix(self): # <<<<<<<<<<<<<< * return self._prefix * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_6prefix_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_6prefix_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_6prefix___get__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_6prefix___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":822 * @property * def prefix(self): * return self._prefix # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_prefix)); __pyx_r = ((PyObject *)__pyx_v_self->_prefix); goto __pyx_L0; /* "distributed/scheduler.py":821 * * @property * def prefix(self): # <<<<<<<<<<<<<< * return self._prefix * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":825 * * @property * def states(self): # <<<<<<<<<<<<<< * return self._states * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_6states_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_6states_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_6states___get__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_6states___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":826 * @property * def states(self): * return self._states # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_states); __pyx_r = __pyx_v_self->_states; goto __pyx_L0; /* "distributed/scheduler.py":825 * * @property * def states(self): # <<<<<<<<<<<<<< * return self._states * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":829 * * @property * def dependencies(self): # <<<<<<<<<<<<<< * return self._dependencies * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_12dependencies_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_12dependencies_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_12dependencies___get__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_12dependencies___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":830 * @property * def dependencies(self): * return self._dependencies # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_dependencies); __pyx_r = __pyx_v_self->_dependencies; goto __pyx_L0; /* "distributed/scheduler.py":829 * * @property * def dependencies(self): # <<<<<<<<<<<<<< * return self._dependencies * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":833 * * @property * def nbytes_total(self): # <<<<<<<<<<<<<< * return self._nbytes_total * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_12nbytes_total_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_12nbytes_total_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_12nbytes_total___get__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_12nbytes_total___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":834 * @property * def nbytes_total(self): * return self._nbytes_total # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_nbytes_total); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":833 * * @property * def nbytes_total(self): # <<<<<<<<<<<<<< * return self._nbytes_total * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.nbytes_total.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":837 * * @property * def nbytes_in_memory(self): # <<<<<<<<<<<<<< * return self._nbytes_in_memory * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_16nbytes_in_memory_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_16nbytes_in_memory_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_16nbytes_in_memory___get__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_16nbytes_in_memory___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":838 * @property * def nbytes_in_memory(self): * return self._nbytes_in_memory # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_nbytes_in_memory); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":837 * * @property * def nbytes_in_memory(self): # <<<<<<<<<<<<<< * return self._nbytes_in_memory * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.nbytes_in_memory.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":841 * * @property * def duration(self): # <<<<<<<<<<<<<< * return self._duration * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_8duration_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_8duration_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_8duration___get__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_8duration___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":842 * @property * def duration(self): * return self._duration # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_duration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":841 * * @property * def duration(self): # <<<<<<<<<<<<<< * return self._duration * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.duration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":845 * * @property * def types(self): # <<<<<<<<<<<<<< * return self._types * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_5types_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_5types_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_5types___get__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_5types___get__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":846 * @property * def types(self): * return self._types # <<<<<<<<<<<<<< * * @ccall */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_types); __pyx_r = __pyx_v_self->_types; goto __pyx_L0; /* "distributed/scheduler.py":845 * * @property * def types(self): # <<<<<<<<<<<<<< * return self._types * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":849 * * @ccall * def add(self, o): # <<<<<<<<<<<<<< * ts: TaskState = o * self._states[ts._state] += 1 */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_3add(PyObject *__pyx_v_self, PyObject *__pyx_v_o); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_9TaskGroup_add(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self, PyObject *__pyx_v_o, CYTHON_UNUSED int __pyx_skip_dispatch) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 0); /* "distributed/scheduler.py":850 * @ccall * def add(self, o): * ts: TaskState = o # <<<<<<<<<<<<<< * self._states[ts._state] += 1 * ts._group = self */ if (!(likely(((__pyx_v_o) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_o, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 850, __pyx_L1_error) __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":851 * def add(self, o): * ts: TaskState = o * self._states[ts._state] += 1 # <<<<<<<<<<<<<< * ts._group = self * */ if (unlikely(__pyx_v_self->_states == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 851, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_self->_states); __pyx_t_2 = __pyx_v_self->_states; __Pyx_INCREF(__pyx_v_ts->_state); __pyx_t_3 = __pyx_v_ts->_state; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 851, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 851, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":852 * ts: TaskState = o * self._states[ts._state] += 1 * ts._group = self # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_ts->_group); __Pyx_DECREF(((PyObject *)__pyx_v_ts->_group)); __pyx_v_ts->_group = __pyx_v_self; /* "distributed/scheduler.py":849 * * @ccall * def add(self, o): # <<<<<<<<<<<<<< * ts: TaskState = o * self._states[ts._state] += 1 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_3add(PyObject *__pyx_v_self, PyObject *__pyx_v_o); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_3add(PyObject *__pyx_v_self, PyObject *__pyx_v_o) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_2add(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self), ((PyObject *)__pyx_v_o)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_2add(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self, PyObject *__pyx_v_o) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_9TaskGroup_add(__pyx_v_self, __pyx_v_o, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":854 * ts._group = self * * def __repr__(self): # <<<<<<<<<<<<<< * return ( * "<" */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_5__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_5__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_4__repr__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9TaskGroup_8__repr___2generator26(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":860 * + ": " * + ", ".join( * "%s: %d" % (k, v) for (k, v) in sorted(self._states.items()) if v # <<<<<<<<<<<<<< * ) * + ">" */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_8__repr___genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_3_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 860, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9TaskGroup_8__repr___2generator26, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_repr___locals_genexpr, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.TaskGroup.__repr__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9TaskGroup_8__repr___2generator26(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; Py_ssize_t __pyx_t_10; Py_UCS4 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 860, __pyx_L1_error) __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 860, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->_states == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 860, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 860, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 860, __pyx_L1_error) } __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 860, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 860, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 860, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 860, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_v); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 860, __pyx_L1_error) if (__pyx_t_9) { __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_11 = 127; __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_v_k), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_11; __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_kp_u__4); __pyx_t_10 += 2; __Pyx_GIVEREF(__pyx_kp_u__4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__4); __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_cur_scope->__pyx_v_v), __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_11; __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":854 * ts._group = self * * def __repr__(self): # <<<<<<<<<<<<<< * return ( * "<" */ static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_4__repr__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_2___repr__(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_2___repr__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 854, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); /* "distributed/scheduler.py":855 * * def __repr__(self): * return ( # <<<<<<<<<<<<<< * "<" * + (self._name or "no-group") */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":857 * return ( * "<" * + (self._name or "no-group") # <<<<<<<<<<<<<< * + ": " * + ", ".join( */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_self->_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->_name); __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->_name; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u_no_group); __pyx_t_1 = __pyx_kp_u_no_group; __pyx_L3_bool_binop_done:; __pyx_t_3 = PyNumber_Add(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":858 * "<" * + (self._name or "no-group") * + ": " # <<<<<<<<<<<<<< * + ", ".join( * "%s: %d" % (k, v) for (k, v) in sorted(self._states.items()) if v */ __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":860 * + ": " * + ", ".join( * "%s: %d" % (k, v) for (k, v) in sorted(self._states.items()) if v # <<<<<<<<<<<<<< * ) * + ">" */ __pyx_t_3 = __pyx_pf_11distributed_9scheduler_9TaskGroup_8__repr___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":859 * + (self._name or "no-group") * + ": " * + ", ".join( # <<<<<<<<<<<<<< * "%s: %d" % (k, v) for (k, v) in sorted(self._states.items()) if v * ) */ __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":862 * "%s: %d" % (k, v) for (k, v) in sorted(self._states.items()) if v * ) * + ">" # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":854 * ts._group = self * * def __repr__(self): # <<<<<<<<<<<<<< * return ( * "<" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":865 * ) * * def __len__(self): # <<<<<<<<<<<<<< * return sum(self._states.values()) * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11distributed_9scheduler_9TaskGroup_7__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11distributed_9scheduler_9TaskGroup_7__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_6__len__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11distributed_9scheduler_9TaskGroup_6__len__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); /* "distributed/scheduler.py":866 * * def __len__(self): * return sum(self._states.values()) # <<<<<<<<<<<<<< * * */ if (unlikely(__pyx_v_self->_states == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 866, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Values(__pyx_v_self->_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; goto __pyx_L0; /* "distributed/scheduler.py":865 * ) * * def __len__(self): # <<<<<<<<<<<<<< * return sum(self._states.values()) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_8__reduce_cython__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_8__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._dependencies, self._duration, self._name, self._nbytes_in_memory, self._nbytes_total, self._prefix, self._states, self._types) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_duration); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_nbytes_in_memory); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->_nbytes_total); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->_dependencies); __Pyx_GIVEREF(__pyx_v_self->_dependencies); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_dependencies); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->_name); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->_prefix)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_prefix)); PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_self->_prefix)); __Pyx_INCREF(__pyx_v_self->_states); __Pyx_GIVEREF(__pyx_v_self->_states); PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_self->_states); __Pyx_INCREF(__pyx_v_self->_types); __Pyx_GIVEREF(__pyx_v_self->_types); PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_v_self->_types); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_state = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._dependencies, self._duration, self._name, self._nbytes_in_memory, self._nbytes_total, self._prefix, self._states, self._types) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v__dict = __pyx_t_4; __pyx_t_4 = 0; /* "(tree fragment)":7 * state = (self._dependencies, self._duration, self._name, self._nbytes_in_memory, self._nbytes_total, self._prefix, self._states, self._types) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_5 = (__pyx_v__dict != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._dependencies is not None or self._name is not None or self._prefix is not None or self._states is not None or self._types is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._dependencies, self._duration, self._name, self._nbytes_in_memory, self._nbytes_total, self._prefix, self._states, self._types) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._dependencies is not None or self._name is not None or self._prefix is not None or self._states is not None or self._types is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, None), state */ /*else*/ { __pyx_t_5 = (__pyx_v_self->_dependencies != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_5 != 0); if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_name != ((PyObject*)Py_None)); __pyx_t_5 = (__pyx_t_7 != 0); if (!__pyx_t_5) { } else { __pyx_t_6 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = (((PyObject *)__pyx_v_self->_prefix) != Py_None); __pyx_t_7 = (__pyx_t_5 != 0); if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_states != ((PyObject*)Py_None)); __pyx_t_5 = (__pyx_t_7 != 0); if (!__pyx_t_5) { } else { __pyx_t_6 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->_types != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_5 != 0); __pyx_t_6 = __pyx_t_7; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_6; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._dependencies is not None or self._name is not None or self._prefix is not None or self._states is not None or self._types is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, None), state * else: */ __pyx_t_6 = (__pyx_v_use_setstate != 0); if (__pyx_t_6) { /* "(tree fragment)":13 * use_setstate = self._dependencies is not None or self._name is not None or self._prefix is not None or self._states is not None or self._types is not None * if use_setstate: * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_TaskGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_135525525); __Pyx_GIVEREF(__pyx_int_135525525); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_135525525); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._dependencies is not None or self._name is not None or self._prefix is not None or self._states is not None or self._types is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, None), state * else: * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TaskGroup__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_TaskGroup); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_135525525); __Pyx_GIVEREF(__pyx_int_135525525); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_135525525); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TaskGroup__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskGroup_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskGroup_10__setstate_cython__(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskGroup_10__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TaskGroup__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11distributed_9scheduler___pyx_unpickle_TaskGroup__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_TaskGroup, (type(self), 0x813f495, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TaskGroup__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskGroup.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1193 * ) * * def __init__(self, key: str, run_spec: object): # <<<<<<<<<<<<<< * self._key = key * self._hash = hash(key) */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_9TaskState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11distributed_9scheduler_9TaskState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_run_spec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_run_spec,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_run_spec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1193, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1193, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_key = ((PyObject*)values[0]); __pyx_v_run_spec = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1193, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.TaskState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 1193, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState___init__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self), __pyx_v_key, __pyx_v_run_spec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_9TaskState___init__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_run_spec) { int __pyx_r; __Pyx_RefNannyDeclarations Py_hash_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":1194 * * def __init__(self, key: str, run_spec: object): * self._key = key # <<<<<<<<<<<<<< * self._hash = hash(key) * self._run_spec = run_spec */ __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); __Pyx_GOTREF(__pyx_v_self->_key); __Pyx_DECREF(__pyx_v_self->_key); __pyx_v_self->_key = __pyx_v_key; /* "distributed/scheduler.py":1195 * def __init__(self, key: str, run_spec: object): * self._key = key * self._hash = hash(key) # <<<<<<<<<<<<<< * self._run_spec = run_spec * self._state = None */ __pyx_t_1 = PyObject_Hash(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_hash_t)-1))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_v_self->_hash = __pyx_t_1; /* "distributed/scheduler.py":1196 * self._key = key * self._hash = hash(key) * self._run_spec = run_spec # <<<<<<<<<<<<<< * self._state = None * self._exception = self._traceback = self._exception_blame = None */ __Pyx_INCREF(__pyx_v_run_spec); __Pyx_GIVEREF(__pyx_v_run_spec); __Pyx_GOTREF(__pyx_v_self->_run_spec); __Pyx_DECREF(__pyx_v_self->_run_spec); __pyx_v_self->_run_spec = __pyx_v_run_spec; /* "distributed/scheduler.py":1197 * self._hash = hash(key) * self._run_spec = run_spec * self._state = None # <<<<<<<<<<<<<< * self._exception = self._traceback = self._exception_blame = None * self._suspicious = self._retries = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_state); __Pyx_DECREF(__pyx_v_self->_state); __pyx_v_self->_state = ((PyObject*)Py_None); /* "distributed/scheduler.py":1198 * self._run_spec = run_spec * self._state = None * self._exception = self._traceback = self._exception_blame = None # <<<<<<<<<<<<<< * self._suspicious = self._retries = 0 * self._nbytes = -1 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_exception); __Pyx_DECREF(__pyx_v_self->_exception); __pyx_v_self->_exception = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_traceback); __Pyx_DECREF(__pyx_v_self->_traceback); __pyx_v_self->_traceback = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_exception_blame); __Pyx_DECREF(__pyx_v_self->_exception_blame); __pyx_v_self->_exception_blame = Py_None; /* "distributed/scheduler.py":1199 * self._state = None * self._exception = self._traceback = self._exception_blame = None * self._suspicious = self._retries = 0 # <<<<<<<<<<<<<< * self._nbytes = -1 * self._priority = None */ __pyx_v_self->_suspicious = 0; __pyx_v_self->_retries = 0; /* "distributed/scheduler.py":1200 * self._exception = self._traceback = self._exception_blame = None * self._suspicious = self._retries = 0 * self._nbytes = -1 # <<<<<<<<<<<<<< * self._priority = None * self._who_wants = set() */ __pyx_v_self->_nbytes = -1L; /* "distributed/scheduler.py":1201 * self._suspicious = self._retries = 0 * self._nbytes = -1 * self._priority = None # <<<<<<<<<<<<<< * self._who_wants = set() * self._dependencies = set() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_priority); __Pyx_DECREF(__pyx_v_self->_priority); __pyx_v_self->_priority = ((PyObject*)Py_None); /* "distributed/scheduler.py":1202 * self._nbytes = -1 * self._priority = None * self._who_wants = set() # <<<<<<<<<<<<<< * self._dependencies = set() * self._dependents = set() */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_who_wants); __Pyx_DECREF(__pyx_v_self->_who_wants); __pyx_v_self->_who_wants = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1203 * self._priority = None * self._who_wants = set() * self._dependencies = set() # <<<<<<<<<<<<<< * self._dependents = set() * self._waiting_on = set() */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_dependencies); __Pyx_DECREF(__pyx_v_self->_dependencies); __pyx_v_self->_dependencies = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1204 * self._who_wants = set() * self._dependencies = set() * self._dependents = set() # <<<<<<<<<<<<<< * self._waiting_on = set() * self._waiters = set() */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_dependents); __Pyx_DECREF(__pyx_v_self->_dependents); __pyx_v_self->_dependents = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1205 * self._dependencies = set() * self._dependents = set() * self._waiting_on = set() # <<<<<<<<<<<<<< * self._waiters = set() * self._who_has = set() */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_waiting_on); __Pyx_DECREF(__pyx_v_self->_waiting_on); __pyx_v_self->_waiting_on = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1206 * self._dependents = set() * self._waiting_on = set() * self._waiters = set() # <<<<<<<<<<<<<< * self._who_has = set() * self._processing_on = None */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_waiters); __Pyx_DECREF(__pyx_v_self->_waiters); __pyx_v_self->_waiters = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1207 * self._waiting_on = set() * self._waiters = set() * self._who_has = set() # <<<<<<<<<<<<<< * self._processing_on = None * self._has_lost_dependencies = False */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_who_has); __Pyx_DECREF(__pyx_v_self->_who_has); __pyx_v_self->_who_has = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1208 * self._waiters = set() * self._who_has = set() * self._processing_on = None # <<<<<<<<<<<<<< * self._has_lost_dependencies = False * self._host_restrictions = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_processing_on); __Pyx_DECREF(((PyObject *)__pyx_v_self->_processing_on)); __pyx_v_self->_processing_on = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); /* "distributed/scheduler.py":1209 * self._who_has = set() * self._processing_on = None * self._has_lost_dependencies = False # <<<<<<<<<<<<<< * self._host_restrictions = None * self._worker_restrictions = None */ __pyx_v_self->_has_lost_dependencies = 0; /* "distributed/scheduler.py":1210 * self._processing_on = None * self._has_lost_dependencies = False * self._host_restrictions = None # <<<<<<<<<<<<<< * self._worker_restrictions = None * self._resource_restrictions = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_host_restrictions); __Pyx_DECREF(__pyx_v_self->_host_restrictions); __pyx_v_self->_host_restrictions = ((PyObject*)Py_None); /* "distributed/scheduler.py":1211 * self._has_lost_dependencies = False * self._host_restrictions = None * self._worker_restrictions = None # <<<<<<<<<<<<<< * self._resource_restrictions = None * self._loose_restrictions = False */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_worker_restrictions); __Pyx_DECREF(__pyx_v_self->_worker_restrictions); __pyx_v_self->_worker_restrictions = ((PyObject*)Py_None); /* "distributed/scheduler.py":1212 * self._host_restrictions = None * self._worker_restrictions = None * self._resource_restrictions = None # <<<<<<<<<<<<<< * self._loose_restrictions = False * self._actor = False */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_resource_restrictions); __Pyx_DECREF(__pyx_v_self->_resource_restrictions); __pyx_v_self->_resource_restrictions = ((PyObject*)Py_None); /* "distributed/scheduler.py":1213 * self._worker_restrictions = None * self._resource_restrictions = None * self._loose_restrictions = False # <<<<<<<<<<<<<< * self._actor = False * self._type = None */ __pyx_v_self->_loose_restrictions = 0; /* "distributed/scheduler.py":1214 * self._resource_restrictions = None * self._loose_restrictions = False * self._actor = False # <<<<<<<<<<<<<< * self._type = None * self._group_key = key_split_group(key) */ __pyx_v_self->_actor = 0; /* "distributed/scheduler.py":1215 * self._loose_restrictions = False * self._actor = False * self._type = None # <<<<<<<<<<<<<< * self._group_key = key_split_group(key) * self._group = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_type); __Pyx_DECREF(__pyx_v_self->_type); __pyx_v_self->_type = ((PyObject*)Py_None); /* "distributed/scheduler.py":1216 * self._actor = False * self._type = None * self._group_key = key_split_group(key) # <<<<<<<<<<<<<< * self._group = None * self._metadata = {} */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_key_split_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_group_key); __Pyx_DECREF(__pyx_v_self->_group_key); __pyx_v_self->_group_key = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1217 * self._type = None * self._group_key = key_split_group(key) * self._group = None # <<<<<<<<<<<<<< * self._metadata = {} * self._annotations = {} */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_group); __Pyx_DECREF(((PyObject *)__pyx_v_self->_group)); __pyx_v_self->_group = ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)Py_None); /* "distributed/scheduler.py":1218 * self._group_key = key_split_group(key) * self._group = None * self._metadata = {} # <<<<<<<<<<<<<< * self._annotations = {} * */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_metadata); __Pyx_DECREF(__pyx_v_self->_metadata); __pyx_v_self->_metadata = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1219 * self._group = None * self._metadata = {} * self._annotations = {} # <<<<<<<<<<<<<< * * def __hash__(self): */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_annotations); __Pyx_DECREF(__pyx_v_self->_annotations); __pyx_v_self->_annotations = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1193 * ) * * def __init__(self, key: str, run_spec: object): # <<<<<<<<<<<<<< * self._key = key * self._hash = hash(key) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1221 * self._annotations = {} * * def __hash__(self): # <<<<<<<<<<<<<< * return self._hash * */ /* Python wrapper */ static Py_hash_t __pyx_pw_11distributed_9scheduler_9TaskState_3__hash__(PyObject *__pyx_v_self); /*proto*/ static Py_hash_t __pyx_pw_11distributed_9scheduler_9TaskState_3__hash__(PyObject *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_2__hash__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_hash_t __pyx_pf_11distributed_9scheduler_9TaskState_2__hash__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__", 0); /* "distributed/scheduler.py":1222 * * def __hash__(self): * return self._hash # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __pyx_r = __pyx_v_self->_hash; goto __pyx_L0; /* "distributed/scheduler.py":1221 * self._annotations = {} * * def __hash__(self): # <<<<<<<<<<<<<< * return self._hash * */ /* function exit code */ __pyx_L0:; if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1224 * return self._hash * * def __eq__(self, other): # <<<<<<<<<<<<<< * typ_self: type = type(self) * typ_other: type = type(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_4__eq__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_4__eq__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, PyObject *__pyx_v_other) { PyTypeObject *__pyx_v_typ_self = 0; PyTypeObject *__pyx_v_typ_other = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_other_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 0); /* "distributed/scheduler.py":1225 * * def __eq__(self, other): * typ_self: type = type(self) # <<<<<<<<<<<<<< * typ_other: type = type(other) * if typ_self == typ_other: */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_v_typ_self = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); /* "distributed/scheduler.py":1226 * def __eq__(self, other): * typ_self: type = type(self) * typ_other: type = type(other) # <<<<<<<<<<<<<< * if typ_self == typ_other: * other_ts: TaskState = other */ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other))); __pyx_v_typ_other = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_other))); /* "distributed/scheduler.py":1227 * typ_self: type = type(self) * typ_other: type = type(other) * if typ_self == typ_other: # <<<<<<<<<<<<<< * other_ts: TaskState = other * return self._key == other_ts._key */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_typ_self), ((PyObject *)__pyx_v_typ_other), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":1228 * typ_other: type = type(other) * if typ_self == typ_other: * other_ts: TaskState = other # <<<<<<<<<<<<<< * return self._key == other_ts._key * else: */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1228, __pyx_L1_error) __pyx_t_1 = __pyx_v_other; __Pyx_INCREF(__pyx_t_1); __pyx_v_other_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":1229 * if typ_self == typ_other: * other_ts: TaskState = other * return self._key == other_ts._key # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_key, __pyx_v_other_ts->_key, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1227 * typ_self: type = type(self) * typ_other: type = type(other) * if typ_self == typ_other: # <<<<<<<<<<<<<< * other_ts: TaskState = other * return self._key == other_ts._key */ } /* "distributed/scheduler.py":1231 * return self._key == other_ts._key * else: * return False # <<<<<<<<<<<<<< * * @property */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "distributed/scheduler.py":1224 * return self._hash * * def __eq__(self, other): # <<<<<<<<<<<<<< * typ_self: type = type(self) * typ_other: type = type(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_typ_self); __Pyx_XDECREF(__pyx_v_typ_other); __Pyx_XDECREF((PyObject *)__pyx_v_other_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1234 * * @property * def key(self): # <<<<<<<<<<<<<< * return self._key * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_3key_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_3key_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_3key___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_3key___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1235 * @property * def key(self): * return self._key # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_key); __pyx_r = __pyx_v_self->_key; goto __pyx_L0; /* "distributed/scheduler.py":1234 * * @property * def key(self): # <<<<<<<<<<<<<< * return self._key * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1238 * * @property * def prefix(self): # <<<<<<<<<<<<<< * return self._prefix * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_6prefix_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_6prefix_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_6prefix___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_6prefix___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1239 * @property * def prefix(self): * return self._prefix # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_prefix)); __pyx_r = ((PyObject *)__pyx_v_self->_prefix); goto __pyx_L0; /* "distributed/scheduler.py":1238 * * @property * def prefix(self): # <<<<<<<<<<<<<< * return self._prefix * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1242 * * @property * def run_spec(self): # <<<<<<<<<<<<<< * return self._run_spec * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_8run_spec_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_8run_spec_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_8run_spec___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_8run_spec___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1243 * @property * def run_spec(self): * return self._run_spec # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_run_spec); __pyx_r = __pyx_v_self->_run_spec; goto __pyx_L0; /* "distributed/scheduler.py":1242 * * @property * def run_spec(self): # <<<<<<<<<<<<<< * return self._run_spec * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1246 * * @property * def priority(self): # <<<<<<<<<<<<<< * return self._priority * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_8priority_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_8priority___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_8priority___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1247 * @property * def priority(self): * return self._priority # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_priority); __pyx_r = __pyx_v_self->_priority; goto __pyx_L0; /* "distributed/scheduler.py":1246 * * @property * def priority(self): # <<<<<<<<<<<<<< * return self._priority * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1250 * * @property * def state(self) -> str: # <<<<<<<<<<<<<< * return self._state * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_5state_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_5state_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_5state___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_5state___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1251 * @property * def state(self) -> str: * return self._state # <<<<<<<<<<<<<< * * @state.setter */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_state); __pyx_r = __pyx_v_self->_state; goto __pyx_L0; /* "distributed/scheduler.py":1250 * * @property * def state(self) -> str: # <<<<<<<<<<<<<< * return self._state * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1254 * * @state.setter * def state(self, value: str): # <<<<<<<<<<<<<< * self._group._states[self._state] -= 1 * self._group._states[value] += 1 */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_9TaskState_5state_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11distributed_9scheduler_9TaskState_5state_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 1, "value", 1))) __PYX_ERR(0, 1254, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_5state_2__set__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self), ((PyObject*)__pyx_v_value)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_9TaskState_5state_2__set__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "distributed/scheduler.py":1255 * @state.setter * def state(self, value: str): * self._group._states[self._state] -= 1 # <<<<<<<<<<<<<< * self._group._states[value] += 1 * self._state = value */ if (unlikely(__pyx_v_self->_group->_states == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1255, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_self->_group->_states); __pyx_t_1 = __pyx_v_self->_group->_states; __Pyx_INCREF(__pyx_v_self->_state); __pyx_t_2 = __pyx_v_self->_state; if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1255, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1255, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":1256 * def state(self, value: str): * self._group._states[self._state] -= 1 * self._group._states[value] += 1 # <<<<<<<<<<<<<< * self._state = value * */ if (unlikely(__pyx_v_self->_group->_states == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1256, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_self->_group->_states); __pyx_t_1 = __pyx_v_self->_group->_states; __Pyx_INCREF(__pyx_v_value); __pyx_t_2 = __pyx_v_value; if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1256, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1256, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":1257 * self._group._states[self._state] -= 1 * self._group._states[value] += 1 * self._state = value # <<<<<<<<<<<<<< * * @property */ __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_state); __Pyx_DECREF(__pyx_v_self->_state); __pyx_v_self->_state = __pyx_v_value; /* "distributed/scheduler.py":1254 * * @state.setter * def state(self, value: str): # <<<<<<<<<<<<<< * self._group._states[self._state] -= 1 * self._group._states[value] += 1 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskState.state.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1260 * * @property * def dependencies(self): # <<<<<<<<<<<<<< * return self._dependencies * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_12dependencies_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_12dependencies_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_12dependencies___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_12dependencies___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1261 * @property * def dependencies(self): * return self._dependencies # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_dependencies); __pyx_r = __pyx_v_self->_dependencies; goto __pyx_L0; /* "distributed/scheduler.py":1260 * * @property * def dependencies(self): # <<<<<<<<<<<<<< * return self._dependencies * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1264 * * @property * def dependents(self): # <<<<<<<<<<<<<< * return self._dependents * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_10dependents_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_10dependents_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_10dependents___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10dependents___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1265 * @property * def dependents(self): * return self._dependents # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_dependents); __pyx_r = __pyx_v_self->_dependents; goto __pyx_L0; /* "distributed/scheduler.py":1264 * * @property * def dependents(self): # <<<<<<<<<<<<<< * return self._dependents * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1268 * * @property * def has_lost_dependencies(self): # <<<<<<<<<<<<<< * return self._has_lost_dependencies * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_21has_lost_dependencies_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_21has_lost_dependencies_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_21has_lost_dependencies___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_21has_lost_dependencies___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1269 * @property * def has_lost_dependencies(self): * return self._has_lost_dependencies # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_has_lost_dependencies); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1268 * * @property * def has_lost_dependencies(self): # <<<<<<<<<<<<<< * return self._has_lost_dependencies * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.has_lost_dependencies.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1272 * * @property * def waiting_on(self): # <<<<<<<<<<<<<< * return self._waiting_on * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_10waiting_on_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_10waiting_on_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_10waiting_on___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10waiting_on___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1273 * @property * def waiting_on(self): * return self._waiting_on # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_waiting_on); __pyx_r = __pyx_v_self->_waiting_on; goto __pyx_L0; /* "distributed/scheduler.py":1272 * * @property * def waiting_on(self): # <<<<<<<<<<<<<< * return self._waiting_on * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1276 * * @property * def waiters(self): # <<<<<<<<<<<<<< * return self._waiters * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7waiters_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7waiters_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_7waiters___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_7waiters___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1277 * @property * def waiters(self): * return self._waiters # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_waiters); __pyx_r = __pyx_v_self->_waiters; goto __pyx_L0; /* "distributed/scheduler.py":1276 * * @property * def waiters(self): # <<<<<<<<<<<<<< * return self._waiters * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1280 * * @property * def who_wants(self): # <<<<<<<<<<<<<< * return self._who_wants * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9who_wants_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9who_wants_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_9who_wants___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_9who_wants___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1281 * @property * def who_wants(self): * return self._who_wants # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_who_wants); __pyx_r = __pyx_v_self->_who_wants; goto __pyx_L0; /* "distributed/scheduler.py":1280 * * @property * def who_wants(self): # <<<<<<<<<<<<<< * return self._who_wants * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1284 * * @property * def who_has(self): # <<<<<<<<<<<<<< * return self._who_has * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7who_has_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7who_has_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_7who_has___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_7who_has___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1285 * @property * def who_has(self): * return self._who_has # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_who_has); __pyx_r = __pyx_v_self->_who_has; goto __pyx_L0; /* "distributed/scheduler.py":1284 * * @property * def who_has(self): # <<<<<<<<<<<<<< * return self._who_has * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1288 * * @property * def processing_on(self): # <<<<<<<<<<<<<< * return self._processing_on * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_13processing_on_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_13processing_on_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_13processing_on___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_13processing_on___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1289 * @property * def processing_on(self): * return self._processing_on # <<<<<<<<<<<<<< * * @processing_on.setter */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_processing_on)); __pyx_r = ((PyObject *)__pyx_v_self->_processing_on); goto __pyx_L0; /* "distributed/scheduler.py":1288 * * @property * def processing_on(self): # <<<<<<<<<<<<<< * return self._processing_on * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1292 * * @processing_on.setter * def processing_on(self, v: WorkerState): # <<<<<<<<<<<<<< * self._processing_on = v * */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_9TaskState_13processing_on_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/ static int __pyx_pw_11distributed_9scheduler_9TaskState_13processing_on_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_11distributed_9scheduler_WorkerState, 1, "v", 0))) __PYX_ERR(0, 1292, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_13processing_on_2__set__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self), ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_v)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_9TaskState_13processing_on_2__set__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); /* "distributed/scheduler.py":1293 * @processing_on.setter * def processing_on(self, v: WorkerState): * self._processing_on = v # <<<<<<<<<<<<<< * * @property */ __Pyx_INCREF(((PyObject *)__pyx_v_v)); __Pyx_GIVEREF(((PyObject *)__pyx_v_v)); __Pyx_GOTREF(__pyx_v_self->_processing_on); __Pyx_DECREF(((PyObject *)__pyx_v_self->_processing_on)); __pyx_v_self->_processing_on = __pyx_v_v; /* "distributed/scheduler.py":1292 * * @processing_on.setter * def processing_on(self, v: WorkerState): # <<<<<<<<<<<<<< * self._processing_on = v * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1296 * * @property * def retries(self): # <<<<<<<<<<<<<< * return self._retries * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7retries_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7retries_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_7retries___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_7retries___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1297 * @property * def retries(self): * return self._retries # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_retries); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1296 * * @property * def retries(self): # <<<<<<<<<<<<<< * return self._retries * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.retries.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1300 * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self._nbytes * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_6nbytes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_6nbytes___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_6nbytes___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1301 * @property * def nbytes(self): * return self._nbytes # <<<<<<<<<<<<<< * * @nbytes.setter */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1300 * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self._nbytes * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1304 * * @nbytes.setter * def nbytes(self, v: Py_ssize_t): # <<<<<<<<<<<<<< * self._nbytes = v * */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_9TaskState_6nbytes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ static int __pyx_pw_11distributed_9scheduler_9TaskState_6nbytes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { Py_ssize_t __pyx_v_v; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_v); { __pyx_v_v = __Pyx_PyIndex_AsSsize_t(__pyx_arg_v); if (unlikely((__pyx_v_v == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1304, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.TaskState.nbytes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_6nbytes_2__set__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self), ((Py_ssize_t)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_9TaskState_6nbytes_2__set__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, Py_ssize_t __pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); /* "distributed/scheduler.py":1305 * @nbytes.setter * def nbytes(self, v: Py_ssize_t): * self._nbytes = v # <<<<<<<<<<<<<< * * @property */ __pyx_v_self->_nbytes = __pyx_v_v; /* "distributed/scheduler.py":1304 * * @nbytes.setter * def nbytes(self, v: Py_ssize_t): # <<<<<<<<<<<<<< * self._nbytes = v * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1308 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_4type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_4type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_4type___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_4type___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1309 * @property * def type(self): * return self._type # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_type); __pyx_r = __pyx_v_self->_type; goto __pyx_L0; /* "distributed/scheduler.py":1308 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1312 * * @property * def exception(self): # <<<<<<<<<<<<<< * return self._exception * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9exception_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_9exception___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_9exception___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1313 * @property * def exception(self): * return self._exception # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_exception); __pyx_r = __pyx_v_self->_exception; goto __pyx_L0; /* "distributed/scheduler.py":1312 * * @property * def exception(self): # <<<<<<<<<<<<<< * return self._exception * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1316 * * @property * def traceback(self): # <<<<<<<<<<<<<< * return self._traceback * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9traceback_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9traceback_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_9traceback___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_9traceback___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1317 * @property * def traceback(self): * return self._traceback # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_traceback); __pyx_r = __pyx_v_self->_traceback; goto __pyx_L0; /* "distributed/scheduler.py":1316 * * @property * def traceback(self): # <<<<<<<<<<<<<< * return self._traceback * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1320 * * @property * def exception_blame(self): # <<<<<<<<<<<<<< * return self._exception_blame * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_15exception_blame_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_15exception_blame_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_15exception_blame___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_15exception_blame___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1321 * @property * def exception_blame(self): * return self._exception_blame # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_exception_blame); __pyx_r = __pyx_v_self->_exception_blame; goto __pyx_L0; /* "distributed/scheduler.py":1320 * * @property * def exception_blame(self): # <<<<<<<<<<<<<< * return self._exception_blame * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1324 * * @property * def suspicious(self): # <<<<<<<<<<<<<< * return self._suspicious * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_10suspicious_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_10suspicious_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_10suspicious___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10suspicious___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1325 * @property * def suspicious(self): * return self._suspicious # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_suspicious); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1324 * * @property * def suspicious(self): # <<<<<<<<<<<<<< * return self._suspicious * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.suspicious.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1328 * * @property * def host_restrictions(self): # <<<<<<<<<<<<<< * return self._host_restrictions * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_17host_restrictions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_17host_restrictions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_17host_restrictions___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_17host_restrictions___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1329 * @property * def host_restrictions(self): * return self._host_restrictions # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_host_restrictions); __pyx_r = __pyx_v_self->_host_restrictions; goto __pyx_L0; /* "distributed/scheduler.py":1328 * * @property * def host_restrictions(self): # <<<<<<<<<<<<<< * return self._host_restrictions * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1332 * * @property * def worker_restrictions(self): # <<<<<<<<<<<<<< * return self._worker_restrictions * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_19worker_restrictions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_19worker_restrictions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_19worker_restrictions___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_19worker_restrictions___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1333 * @property * def worker_restrictions(self): * return self._worker_restrictions # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_worker_restrictions); __pyx_r = __pyx_v_self->_worker_restrictions; goto __pyx_L0; /* "distributed/scheduler.py":1332 * * @property * def worker_restrictions(self): # <<<<<<<<<<<<<< * return self._worker_restrictions * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1336 * * @property * def resource_restrictions(self): # <<<<<<<<<<<<<< * return self._resource_restrictions * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_21resource_restrictions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_21resource_restrictions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_21resource_restrictions___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_21resource_restrictions___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1337 * @property * def resource_restrictions(self): * return self._resource_restrictions # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_resource_restrictions); __pyx_r = __pyx_v_self->_resource_restrictions; goto __pyx_L0; /* "distributed/scheduler.py":1336 * * @property * def resource_restrictions(self): # <<<<<<<<<<<<<< * return self._resource_restrictions * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1340 * * @property * def loose_restrictions(self): # <<<<<<<<<<<<<< * return self._loose_restrictions * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_18loose_restrictions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_18loose_restrictions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_18loose_restrictions___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_18loose_restrictions___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1341 * @property * def loose_restrictions(self): * return self._loose_restrictions # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_loose_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1340 * * @property * def loose_restrictions(self): # <<<<<<<<<<<<<< * return self._loose_restrictions * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.loose_restrictions.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1344 * * @property * def metadata(self): # <<<<<<<<<<<<<< * return self._metadata * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_8metadata_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_8metadata___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_8metadata___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1345 * @property * def metadata(self): * return self._metadata # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_metadata); __pyx_r = __pyx_v_self->_metadata; goto __pyx_L0; /* "distributed/scheduler.py":1344 * * @property * def metadata(self): # <<<<<<<<<<<<<< * return self._metadata * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1348 * * @property * def annotations(self): # <<<<<<<<<<<<<< * return self._annotations * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_11annotations_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_11annotations_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_11annotations___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_11annotations___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1349 * @property * def annotations(self): * return self._annotations # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_annotations); __pyx_r = __pyx_v_self->_annotations; goto __pyx_L0; /* "distributed/scheduler.py":1348 * * @property * def annotations(self): # <<<<<<<<<<<<<< * return self._annotations * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1352 * * @property * def actor(self): # <<<<<<<<<<<<<< * return self._actor * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_5actor_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_5actor_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_5actor___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_5actor___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1353 * @property * def actor(self): * return self._actor # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_actor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1352 * * @property * def actor(self): # <<<<<<<<<<<<<< * return self._actor * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.actor.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1356 * * @property * def group(self): # <<<<<<<<<<<<<< * return self._group * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_5group_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_5group_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_5group___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_5group___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1357 * @property * def group(self): * return self._group # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_group)); __pyx_r = ((PyObject *)__pyx_v_self->_group); goto __pyx_L0; /* "distributed/scheduler.py":1356 * * @property * def group(self): # <<<<<<<<<<<<<< * return self._group * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1360 * * @property * def group_key(self): # <<<<<<<<<<<<<< * return self._group_key * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9group_key_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9group_key_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_9group_key___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_9group_key___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1361 * @property * def group_key(self): * return self._group_key # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_group_key); __pyx_r = __pyx_v_self->_group_key; goto __pyx_L0; /* "distributed/scheduler.py":1360 * * @property * def group_key(self): # <<<<<<<<<<<<<< * return self._group_key * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1364 * * @property * def prefix_key(self): # <<<<<<<<<<<<<< * return self._prefix._name * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_10prefix_key_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_10prefix_key_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_10prefix_key___get__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10prefix_key___get__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1365 * @property * def prefix_key(self): * return self._prefix._name # <<<<<<<<<<<<<< * * @ccall */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_prefix->_name); __pyx_r = __pyx_v_self->_prefix->_name; goto __pyx_L0; /* "distributed/scheduler.py":1364 * * @property * def prefix_key(self): # <<<<<<<<<<<<<< * return self._prefix._name * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1368 * * @ccall * def add_dependency(self, other: "TaskState"): # <<<<<<<<<<<<<< * """ Add another task as a dependency of this task """ * self._dependencies.add(other) */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7add_dependency(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_add_dependency(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_other, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_dependency", 0); /* "distributed/scheduler.py":1370 * def add_dependency(self, other: "TaskState"): * """ Add another task as a dependency of this task """ * self._dependencies.add(other) # <<<<<<<<<<<<<< * self._group._dependencies.add(other._group) * other._dependents.add(self) */ if (unlikely(__pyx_v_self->_dependencies == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1370, __pyx_L1_error) } __pyx_t_1 = PySet_Add(__pyx_v_self->_dependencies, ((PyObject *)__pyx_v_other)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1370, __pyx_L1_error) /* "distributed/scheduler.py":1371 * """ Add another task as a dependency of this task """ * self._dependencies.add(other) * self._group._dependencies.add(other._group) # <<<<<<<<<<<<<< * other._dependents.add(self) * */ if (unlikely(__pyx_v_self->_group->_dependencies == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1371, __pyx_L1_error) } __pyx_t_2 = ((PyObject *)__pyx_v_other->_group); __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = PySet_Add(__pyx_v_self->_group->_dependencies, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1372 * self._dependencies.add(other) * self._group._dependencies.add(other._group) * other._dependents.add(self) # <<<<<<<<<<<<<< * * @ccall */ if (unlikely(__pyx_v_other->_dependents == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1372, __pyx_L1_error) } __pyx_t_1 = PySet_Add(__pyx_v_other->_dependents, ((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1372, __pyx_L1_error) /* "distributed/scheduler.py":1368 * * @ccall * def add_dependency(self, other: "TaskState"): # <<<<<<<<<<<<<< * """ Add another task as a dependency of this task """ * self._dependencies.add(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.TaskState.add_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7add_dependency(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9TaskState_6add_dependency[] = " Add another task as a dependency of this task "; static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_7add_dependency(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_dependency (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "other", 0))) __PYX_ERR(0, 1368, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_6add_dependency(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self), ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_other)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_6add_dependency(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_dependency", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_9TaskState_add_dependency(__pyx_v_self, __pyx_v_other, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.add_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1377 * @inline * @nogil * def get_nbytes(self) -> Py_ssize_t: # <<<<<<<<<<<<<< * return self._nbytes if self._nbytes >= 0 else DEFAULT_DATA_SIZE * */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9get_nbytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static CYTHON_INLINE Py_ssize_t __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { Py_ssize_t __pyx_r; Py_ssize_t __pyx_t_1; /* "distributed/scheduler.py":1378 * @nogil * def get_nbytes(self) -> Py_ssize_t: * return self._nbytes if self._nbytes >= 0 else DEFAULT_DATA_SIZE # <<<<<<<<<<<<<< * * @ccall */ if (((__pyx_v_self->_nbytes >= 0) != 0)) { __pyx_t_1 = __pyx_v_self->_nbytes; } else { __pyx_t_1 = __pyx_v_11distributed_9scheduler_DEFAULT_DATA_SIZE; } __pyx_r = __pyx_t_1; goto __pyx_L0; /* "distributed/scheduler.py":1377 * @inline * @nogil * def get_nbytes(self) -> Py_ssize_t: # <<<<<<<<<<<<<< * return self._nbytes if self._nbytes >= 0 else DEFAULT_DATA_SIZE * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9get_nbytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_9get_nbytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_nbytes (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_8get_nbytes(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_8get_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_nbytes", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.TaskState.get_nbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1381 * * @ccall * def set_nbytes(self, nbytes: Py_ssize_t): # <<<<<<<<<<<<<< * diff: Py_ssize_t = nbytes * old_nbytes: Py_ssize_t = self._nbytes */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_11set_nbytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_set_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, Py_ssize_t __pyx_v_nbytes, CYTHON_UNUSED int __pyx_skip_dispatch) { Py_ssize_t __pyx_v_diff; Py_ssize_t __pyx_v_old_nbytes; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_nbytes", 0); /* "distributed/scheduler.py":1382 * @ccall * def set_nbytes(self, nbytes: Py_ssize_t): * diff: Py_ssize_t = nbytes # <<<<<<<<<<<<<< * old_nbytes: Py_ssize_t = self._nbytes * if old_nbytes >= 0: */ __pyx_v_diff = __pyx_v_nbytes; /* "distributed/scheduler.py":1383 * def set_nbytes(self, nbytes: Py_ssize_t): * diff: Py_ssize_t = nbytes * old_nbytes: Py_ssize_t = self._nbytes # <<<<<<<<<<<<<< * if old_nbytes >= 0: * diff -= old_nbytes */ __pyx_t_1 = __pyx_v_self->_nbytes; __pyx_v_old_nbytes = __pyx_t_1; /* "distributed/scheduler.py":1384 * diff: Py_ssize_t = nbytes * old_nbytes: Py_ssize_t = self._nbytes * if old_nbytes >= 0: # <<<<<<<<<<<<<< * diff -= old_nbytes * self._group._nbytes_total += diff */ __pyx_t_2 = ((__pyx_v_old_nbytes >= 0) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":1385 * old_nbytes: Py_ssize_t = self._nbytes * if old_nbytes >= 0: * diff -= old_nbytes # <<<<<<<<<<<<<< * self._group._nbytes_total += diff * self._group._nbytes_in_memory += diff */ __pyx_v_diff = (__pyx_v_diff - __pyx_v_old_nbytes); /* "distributed/scheduler.py":1384 * diff: Py_ssize_t = nbytes * old_nbytes: Py_ssize_t = self._nbytes * if old_nbytes >= 0: # <<<<<<<<<<<<<< * diff -= old_nbytes * self._group._nbytes_total += diff */ } /* "distributed/scheduler.py":1386 * if old_nbytes >= 0: * diff -= old_nbytes * self._group._nbytes_total += diff # <<<<<<<<<<<<<< * self._group._nbytes_in_memory += diff * ws: WorkerState */ __Pyx_INCREF(((PyObject *)__pyx_v_self->_group)); __pyx_t_3 = __pyx_v_self->_group; __pyx_t_3->_nbytes_total = (__pyx_t_3->_nbytes_total + __pyx_v_diff); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":1387 * diff -= old_nbytes * self._group._nbytes_total += diff * self._group._nbytes_in_memory += diff # <<<<<<<<<<<<<< * ws: WorkerState * for ws in self._who_has: */ __Pyx_INCREF(((PyObject *)__pyx_v_self->_group)); __pyx_t_3 = __pyx_v_self->_group; __pyx_t_3->_nbytes_in_memory = (__pyx_t_3->_nbytes_in_memory + __pyx_v_diff); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":1389 * self._group._nbytes_in_memory += diff * ws: WorkerState * for ws in self._who_has: # <<<<<<<<<<<<<< * ws._nbytes += diff * self._nbytes = nbytes */ __pyx_t_1 = 0; __pyx_t_7 = __Pyx_set_iterator(__pyx_v_self->_who_has, 1, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_5, &__pyx_t_1, &__pyx_t_7, __pyx_t_6); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_7)); __pyx_t_7 = 0; /* "distributed/scheduler.py":1390 * ws: WorkerState * for ws in self._who_has: * ws._nbytes += diff # <<<<<<<<<<<<<< * self._nbytes = nbytes * */ __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes + __pyx_v_diff); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1391 * for ws in self._who_has: * ws._nbytes += diff * self._nbytes = nbytes # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_v_self->_nbytes = __pyx_v_nbytes; /* "distributed/scheduler.py":1381 * * @ccall * def set_nbytes(self, nbytes: Py_ssize_t): # <<<<<<<<<<<<<< * diff: Py_ssize_t = nbytes * old_nbytes: Py_ssize_t = self._nbytes */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(((PyObject *)__pyx_t_3)); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.TaskState.set_nbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_11set_nbytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_11set_nbytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes) { Py_ssize_t __pyx_v_nbytes; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_nbytes (wrapper)", 0); assert(__pyx_arg_nbytes); { __pyx_v_nbytes = __Pyx_PyIndex_AsSsize_t(__pyx_arg_nbytes); if (unlikely((__pyx_v_nbytes == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.TaskState.set_nbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_10set_nbytes(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self), ((Py_ssize_t)__pyx_v_nbytes)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_10set_nbytes(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, Py_ssize_t __pyx_v_nbytes) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_nbytes", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_9TaskState_set_nbytes(__pyx_v_self, __pyx_v_nbytes, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.set_nbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1393 * self._nbytes = nbytes * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self._key, self._state) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_13__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_13__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_12__repr__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_12__repr__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_UCS4 __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "distributed/scheduler.py":1394 * * def __repr__(self): * return "" % (self._key, self._state) # <<<<<<<<<<<<<< * * @ccall */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; __Pyx_INCREF(__pyx_kp_u_Task); __pyx_t_2 += 6; __Pyx_GIVEREF(__pyx_kp_u_Task); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Task); __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__7); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__7); __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__3); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__3); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1393 * self._nbytes = nbytes * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self._key, self._state) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.TaskState.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1397 * * @ccall * def validate(self): # <<<<<<<<<<<<<< * try: * for cs in self._who_wants: */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_15validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_9TaskState_validate(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_cs = NULL; PyObject *__pyx_v_ws = NULL; PyObject *__pyx_v_ts = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; char const *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate", 0); /* "distributed/scheduler.py":1398 * @ccall * def validate(self): * try: # <<<<<<<<<<<<<< * for cs in self._who_wants: * assert isinstance(cs, ClientState), (repr(cs), self._who_wants) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":1399 * def validate(self): * try: * for cs in self._who_wants: # <<<<<<<<<<<<<< * assert isinstance(cs, ClientState), (repr(cs), self._who_wants) * for ws in self._who_has: */ __pyx_t_5 = 0; __pyx_t_8 = __Pyx_set_iterator(__pyx_v_self->_who_wants, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1399, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1399, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_cs, __pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":1400 * try: * for cs in self._who_wants: * assert isinstance(cs, ClientState), (repr(cs), self._who_wants) # <<<<<<<<<<<<<< * for ws in self._who_has: * assert isinstance(ws, WorkerState), (repr(ws), self._who_has) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_cs, __pyx_ptype_11distributed_9scheduler_ClientState); if (unlikely(!(__pyx_t_10 != 0))) { __pyx_t_8 = PyObject_Repr(__pyx_v_cs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1400, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1400, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_INCREF(__pyx_v_self->_who_wants); __Pyx_GIVEREF(__pyx_v_self->_who_wants); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_self->_who_wants); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1400, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 1400, __pyx_L3_error) } } #endif } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1401 * for cs in self._who_wants: * assert isinstance(cs, ClientState), (repr(cs), self._who_wants) * for ws in self._who_has: # <<<<<<<<<<<<<< * assert isinstance(ws, WorkerState), (repr(ws), self._who_has) * for ts in self._dependencies: */ __pyx_t_6 = 0; __pyx_t_8 = __Pyx_set_iterator(__pyx_v_self->_who_has, 1, (&__pyx_t_5), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1401, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_5, &__pyx_t_6, &__pyx_t_8, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1401, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_ws, __pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":1402 * assert isinstance(cs, ClientState), (repr(cs), self._who_wants) * for ws in self._who_has: * assert isinstance(ws, WorkerState), (repr(ws), self._who_has) # <<<<<<<<<<<<<< * for ts in self._dependencies: * assert isinstance(ts, TaskState), (repr(ts), self._dependencies) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_ws, __pyx_ptype_11distributed_9scheduler_WorkerState); if (unlikely(!(__pyx_t_10 != 0))) { __pyx_t_8 = PyObject_Repr(__pyx_v_ws); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1402, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1402, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_INCREF(__pyx_v_self->_who_has); __Pyx_GIVEREF(__pyx_v_self->_who_has); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_self->_who_has); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1402, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 1402, __pyx_L3_error) } } #endif } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1403 * for ws in self._who_has: * assert isinstance(ws, WorkerState), (repr(ws), self._who_has) * for ts in self._dependencies: # <<<<<<<<<<<<<< * assert isinstance(ts, TaskState), (repr(ts), self._dependencies) * for ts in self._dependents: */ __pyx_t_5 = 0; __pyx_t_8 = __Pyx_set_iterator(__pyx_v_self->_dependencies, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1403, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1403, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_ts, __pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":1404 * assert isinstance(ws, WorkerState), (repr(ws), self._who_has) * for ts in self._dependencies: * assert isinstance(ts, TaskState), (repr(ts), self._dependencies) # <<<<<<<<<<<<<< * for ts in self._dependents: * assert isinstance(ts, TaskState), (repr(ts), self._dependents) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_ts, __pyx_ptype_11distributed_9scheduler_TaskState); if (unlikely(!(__pyx_t_10 != 0))) { __pyx_t_8 = PyObject_Repr(__pyx_v_ts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1404, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1404, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_INCREF(__pyx_v_self->_dependencies); __Pyx_GIVEREF(__pyx_v_self->_dependencies); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_self->_dependencies); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1404, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 1404, __pyx_L3_error) } } #endif } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1405 * for ts in self._dependencies: * assert isinstance(ts, TaskState), (repr(ts), self._dependencies) * for ts in self._dependents: # <<<<<<<<<<<<<< * assert isinstance(ts, TaskState), (repr(ts), self._dependents) * validate_task_state(self) */ __pyx_t_6 = 0; __pyx_t_8 = __Pyx_set_iterator(__pyx_v_self->_dependents, 1, (&__pyx_t_5), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1405, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_5, &__pyx_t_6, &__pyx_t_8, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1405, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_ts, __pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":1406 * assert isinstance(ts, TaskState), (repr(ts), self._dependencies) * for ts in self._dependents: * assert isinstance(ts, TaskState), (repr(ts), self._dependents) # <<<<<<<<<<<<<< * validate_task_state(self) * except Exception as e: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_ts, __pyx_ptype_11distributed_9scheduler_TaskState); if (unlikely(!(__pyx_t_10 != 0))) { __pyx_t_8 = PyObject_Repr(__pyx_v_ts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1406, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1406, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_INCREF(__pyx_v_self->_dependents); __Pyx_GIVEREF(__pyx_v_self->_dependents); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_self->_dependents); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1406, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 1406, __pyx_L3_error) } } #endif } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1407 * for ts in self._dependents: * assert isinstance(ts, TaskState), (repr(ts), self._dependents) * validate_task_state(self) # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_validate_task_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1407, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_v_self)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1407, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1398 * @ccall * def validate(self): * try: # <<<<<<<<<<<<<< * for cs in self._who_wants: * assert isinstance(cs, ClientState), (repr(cs), self._who_wants) */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":1408 * assert isinstance(ts, TaskState), (repr(ts), self._dependents) * validate_task_state(self) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_7) { __Pyx_AddTraceback("distributed.scheduler.TaskState.validate", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_11) < 0) __PYX_ERR(0, 1408, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_v_e = __pyx_t_8; /*try:*/ { /* "distributed/scheduler.py":1409 * validate_task_state(self) * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1409, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_exception); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1409, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); } } __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_13, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_e); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1409, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":1410 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1410, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1410, __pyx_L22_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_10) { /* "distributed/scheduler.py":1411 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_12 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1411, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_12); __pyx_v_pdb = __pyx_t_12; __pyx_t_12 = 0; /* "distributed/scheduler.py":1413 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * * def get_nbytes_deps(self): */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1413, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); } } __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1413, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":1410 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } } /* "distributed/scheduler.py":1408 * assert isinstance(ts, TaskState), (repr(ts), self._dependents) * validate_task_state(self) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; goto __pyx_L23; } __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_7 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_15; goto __pyx_L5_except_error; } __pyx_L23:; } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":1398 * @ccall * def validate(self): * try: # <<<<<<<<<<<<<< * for cs in self._who_wants: * assert isinstance(cs, ClientState), (repr(cs), self._who_wants) */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "distributed/scheduler.py":1397 * * @ccall * def validate(self): # <<<<<<<<<<<<<< * try: * for cs in self._who_wants: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("distributed.scheduler.TaskState.validate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cs); __Pyx_XDECREF(__pyx_v_ws); __Pyx_XDECREF(__pyx_v_ts); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_15validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_15validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_14validate(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_14validate(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_9TaskState_validate(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.validate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1415 * pdb.set_trace() * * def get_nbytes_deps(self): # <<<<<<<<<<<<<< * nbytes: Py_ssize_t = 0 * ts: TaskState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_17get_nbytes_deps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_17get_nbytes_deps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_nbytes_deps (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_16get_nbytes_deps(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_16get_nbytes_deps(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { Py_ssize_t __pyx_v_nbytes; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_nbytes_deps", 0); /* "distributed/scheduler.py":1416 * * def get_nbytes_deps(self): * nbytes: Py_ssize_t = 0 # <<<<<<<<<<<<<< * ts: TaskState * for ts in self._dependencies: */ __pyx_v_nbytes = 0; /* "distributed/scheduler.py":1418 * nbytes: Py_ssize_t = 0 * ts: TaskState * for ts in self._dependencies: # <<<<<<<<<<<<<< * nbytes += ts.get_nbytes() * return nbytes */ __pyx_t_2 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_self->_dependencies, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1418, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":1419 * ts: TaskState * for ts in self._dependencies: * nbytes += ts.get_nbytes() # <<<<<<<<<<<<<< * return nbytes * */ __pyx_t_7 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1419, __pyx_L1_error) __pyx_v_nbytes = (__pyx_v_nbytes + __pyx_t_7); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":1420 * for ts in self._dependencies: * nbytes += ts.get_nbytes() * return nbytes # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1415 * pdb.set_trace() * * def get_nbytes_deps(self): # <<<<<<<<<<<<<< * nbytes: Py_ssize_t = 0 * ts: TaskState */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.TaskState.get_nbytes_deps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_18__reduce_cython__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_18__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._actor, self._annotations, self._dependencies, self._dependents, self._exception, self._exception_blame, self._group, self._group_key, self._has_lost_dependencies, self._hash, self._host_restrictions, self._key, self._loose_restrictions, self._metadata, self._nbytes, self._prefix, self._priority, self._processing_on, self._resource_restrictions, self._retries, self._run_spec, self._state, self._suspicious, self._traceback, self._type, self._waiters, self._waiting_on, self._who_has, self._who_wants, self._worker_restrictions) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_actor); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_has_lost_dependencies); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_FromHash_t(__pyx_v_self->_hash); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->_loose_restrictions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->_retries); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_self->_suspicious); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(30); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->_annotations); __Pyx_GIVEREF(__pyx_v_self->_annotations); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->_annotations); __Pyx_INCREF(__pyx_v_self->_dependencies); __Pyx_GIVEREF(__pyx_v_self->_dependencies); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_self->_dependencies); __Pyx_INCREF(__pyx_v_self->_dependents); __Pyx_GIVEREF(__pyx_v_self->_dependents); PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_v_self->_dependents); __Pyx_INCREF(__pyx_v_self->_exception); __Pyx_GIVEREF(__pyx_v_self->_exception); PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_self->_exception); __Pyx_INCREF(__pyx_v_self->_exception_blame); __Pyx_GIVEREF(__pyx_v_self->_exception_blame); PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_v_self->_exception_blame); __Pyx_INCREF(((PyObject *)__pyx_v_self->_group)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_group)); PyTuple_SET_ITEM(__pyx_t_8, 6, ((PyObject *)__pyx_v_self->_group)); __Pyx_INCREF(__pyx_v_self->_group_key); __Pyx_GIVEREF(__pyx_v_self->_group_key); PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_v_self->_group_key); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 9, __pyx_t_3); __Pyx_INCREF(__pyx_v_self->_host_restrictions); __Pyx_GIVEREF(__pyx_v_self->_host_restrictions); PyTuple_SET_ITEM(__pyx_t_8, 10, __pyx_v_self->_host_restrictions); __Pyx_INCREF(__pyx_v_self->_key); __Pyx_GIVEREF(__pyx_v_self->_key); PyTuple_SET_ITEM(__pyx_t_8, 11, __pyx_v_self->_key); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 12, __pyx_t_4); __Pyx_INCREF(__pyx_v_self->_metadata); __Pyx_GIVEREF(__pyx_v_self->_metadata); PyTuple_SET_ITEM(__pyx_t_8, 13, __pyx_v_self->_metadata); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 14, __pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_self->_prefix)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_prefix)); PyTuple_SET_ITEM(__pyx_t_8, 15, ((PyObject *)__pyx_v_self->_prefix)); __Pyx_INCREF(__pyx_v_self->_priority); __Pyx_GIVEREF(__pyx_v_self->_priority); PyTuple_SET_ITEM(__pyx_t_8, 16, __pyx_v_self->_priority); __Pyx_INCREF(((PyObject *)__pyx_v_self->_processing_on)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_processing_on)); PyTuple_SET_ITEM(__pyx_t_8, 17, ((PyObject *)__pyx_v_self->_processing_on)); __Pyx_INCREF(__pyx_v_self->_resource_restrictions); __Pyx_GIVEREF(__pyx_v_self->_resource_restrictions); PyTuple_SET_ITEM(__pyx_t_8, 18, __pyx_v_self->_resource_restrictions); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 19, __pyx_t_6); __Pyx_INCREF(__pyx_v_self->_run_spec); __Pyx_GIVEREF(__pyx_v_self->_run_spec); PyTuple_SET_ITEM(__pyx_t_8, 20, __pyx_v_self->_run_spec); __Pyx_INCREF(__pyx_v_self->_state); __Pyx_GIVEREF(__pyx_v_self->_state); PyTuple_SET_ITEM(__pyx_t_8, 21, __pyx_v_self->_state); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 22, __pyx_t_7); __Pyx_INCREF(__pyx_v_self->_traceback); __Pyx_GIVEREF(__pyx_v_self->_traceback); PyTuple_SET_ITEM(__pyx_t_8, 23, __pyx_v_self->_traceback); __Pyx_INCREF(__pyx_v_self->_type); __Pyx_GIVEREF(__pyx_v_self->_type); PyTuple_SET_ITEM(__pyx_t_8, 24, __pyx_v_self->_type); __Pyx_INCREF(__pyx_v_self->_waiters); __Pyx_GIVEREF(__pyx_v_self->_waiters); PyTuple_SET_ITEM(__pyx_t_8, 25, __pyx_v_self->_waiters); __Pyx_INCREF(__pyx_v_self->_waiting_on); __Pyx_GIVEREF(__pyx_v_self->_waiting_on); PyTuple_SET_ITEM(__pyx_t_8, 26, __pyx_v_self->_waiting_on); __Pyx_INCREF(__pyx_v_self->_who_has); __Pyx_GIVEREF(__pyx_v_self->_who_has); PyTuple_SET_ITEM(__pyx_t_8, 27, __pyx_v_self->_who_has); __Pyx_INCREF(__pyx_v_self->_who_wants); __Pyx_GIVEREF(__pyx_v_self->_who_wants); PyTuple_SET_ITEM(__pyx_t_8, 28, __pyx_v_self->_who_wants); __Pyx_INCREF(__pyx_v_self->_worker_restrictions); __Pyx_GIVEREF(__pyx_v_self->_worker_restrictions); PyTuple_SET_ITEM(__pyx_t_8, 29, __pyx_v_self->_worker_restrictions); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_v_state = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._actor, self._annotations, self._dependencies, self._dependents, self._exception, self._exception_blame, self._group, self._group_key, self._has_lost_dependencies, self._hash, self._host_restrictions, self._key, self._loose_restrictions, self._metadata, self._nbytes, self._prefix, self._priority, self._processing_on, self._resource_restrictions, self._retries, self._run_spec, self._state, self._suspicious, self._traceback, self._type, self._waiters, self._waiting_on, self._who_has, self._who_wants, self._worker_restrictions) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_8 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v__dict = __pyx_t_8; __pyx_t_8 = 0; /* "(tree fragment)":7 * state = (self._actor, self._annotations, self._dependencies, self._dependents, self._exception, self._exception_blame, self._group, self._group_key, self._has_lost_dependencies, self._hash, self._host_restrictions, self._key, self._loose_restrictions, self._metadata, self._nbytes, self._prefix, self._priority, self._processing_on, self._resource_restrictions, self._retries, self._run_spec, self._state, self._suspicious, self._traceback, self._type, self._waiters, self._waiting_on, self._who_has, self._who_wants, self._worker_restrictions) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_9 = (__pyx_v__dict != Py_None); __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v__dict); __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._annotations is not None or self._dependencies is not None or self._dependents is not None or self._exception is not None or self._exception_blame is not None or self._group is not None or self._group_key is not None or self._host_restrictions is not None or self._key is not None or self._metadata is not None or self._prefix is not None or self._priority is not None or self._processing_on is not None or self._resource_restrictions is not None or self._run_spec is not None or self._state is not None or self._traceback is not None or self._type is not None or self._waiters is not None or self._waiting_on is not None or self._who_has is not None or self._who_wants is not None or self._worker_restrictions is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._actor, self._annotations, self._dependencies, self._dependents, self._exception, self._exception_blame, self._group, self._group_key, self._has_lost_dependencies, self._hash, self._host_restrictions, self._key, self._loose_restrictions, self._metadata, self._nbytes, self._prefix, self._priority, self._processing_on, self._resource_restrictions, self._retries, self._run_spec, self._state, self._suspicious, self._traceback, self._type, self._waiters, self._waiting_on, self._who_has, self._who_wants, self._worker_restrictions) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._annotations is not None or self._dependencies is not None or self._dependents is not None or self._exception is not None or self._exception_blame is not None or self._group is not None or self._group_key is not None or self._host_restrictions is not None or self._key is not None or self._metadata is not None or self._prefix is not None or self._priority is not None or self._processing_on is not None or self._resource_restrictions is not None or self._run_spec is not None or self._state is not None or self._traceback is not None or self._type is not None or self._waiters is not None or self._waiting_on is not None or self._who_has is not None or self._who_wants is not None or self._worker_restrictions is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, None), state */ /*else*/ { __pyx_t_9 = (__pyx_v_self->_annotations != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_dependencies != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_dependents != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_exception != Py_None); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_exception_blame != Py_None); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (((PyObject *)__pyx_v_self->_group) != Py_None); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_group_key != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_host_restrictions != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_key != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_metadata != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (((PyObject *)__pyx_v_self->_prefix) != Py_None); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_priority != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (((PyObject *)__pyx_v_self->_processing_on) != Py_None); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_resource_restrictions != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_run_spec != Py_None); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_state != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_traceback != Py_None); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_type != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_waiters != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_waiting_on != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_who_has != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_who_wants != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_worker_restrictions != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_9 != 0); __pyx_t_10 = __pyx_t_11; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_10; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._annotations is not None or self._dependencies is not None or self._dependents is not None or self._exception is not None or self._exception_blame is not None or self._group is not None or self._group_key is not None or self._host_restrictions is not None or self._key is not None or self._metadata is not None or self._prefix is not None or self._priority is not None or self._processing_on is not None or self._resource_restrictions is not None or self._run_spec is not None or self._state is not None or self._traceback is not None or self._type is not None or self._waiters is not None or self._waiting_on is not None or self._who_has is not None or self._who_wants is not None or self._worker_restrictions is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, None), state * else: */ __pyx_t_10 = (__pyx_v_use_setstate != 0); if (__pyx_t_10) { /* "(tree fragment)":13 * use_setstate = self._annotations is not None or self._dependencies is not None or self._dependents is not None or self._exception is not None or self._exception_blame is not None or self._group is not None or self._group_key is not None or self._host_restrictions is not None or self._key is not None or self._metadata is not None or self._prefix is not None or self._priority is not None or self._processing_on is not None or self._resource_restrictions is not None or self._run_spec is not None or self._state is not None or self._traceback is not None or self._type is not None or self._waiters is not None or self._waiting_on is not None or self._who_has is not None or self._who_wants is not None or self._worker_restrictions is not None * if use_setstate: * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pyx_unpickle_TaskState); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_64377685); __Pyx_GIVEREF(__pyx_int_64377685); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_64377685); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_8, 2, Py_None); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._annotations is not None or self._dependencies is not None or self._dependents is not None or self._exception is not None or self._exception_blame is not None or self._group is not None or self._group_key is not None or self._host_restrictions is not None or self._key is not None or self._metadata is not None or self._prefix is not None or self._priority is not None or self._processing_on is not None or self._resource_restrictions is not None or self._run_spec is not None or self._state is not None or self._traceback is not None or self._type is not None or self._waiters is not None or self._waiting_on is not None or self._who_has is not None or self._who_wants is not None or self._worker_restrictions is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, None), state * else: * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TaskState__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_TaskState); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_64377685); __Pyx_GIVEREF(__pyx_int_64377685); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_64377685); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("distributed.scheduler.TaskState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TaskState__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_9TaskState_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9TaskState_20__setstate_cython__(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9TaskState_20__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TaskState__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11distributed_9scheduler___pyx_unpickle_TaskState__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_TaskState, (type(self), 0x3d65355, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TaskState__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.TaskState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1428 * """ * * def __init__(self, states, accessor): # <<<<<<<<<<<<<< * self._states = states * self._accessor = accessor */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_states = 0; PyObject *__pyx_v_accessor = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_states,&__pyx_n_s_accessor,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 1428, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_accessor)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 1428, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1428, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_states = values[1]; __pyx_v_accessor = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1428, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler._StateLegacyMapping.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_19_StateLegacyMapping___init__(__pyx_self, __pyx_v_self, __pyx_v_states, __pyx_v_accessor); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_states, PyObject *__pyx_v_accessor) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":1429 * * def __init__(self, states, accessor): * self._states = states # <<<<<<<<<<<<<< * self._accessor = accessor * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_states_2, __pyx_v_states) < 0) __PYX_ERR(0, 1429, __pyx_L1_error) /* "distributed/scheduler.py":1430 * def __init__(self, states, accessor): * self._states = states * self._accessor = accessor # <<<<<<<<<<<<<< * * def __iter__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_accessor_2, __pyx_v_accessor) < 0) __PYX_ERR(0, 1430, __pyx_L1_error) /* "distributed/scheduler.py":1428 * """ * * def __init__(self, states, accessor): # <<<<<<<<<<<<<< * self._states = states * self._accessor = accessor */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler._StateLegacyMapping.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1432 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self._states) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_3__iter__ = {"__iter__", (PyCFunction)__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_3__iter__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_2__iter__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); /* "distributed/scheduler.py":1433 * * def __iter__(self): * return iter(self._states) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1432 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self._states) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler._StateLegacyMapping.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1435 * return iter(self._states) * * def __len__(self): # <<<<<<<<<<<<<< * return len(self._states) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_5__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_5__len__ = {"__len__", (PyCFunction)__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_5__len__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_5__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_4__len__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_4__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); /* "distributed/scheduler.py":1436 * * def __len__(self): * return len(self._states) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1435 * return iter(self._states) * * def __len__(self): # <<<<<<<<<<<<<< * return len(self._states) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler._StateLegacyMapping.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1438 * return len(self._states) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self._accessor(self._states[key]) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_7__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_7__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_7__getitem__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_7__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1438, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1438, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1438, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler._StateLegacyMapping.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_6__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_6__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "distributed/scheduler.py":1439 * * def __getitem__(self, key): * return self._accessor(self._states[key]) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_accessor_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1438 * return len(self._states) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self._accessor(self._states[key]) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler._StateLegacyMapping.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1441 * return self._accessor(self._states[key]) * * def __repr__(self): # <<<<<<<<<<<<<< * return "%s(%s)" % (self.__class__, dict(self)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_9__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_9__repr__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_19_StateLegacyMapping_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_8__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_19_StateLegacyMapping_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_UCS4 __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "distributed/scheduler.py":1442 * * def __repr__(self): * return "%s(%s)" % (self.__class__, dict(self)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__8); __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__9); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__9); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1441 * return self._accessor(self._states[key]) * * def __repr__(self): # <<<<<<<<<<<<<< * return "%s(%s)" % (self.__class__, dict(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler._StateLegacyMapping.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_27_OptionalStateLegacyMapping_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":1453 * # For tasks etc. * * def __iter__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * for k, v in self._states.items(): */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_1__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_27_OptionalStateLegacyMapping_1__iter__ = {"__iter__", (PyCFunction)__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_1__iter__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_1__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping___iter__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping___iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_4___iter__(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_4___iter__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 1453, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_27_OptionalStateLegacyMapping_2generator, __pyx_codeobj__10, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_OptionalStateLegacyMapping___it, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler._OptionalStateLegacyMapping.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_27_OptionalStateLegacyMapping_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L7_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1453, __pyx_L1_error) /* "distributed/scheduler.py":1454 * * def __iter__(self): * accessor = self._accessor # <<<<<<<<<<<<<< * for k, v in self._states.items(): * if accessor(v): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_accessor_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_accessor = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":1455 * def __iter__(self): * accessor = self._accessor * for k, v in self._states.items(): # <<<<<<<<<<<<<< * if accessor(v): * yield k */ __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_t_5 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 1455, __pyx_L1_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":1456 * accessor = self._accessor * for k, v in self._states.items(): * if accessor(v): # <<<<<<<<<<<<<< * yield k * */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_accessor); __pyx_t_6 = __pyx_cur_scope->__pyx_v_accessor; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_cur_scope->__pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* "distributed/scheduler.py":1457 * for k, v in self._states.items(): * if accessor(v): * yield k # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_k); __pyx_r = __pyx_cur_scope->__pyx_v_k; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1457, __pyx_L1_error) /* "distributed/scheduler.py":1456 * accessor = self._accessor * for k, v in self._states.items(): * if accessor(v): # <<<<<<<<<<<<<< * yield k * */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":1453 * # For tasks etc. * * def __iter__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * for k, v in self._states.items(): */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1459 * yield k * * def __len__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_4__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_27_OptionalStateLegacyMapping_4__len__ = {"__len__", (PyCFunction)__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_4__len__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_4__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_3__len__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_27_OptionalStateLegacyMapping_7__len___2generator27(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":1461 * def __len__(self): * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ static PyObject *__pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_7__len___genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_6_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 1461, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_27_OptionalStateLegacyMapping_7__len___2generator27, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_OptionalStateLegacyMapping___le, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler._OptionalStateLegacyMapping.__len__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_27_OptionalStateLegacyMapping_7__len___2generator27(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1461, __pyx_L1_error) __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1461, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_t_5 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 1461, __pyx_L1_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_accessor)) { __Pyx_RaiseClosureNameError("accessor"); __PYX_ERR(0, 1461, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_accessor); __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_accessor; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_cur_scope->__pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_9))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1461, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1459 * yield k * * def __len__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) */ static PyObject *__pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_3__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_5___len__(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_5___len__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 1459, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); /* "distributed/scheduler.py":1460 * * def __len__(self): * accessor = self._accessor # <<<<<<<<<<<<<< * return sum(bool(accessor(v)) for v in self._states.values()) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_accessor_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_accessor = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":1461 * def __len__(self): * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_7__len___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1459 * yield k * * def __len__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler._OptionalStateLegacyMapping.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1463 * return sum(bool(accessor(v)) for v in self._states.values()) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * v = self._accessor(self._states[key]) * if v: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_6__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_27_OptionalStateLegacyMapping_6__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_6__getitem__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_27_OptionalStateLegacyMapping_6__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1463, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1463, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1463, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler._OptionalStateLegacyMapping.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_5__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_27_OptionalStateLegacyMapping_5__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "distributed/scheduler.py":1464 * * def __getitem__(self, key): * v = self._accessor(self._states[key]) # <<<<<<<<<<<<<< * if v: * return v */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_accessor_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":1465 * def __getitem__(self, key): * v = self._accessor(self._states[key]) * if v: # <<<<<<<<<<<<<< * return v * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1465, __pyx_L1_error) if (likely(__pyx_t_5)) { /* "distributed/scheduler.py":1466 * v = self._accessor(self._states[key]) * if v: * return v # <<<<<<<<<<<<<< * else: * raise KeyError */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_v); __pyx_r = __pyx_v_v; goto __pyx_L0; /* "distributed/scheduler.py":1465 * def __getitem__(self, key): * v = self._accessor(self._states[key]) * if v: # <<<<<<<<<<<<<< * return v * else: */ } /* "distributed/scheduler.py":1468 * return v * else: * raise KeyError # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_Raise(__pyx_builtin_KeyError, 0, 0, 0); __PYX_ERR(0, 1468, __pyx_L1_error) } /* "distributed/scheduler.py":1463 * return sum(bool(accessor(v)) for v in self._states.values()) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * v = self._accessor(self._states[key]) * if v: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler._OptionalStateLegacyMapping.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1479 * # For loose_restrictions * * def __init__(self, states, accessor): # <<<<<<<<<<<<<< * self._states = states * self._accessor = accessor */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_15_StateLegacySet_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_15_StateLegacySet_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_states = 0; PyObject *__pyx_v_accessor = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_states,&__pyx_n_s_accessor,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 1479, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_accessor)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 1479, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1479, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_states = values[1]; __pyx_v_accessor = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1479, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler._StateLegacySet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_15_StateLegacySet___init__(__pyx_self, __pyx_v_self, __pyx_v_states, __pyx_v_accessor); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_states, PyObject *__pyx_v_accessor) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":1480 * * def __init__(self, states, accessor): * self._states = states # <<<<<<<<<<<<<< * self._accessor = accessor * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_states_2, __pyx_v_states) < 0) __PYX_ERR(0, 1480, __pyx_L1_error) /* "distributed/scheduler.py":1481 * def __init__(self, states, accessor): * self._states = states * self._accessor = accessor # <<<<<<<<<<<<<< * * def __iter__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_accessor_2, __pyx_v_accessor) < 0) __PYX_ERR(0, 1481, __pyx_L1_error) /* "distributed/scheduler.py":1479 * # For loose_restrictions * * def __init__(self, states, accessor): # <<<<<<<<<<<<<< * self._states = states * self._accessor = accessor */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler._StateLegacySet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1483 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return (k for k, v in self._states.items() if self._accessor(v)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_15_StateLegacySet_3__iter__ = {"__iter__", (PyCFunction)__pyx_pw_11distributed_9scheduler_15_StateLegacySet_3__iter__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_15_StateLegacySet_2__iter__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_15_StateLegacySet_8__iter___2generator28(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":1484 * * def __iter__(self): * return (k for k, v in self._states.items() if self._accessor(v)) # <<<<<<<<<<<<<< * * def __len__(self): */ static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_8__iter___genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_8_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 1484, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_15_StateLegacySet_8__iter___2generator28, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_StateLegacySet___iter___locals, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler._StateLegacySet.__iter__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_15_StateLegacySet_8__iter___2generator28(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L7_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1484, __pyx_L1_error) __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1484, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_t_5 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 1484, __pyx_L1_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1484, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_accessor_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_cur_scope->__pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_k); __pyx_r = __pyx_cur_scope->__pyx_v_k; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1484, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1483 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return (k for k, v in self._states.items() if self._accessor(v)) * */ static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_7___iter__(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_7___iter__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 1483, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); /* "distributed/scheduler.py":1484 * * def __iter__(self): * return (k for k, v in self._states.items() if self._accessor(v)) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_pf_11distributed_9scheduler_15_StateLegacySet_8__iter___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1483 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return (k for k, v in self._states.items() if self._accessor(v)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler._StateLegacySet.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1486 * return (k for k, v in self._states.items() if self._accessor(v)) * * def __len__(self): # <<<<<<<<<<<<<< * return sum(map(bool, map(self._accessor, self._states.values()))) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_5__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_15_StateLegacySet_5__len__ = {"__len__", (PyCFunction)__pyx_pw_11distributed_9scheduler_15_StateLegacySet_5__len__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_5__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_15_StateLegacySet_4__len__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_4__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); /* "distributed/scheduler.py":1487 * * def __len__(self): * return sum(map(bool, map(self._accessor, self._states.values()))) # <<<<<<<<<<<<<< * * def __contains__(self, k): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_accessor_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject*)&PyBool_Type)); __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject*)&PyBool_Type)); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1486 * return (k for k, v in self._states.items() if self._accessor(v)) * * def __len__(self): # <<<<<<<<<<<<<< * return sum(map(bool, map(self._accessor, self._states.values()))) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler._StateLegacySet.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1489 * return sum(map(bool, map(self._accessor, self._states.values()))) * * def __contains__(self, k): # <<<<<<<<<<<<<< * st = self._states.get(k) * return st is not None and bool(self._accessor(st)) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_7__contains__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_15_StateLegacySet_7__contains__ = {"__contains__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_15_StateLegacySet_7__contains__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_7__contains__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_k = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_k,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 1489, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__contains__") < 0)) __PYX_ERR(0, 1489, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_k = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1489, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler._StateLegacySet.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_15_StateLegacySet_6__contains__(__pyx_self, __pyx_v_self, __pyx_v_k); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_6__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_k) { PyObject *__pyx_v_st = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 0); /* "distributed/scheduler.py":1490 * * def __contains__(self, k): * st = self._states.get(k) # <<<<<<<<<<<<<< * return st is not None and bool(self._accessor(st)) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_k); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_st = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":1491 * def __contains__(self, k): * st = self._states.get(k) * return st is not None and bool(self._accessor(st)) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = (__pyx_v_st != Py_None); if (__pyx_t_4) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L3_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_accessor_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_st) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_st); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1489 * return sum(map(bool, map(self._accessor, self._states.values()))) * * def __contains__(self, k): # <<<<<<<<<<<<<< * st = self._states.get(k) * return st is not None and bool(self._accessor(st)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler._StateLegacySet.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_st); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1493 * return st is not None and bool(self._accessor(st)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "%s(%s)" % (self.__class__, set(self)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_15_StateLegacySet_9__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11distributed_9scheduler_15_StateLegacySet_9__repr__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_15_StateLegacySet_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_15_StateLegacySet_8__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_15_StateLegacySet_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_UCS4 __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "distributed/scheduler.py":1494 * * def __repr__(self): * return "%s(%s)" % (self.__class__, set(self)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__8); __pyx_t_5 = PySet_New(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__9); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__9); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1493 * return st is not None and bool(self._accessor(st)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "%s(%s)" % (self.__class__, set(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler._StateLegacySet.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1497 * * * def _legacy_task_key_set(tasks): # <<<<<<<<<<<<<< * """ * Transform a set of task states into a set of task keys. */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_19_legacy_task_key_set(PyObject *__pyx_self, PyObject *__pyx_v_tasks); /*proto*/ static char __pyx_doc_11distributed_9scheduler_18_legacy_task_key_set[] = "\n Transform a set of task states into a set of task keys.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_19_legacy_task_key_set = {"_legacy_task_key_set", (PyCFunction)__pyx_pw_11distributed_9scheduler_19_legacy_task_key_set, METH_O, __pyx_doc_11distributed_9scheduler_18_legacy_task_key_set}; static PyObject *__pyx_pw_11distributed_9scheduler_19_legacy_task_key_set(PyObject *__pyx_self, PyObject *__pyx_v_tasks) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_legacy_task_key_set (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_18_legacy_task_key_set(__pyx_self, ((PyObject *)__pyx_v_tasks)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_18_legacy_task_key_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tasks) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr16__pyx_v_ts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_legacy_task_key_set", 0); /* "distributed/scheduler.py":1502 * """ * ts: TaskState * return {ts._key for ts in tasks} # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1502, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_tasks)) || PyTuple_CheckExact(__pyx_v_tasks)) { __pyx_t_2 = __pyx_v_tasks; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_tasks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1502, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1502, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1502, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1502, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1502, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1502, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_9genexpr16__pyx_v_ts->_key))) __PYX_ERR(0, 1502, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr16__pyx_v_ts); __pyx_9genexpr16__pyx_v_ts = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr16__pyx_v_ts); __pyx_9genexpr16__pyx_v_ts = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1497 * * * def _legacy_task_key_set(tasks): # <<<<<<<<<<<<<< * """ * Transform a set of task states into a set of task keys. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler._legacy_task_key_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr16__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1505 * * * def _legacy_client_key_set(clients): # <<<<<<<<<<<<<< * """ * Transform a set of client states into a set of client keys. */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_21_legacy_client_key_set(PyObject *__pyx_self, PyObject *__pyx_v_clients); /*proto*/ static char __pyx_doc_11distributed_9scheduler_20_legacy_client_key_set[] = "\n Transform a set of client states into a set of client keys.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_21_legacy_client_key_set = {"_legacy_client_key_set", (PyCFunction)__pyx_pw_11distributed_9scheduler_21_legacy_client_key_set, METH_O, __pyx_doc_11distributed_9scheduler_20_legacy_client_key_set}; static PyObject *__pyx_pw_11distributed_9scheduler_21_legacy_client_key_set(PyObject *__pyx_self, PyObject *__pyx_v_clients) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_legacy_client_key_set (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_20_legacy_client_key_set(__pyx_self, ((PyObject *)__pyx_v_clients)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_20_legacy_client_key_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_clients) { struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_9genexpr17__pyx_v_cs = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_legacy_client_key_set", 0); /* "distributed/scheduler.py":1510 * """ * cs: ClientState * return {cs._client_key for cs in clients} # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_clients)) || PyTuple_CheckExact(__pyx_v_clients)) { __pyx_t_2 = __pyx_v_clients; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_clients); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1510, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1510, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1510, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1510, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1510, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 1510, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_5)); __pyx_t_5 = 0; if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_9genexpr17__pyx_v_cs->_client_key))) __PYX_ERR(0, 1510, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr17__pyx_v_cs); __pyx_9genexpr17__pyx_v_cs = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr17__pyx_v_cs); __pyx_9genexpr17__pyx_v_cs = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1505 * * * def _legacy_client_key_set(clients): # <<<<<<<<<<<<<< * """ * Transform a set of client states into a set of client keys. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler._legacy_client_key_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr17__pyx_v_cs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1513 * * * def _legacy_worker_key_set(workers): # <<<<<<<<<<<<<< * """ * Transform a set of worker states into a set of worker keys. */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_23_legacy_worker_key_set(PyObject *__pyx_self, PyObject *__pyx_v_workers); /*proto*/ static char __pyx_doc_11distributed_9scheduler_22_legacy_worker_key_set[] = "\n Transform a set of worker states into a set of worker keys.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_23_legacy_worker_key_set = {"_legacy_worker_key_set", (PyCFunction)__pyx_pw_11distributed_9scheduler_23_legacy_worker_key_set, METH_O, __pyx_doc_11distributed_9scheduler_22_legacy_worker_key_set}; static PyObject *__pyx_pw_11distributed_9scheduler_23_legacy_worker_key_set(PyObject *__pyx_self, PyObject *__pyx_v_workers) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_legacy_worker_key_set (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_22_legacy_worker_key_set(__pyx_self, ((PyObject *)__pyx_v_workers)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_22_legacy_worker_key_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_workers) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr18__pyx_v_ws = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_legacy_worker_key_set", 0); /* "distributed/scheduler.py":1518 * """ * ws: WorkerState * return {ws._address for ws in workers} # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_workers)) || PyTuple_CheckExact(__pyx_v_workers)) { __pyx_t_2 = __pyx_v_workers; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1518, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1518, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1518, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1518, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1518, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1518, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1518, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 1518, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_5)); __pyx_t_5 = 0; if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_9genexpr18__pyx_v_ws->_address))) __PYX_ERR(0, 1518, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr18__pyx_v_ws); __pyx_9genexpr18__pyx_v_ws = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr18__pyx_v_ws); __pyx_9genexpr18__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1513 * * * def _legacy_worker_key_set(workers): # <<<<<<<<<<<<<< * """ * Transform a set of worker states into a set of worker keys. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler._legacy_worker_key_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr18__pyx_v_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1521 * * * def _legacy_task_key_dict(task_dict): # <<<<<<<<<<<<<< * """ * Transform a dict of {task state: value} into a dict of {task key: value}. */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_25_legacy_task_key_dict(PyObject *__pyx_self, PyObject *__pyx_v_task_dict); /*proto*/ static char __pyx_doc_11distributed_9scheduler_24_legacy_task_key_dict[] = "\n Transform a dict of {task state: value} into a dict of {task key: value}.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_25_legacy_task_key_dict = {"_legacy_task_key_dict", (PyCFunction)__pyx_pw_11distributed_9scheduler_25_legacy_task_key_dict, METH_O, __pyx_doc_11distributed_9scheduler_24_legacy_task_key_dict}; static PyObject *__pyx_pw_11distributed_9scheduler_25_legacy_task_key_dict(PyObject *__pyx_self, PyObject *__pyx_v_task_dict) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_legacy_task_key_dict (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_24_legacy_task_key_dict(__pyx_self, ((PyObject *)__pyx_v_task_dict)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_24_legacy_task_key_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task_dict) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr19__pyx_v_ts = NULL; PyObject *__pyx_9genexpr19__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_legacy_task_key_dict", 0); /* "distributed/scheduler.py":1526 * """ * ts: TaskState * return {ts._key: value for ts, value in task_dict.items()} # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 0; if (unlikely(__pyx_v_task_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 1526, __pyx_L5_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_task_dict, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, &__pyx_t_7, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1526, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1526, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_value, __pyx_t_7); __pyx_t_7 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr19__pyx_v_ts->_key, (PyObject*)__pyx_9genexpr19__pyx_v_value))) __PYX_ERR(0, 1526, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr19__pyx_v_ts); __pyx_9genexpr19__pyx_v_ts = 0; __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_value); __pyx_9genexpr19__pyx_v_value = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr19__pyx_v_ts); __pyx_9genexpr19__pyx_v_ts = 0; __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_value); __pyx_9genexpr19__pyx_v_value = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1521 * * * def _legacy_task_key_dict(task_dict): # <<<<<<<<<<<<<< * """ * Transform a dict of {task state: value} into a dict of {task key: value}. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler._legacy_task_key_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr19__pyx_v_ts); __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1529 * * * def _task_key_or_none(task): # <<<<<<<<<<<<<< * return task.key if task is not None else None * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_27_task_key_or_none(PyObject *__pyx_self, PyObject *__pyx_v_task); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_27_task_key_or_none = {"_task_key_or_none", (PyCFunction)__pyx_pw_11distributed_9scheduler_27_task_key_or_none, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_27_task_key_or_none(PyObject *__pyx_self, PyObject *__pyx_v_task) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_task_key_or_none (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_26_task_key_or_none(__pyx_self, ((PyObject *)__pyx_v_task)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_26_task_key_or_none(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_task_key_or_none", 0); /* "distributed/scheduler.py":1530 * * def _task_key_or_none(task): * return task.key if task is not None else None # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = (__pyx_v_task != Py_None); if ((__pyx_t_2 != 0)) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_task, __pyx_n_s_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1529 * * * def _task_key_or_none(task): # <<<<<<<<<<<<<< * return task.key if task is not None else None * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler._task_key_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1602 * _workers_dv: dict * * def __init__( # <<<<<<<<<<<<<< * self, * aliases: dict = None, */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_14SchedulerState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11distributed_9scheduler_14SchedulerState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_aliases = 0; PyObject *__pyx_v_clients = 0; PyObject *__pyx_v_workers = 0; PyObject *__pyx_v_host_info = 0; PyObject *__pyx_v_resources = 0; PyObject *__pyx_v_tasks = 0; PyObject *__pyx_v_unrunnable = 0; int __pyx_v_validate; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aliases,&__pyx_n_s_clients,&__pyx_n_s_workers,&__pyx_n_s_host_info,&__pyx_n_s_resources,&__pyx_n_s_tasks,&__pyx_n_s_unrunnable,&__pyx_n_s_validate,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":1604 * def __init__( * self, * aliases: dict = None, # <<<<<<<<<<<<<< * clients: dict = None, * workers=None, */ values[0] = ((PyObject*)Py_None); /* "distributed/scheduler.py":1605 * self, * aliases: dict = None, * clients: dict = None, # <<<<<<<<<<<<<< * workers=None, * host_info=None, */ values[1] = ((PyObject*)Py_None); /* "distributed/scheduler.py":1606 * aliases: dict = None, * clients: dict = None, * workers=None, # <<<<<<<<<<<<<< * host_info=None, * resources=None, */ values[2] = ((PyObject *)Py_None); /* "distributed/scheduler.py":1607 * clients: dict = None, * workers=None, * host_info=None, # <<<<<<<<<<<<<< * resources=None, * tasks: dict = None, */ values[3] = ((PyObject *)Py_None); /* "distributed/scheduler.py":1608 * workers=None, * host_info=None, * resources=None, # <<<<<<<<<<<<<< * tasks: dict = None, * unrunnable: set = None, */ values[4] = ((PyObject *)Py_None); /* "distributed/scheduler.py":1609 * host_info=None, * resources=None, * tasks: dict = None, # <<<<<<<<<<<<<< * unrunnable: set = None, * validate: bint = False, */ values[5] = ((PyObject*)Py_None); /* "distributed/scheduler.py":1610 * resources=None, * tasks: dict = None, * unrunnable: set = None, # <<<<<<<<<<<<<< * validate: bint = False, * **kwargs, */ values[6] = ((PyObject*)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_aliases); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clients); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host_info); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resources); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tasks); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unrunnable); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_validate); if (value) { values[7] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_aliases = ((PyObject*)values[0]); __pyx_v_clients = ((PyObject*)values[1]); __pyx_v_workers = values[2]; __pyx_v_host_info = values[3]; __pyx_v_resources = values[4]; __pyx_v_tasks = ((PyObject*)values[5]); __pyx_v_unrunnable = ((PyObject*)values[6]); if (values[7]) { __pyx_v_validate = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_validate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1611, __pyx_L3_error) } else { /* "distributed/scheduler.py":1611 * tasks: dict = None, * unrunnable: set = None, * validate: bint = False, # <<<<<<<<<<<<<< * **kwargs, * ): */ __pyx_v_validate = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1602, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aliases), (&PyDict_Type), 1, "aliases", 1))) __PYX_ERR(0, 1604, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_clients), (&PyDict_Type), 1, "clients", 1))) __PYX_ERR(0, 1605, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tasks), (&PyDict_Type), 1, "tasks", 1))) __PYX_ERR(0, 1609, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unrunnable), (&PySet_Type), 1, "unrunnable", 1))) __PYX_ERR(0, 1610, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState___init__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_aliases, __pyx_v_clients, __pyx_v_workers, __pyx_v_host_info, __pyx_v_resources, __pyx_v_tasks, __pyx_v_unrunnable, __pyx_v_validate, __pyx_v_kwargs); /* "distributed/scheduler.py":1602 * _workers_dv: dict * * def __init__( # <<<<<<<<<<<<<< * self, * aliases: dict = None, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_14SchedulerState___init__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_aliases, PyObject *__pyx_v_clients, PyObject *__pyx_v_workers, PyObject *__pyx_v_host_info, PyObject *__pyx_v_resources, PyObject *__pyx_v_tasks, PyObject *__pyx_v_unrunnable, int __pyx_v_validate, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; double __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":1614 * **kwargs, * ): * if aliases is not None: # <<<<<<<<<<<<<< * self._aliases = aliases * else: */ __pyx_t_1 = (__pyx_v_aliases != ((PyObject*)Py_None)); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":1615 * ): * if aliases is not None: * self._aliases = aliases # <<<<<<<<<<<<<< * else: * self._aliases = dict() */ __Pyx_INCREF(__pyx_v_aliases); __Pyx_GIVEREF(__pyx_v_aliases); __Pyx_GOTREF(__pyx_v_self->_aliases); __Pyx_DECREF(__pyx_v_self->_aliases); __pyx_v_self->_aliases = __pyx_v_aliases; /* "distributed/scheduler.py":1614 * **kwargs, * ): * if aliases is not None: # <<<<<<<<<<<<<< * self._aliases = aliases * else: */ goto __pyx_L3; } /* "distributed/scheduler.py":1617 * self._aliases = aliases * else: * self._aliases = dict() # <<<<<<<<<<<<<< * self._bandwidth = parse_bytes( * dask.config.get("distributed.scheduler.bandwidth") */ /*else*/ { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_aliases); __Pyx_DECREF(__pyx_v_self->_aliases); __pyx_v_self->_aliases = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "distributed/scheduler.py":1618 * else: * self._aliases = dict() * self._bandwidth = parse_bytes( # <<<<<<<<<<<<<< * dask.config.get("distributed.scheduler.bandwidth") * ) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":1619 * self._aliases = dict() * self._bandwidth = parse_bytes( * dask.config.get("distributed.scheduler.bandwidth") # <<<<<<<<<<<<<< * ) * if clients is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_dask); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_kp_u_distributed_scheduler_bandwidth) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_distributed_scheduler_bandwidth); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1618 * else: * self._aliases = dict() * self._bandwidth = parse_bytes( # <<<<<<<<<<<<<< * dask.config.get("distributed.scheduler.bandwidth") * ) */ __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->_bandwidth = __pyx_t_8; /* "distributed/scheduler.py":1621 * dask.config.get("distributed.scheduler.bandwidth") * ) * if clients is not None: # <<<<<<<<<<<<<< * self._clients = clients * else: */ __pyx_t_2 = (__pyx_v_clients != ((PyObject*)Py_None)); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":1622 * ) * if clients is not None: * self._clients = clients # <<<<<<<<<<<<<< * else: * self._clients = dict() */ __Pyx_INCREF(__pyx_v_clients); __Pyx_GIVEREF(__pyx_v_clients); __Pyx_GOTREF(__pyx_v_self->_clients); __Pyx_DECREF(__pyx_v_self->_clients); __pyx_v_self->_clients = __pyx_v_clients; /* "distributed/scheduler.py":1621 * dask.config.get("distributed.scheduler.bandwidth") * ) * if clients is not None: # <<<<<<<<<<<<<< * self._clients = clients * else: */ goto __pyx_L4; } /* "distributed/scheduler.py":1624 * self._clients = clients * else: * self._clients = dict() # <<<<<<<<<<<<<< * self._clients["fire-and-forget"] = ClientState("fire-and-forget") * self._extensions = dict() */ /*else*/ { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_clients); __Pyx_DECREF(__pyx_v_self->_clients); __pyx_v_self->_clients = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L4:; /* "distributed/scheduler.py":1625 * else: * self._clients = dict() * self._clients["fire-and-forget"] = ClientState("fire-and-forget") # <<<<<<<<<<<<<< * self._extensions = dict() * if host_info is not None: */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11distributed_9scheduler_ClientState), __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_v_self->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1625, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_self->_clients, __pyx_kp_u_fire_and_forget, __pyx_t_3) < 0)) __PYX_ERR(0, 1625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1626 * self._clients = dict() * self._clients["fire-and-forget"] = ClientState("fire-and-forget") * self._extensions = dict() # <<<<<<<<<<<<<< * if host_info is not None: * self._host_info = host_info */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_extensions); __Pyx_DECREF(__pyx_v_self->_extensions); __pyx_v_self->_extensions = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1627 * self._clients["fire-and-forget"] = ClientState("fire-and-forget") * self._extensions = dict() * if host_info is not None: # <<<<<<<<<<<<<< * self._host_info = host_info * else: */ __pyx_t_1 = (__pyx_v_host_info != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":1628 * self._extensions = dict() * if host_info is not None: * self._host_info = host_info # <<<<<<<<<<<<<< * else: * self._host_info = defaultdict(dict) */ __Pyx_INCREF(__pyx_v_host_info); __Pyx_GIVEREF(__pyx_v_host_info); __Pyx_GOTREF(__pyx_v_self->_host_info); __Pyx_DECREF(__pyx_v_self->_host_info); __pyx_v_self->_host_info = __pyx_v_host_info; /* "distributed/scheduler.py":1627 * self._clients["fire-and-forget"] = ClientState("fire-and-forget") * self._extensions = dict() * if host_info is not None: # <<<<<<<<<<<<<< * self._host_info = host_info * else: */ goto __pyx_L5; } /* "distributed/scheduler.py":1630 * self._host_info = host_info * else: * self._host_info = defaultdict(dict) # <<<<<<<<<<<<<< * self._idle = sortedcontainers.SortedDict() * self._idle_dv: dict = cast(dict, self._idle) */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyDict_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyDict_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_host_info); __Pyx_DECREF(__pyx_v_self->_host_info); __pyx_v_self->_host_info = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L5:; /* "distributed/scheduler.py":1631 * else: * self._host_info = defaultdict(dict) * self._idle = sortedcontainers.SortedDict() # <<<<<<<<<<<<<< * self._idle_dv: dict = cast(dict, self._idle) * self._n_tasks = 0 */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sortedcontainers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_SortedDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_idle); __Pyx_DECREF(__pyx_v_self->_idle); __pyx_v_self->_idle = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":1632 * self._host_info = defaultdict(dict) * self._idle = sortedcontainers.SortedDict() * self._idle_dv: dict = cast(dict, self._idle) # <<<<<<<<<<<<<< * self._n_tasks = 0 * if resources is not None: */ __pyx_t_3 = __pyx_v_self->_idle; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_idle_dv); __Pyx_DECREF(__pyx_v_self->_idle_dv); __pyx_v_self->_idle_dv = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1633 * self._idle = sortedcontainers.SortedDict() * self._idle_dv: dict = cast(dict, self._idle) * self._n_tasks = 0 # <<<<<<<<<<<<<< * if resources is not None: * self._resources = resources */ __pyx_v_self->_n_tasks = 0; /* "distributed/scheduler.py":1634 * self._idle_dv: dict = cast(dict, self._idle) * self._n_tasks = 0 * if resources is not None: # <<<<<<<<<<<<<< * self._resources = resources * else: */ __pyx_t_2 = (__pyx_v_resources != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":1635 * self._n_tasks = 0 * if resources is not None: * self._resources = resources # <<<<<<<<<<<<<< * else: * self._resources = defaultdict(dict) */ __Pyx_INCREF(__pyx_v_resources); __Pyx_GIVEREF(__pyx_v_resources); __Pyx_GOTREF(__pyx_v_self->_resources); __Pyx_DECREF(__pyx_v_self->_resources); __pyx_v_self->_resources = __pyx_v_resources; /* "distributed/scheduler.py":1634 * self._idle_dv: dict = cast(dict, self._idle) * self._n_tasks = 0 * if resources is not None: # <<<<<<<<<<<<<< * self._resources = resources * else: */ goto __pyx_L6; } /* "distributed/scheduler.py":1637 * self._resources = resources * else: * self._resources = defaultdict(dict) # <<<<<<<<<<<<<< * self._saturated = set() * if tasks is not None: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)(&PyDict_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)(&PyDict_Type))); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_resources); __Pyx_DECREF(__pyx_v_self->_resources); __pyx_v_self->_resources = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L6:; /* "distributed/scheduler.py":1638 * else: * self._resources = defaultdict(dict) * self._saturated = set() # <<<<<<<<<<<<<< * if tasks is not None: * self._tasks = tasks */ __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_saturated); __Pyx_DECREF(__pyx_v_self->_saturated); __pyx_v_self->_saturated = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1639 * self._resources = defaultdict(dict) * self._saturated = set() * if tasks is not None: # <<<<<<<<<<<<<< * self._tasks = tasks * else: */ __pyx_t_1 = (__pyx_v_tasks != ((PyObject*)Py_None)); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":1640 * self._saturated = set() * if tasks is not None: * self._tasks = tasks # <<<<<<<<<<<<<< * else: * self._tasks = dict() */ __Pyx_INCREF(__pyx_v_tasks); __Pyx_GIVEREF(__pyx_v_tasks); __Pyx_GOTREF(__pyx_v_self->_tasks); __Pyx_DECREF(__pyx_v_self->_tasks); __pyx_v_self->_tasks = __pyx_v_tasks; /* "distributed/scheduler.py":1639 * self._resources = defaultdict(dict) * self._saturated = set() * if tasks is not None: # <<<<<<<<<<<<<< * self._tasks = tasks * else: */ goto __pyx_L7; } /* "distributed/scheduler.py":1642 * self._tasks = tasks * else: * self._tasks = dict() # <<<<<<<<<<<<<< * self._task_groups = dict() * self._task_prefixes = dict() */ /*else*/ { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_tasks); __Pyx_DECREF(__pyx_v_self->_tasks); __pyx_v_self->_tasks = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L7:; /* "distributed/scheduler.py":1643 * else: * self._tasks = dict() * self._task_groups = dict() # <<<<<<<<<<<<<< * self._task_prefixes = dict() * self._task_metadata = dict() */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_task_groups); __Pyx_DECREF(__pyx_v_self->_task_groups); __pyx_v_self->_task_groups = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1644 * self._tasks = dict() * self._task_groups = dict() * self._task_prefixes = dict() # <<<<<<<<<<<<<< * self._task_metadata = dict() * self._total_nthreads = 0 */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_task_prefixes); __Pyx_DECREF(__pyx_v_self->_task_prefixes); __pyx_v_self->_task_prefixes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1645 * self._task_groups = dict() * self._task_prefixes = dict() * self._task_metadata = dict() # <<<<<<<<<<<<<< * self._total_nthreads = 0 * self._total_occupancy = 0 */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_task_metadata); __Pyx_DECREF(__pyx_v_self->_task_metadata); __pyx_v_self->_task_metadata = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1646 * self._task_prefixes = dict() * self._task_metadata = dict() * self._total_nthreads = 0 # <<<<<<<<<<<<<< * self._total_occupancy = 0 * self._unknown_durations = defaultdict(set) */ __pyx_v_self->_total_nthreads = 0; /* "distributed/scheduler.py":1647 * self._task_metadata = dict() * self._total_nthreads = 0 * self._total_occupancy = 0 # <<<<<<<<<<<<<< * self._unknown_durations = defaultdict(set) * if unrunnable is not None: */ __pyx_v_self->_total_occupancy = 0.0; /* "distributed/scheduler.py":1648 * self._total_nthreads = 0 * self._total_occupancy = 0 * self._unknown_durations = defaultdict(set) # <<<<<<<<<<<<<< * if unrunnable is not None: * self._unrunnable = unrunnable */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)(&PySet_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)(&PySet_Type))); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_unknown_durations); __Pyx_DECREF(__pyx_v_self->_unknown_durations); __pyx_v_self->_unknown_durations = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":1649 * self._total_occupancy = 0 * self._unknown_durations = defaultdict(set) * if unrunnable is not None: # <<<<<<<<<<<<<< * self._unrunnable = unrunnable * else: */ __pyx_t_2 = (__pyx_v_unrunnable != ((PyObject*)Py_None)); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":1650 * self._unknown_durations = defaultdict(set) * if unrunnable is not None: * self._unrunnable = unrunnable # <<<<<<<<<<<<<< * else: * self._unrunnable = set() */ __Pyx_INCREF(__pyx_v_unrunnable); __Pyx_GIVEREF(__pyx_v_unrunnable); __Pyx_GOTREF(__pyx_v_self->_unrunnable); __Pyx_DECREF(__pyx_v_self->_unrunnable); __pyx_v_self->_unrunnable = __pyx_v_unrunnable; /* "distributed/scheduler.py":1649 * self._total_occupancy = 0 * self._unknown_durations = defaultdict(set) * if unrunnable is not None: # <<<<<<<<<<<<<< * self._unrunnable = unrunnable * else: */ goto __pyx_L8; } /* "distributed/scheduler.py":1652 * self._unrunnable = unrunnable * else: * self._unrunnable = set() # <<<<<<<<<<<<<< * self._validate = validate * if workers is not None: */ /*else*/ { __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_unrunnable); __Pyx_DECREF(__pyx_v_self->_unrunnable); __pyx_v_self->_unrunnable = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; /* "distributed/scheduler.py":1653 * else: * self._unrunnable = set() * self._validate = validate # <<<<<<<<<<<<<< * if workers is not None: * self._workers = workers */ __pyx_v_self->_validate = __pyx_v_validate; /* "distributed/scheduler.py":1654 * self._unrunnable = set() * self._validate = validate * if workers is not None: # <<<<<<<<<<<<<< * self._workers = workers * else: */ __pyx_t_1 = (__pyx_v_workers != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":1655 * self._validate = validate * if workers is not None: * self._workers = workers # <<<<<<<<<<<<<< * else: * self._workers = sortedcontainers.SortedDict() */ __Pyx_INCREF(__pyx_v_workers); __Pyx_GIVEREF(__pyx_v_workers); __Pyx_GOTREF(__pyx_v_self->_workers); __Pyx_DECREF(__pyx_v_self->_workers); __pyx_v_self->_workers = __pyx_v_workers; /* "distributed/scheduler.py":1654 * self._unrunnable = set() * self._validate = validate * if workers is not None: # <<<<<<<<<<<<<< * self._workers = workers * else: */ goto __pyx_L9; } /* "distributed/scheduler.py":1657 * self._workers = workers * else: * self._workers = sortedcontainers.SortedDict() # <<<<<<<<<<<<<< * self._workers_dv: dict = cast(dict, self._workers) * super().__init__(**kwargs) */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sortedcontainers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_SortedDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_workers); __Pyx_DECREF(__pyx_v_self->_workers); __pyx_v_self->_workers = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L9:; /* "distributed/scheduler.py":1658 * else: * self._workers = sortedcontainers.SortedDict() * self._workers_dv: dict = cast(dict, self._workers) # <<<<<<<<<<<<<< * super().__init__(**kwargs) * */ __pyx_t_3 = __pyx_v_self->_workers; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_workers_dv); __Pyx_DECREF(__pyx_v_self->_workers_dv); __pyx_v_self->_workers_dv = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1659 * self._workers = sortedcontainers.SortedDict() * self._workers_dv: dict = cast(dict, self._workers) * super().__init__(**kwargs) # <<<<<<<<<<<<<< * * @property */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_ptype_11distributed_9scheduler_SchedulerState)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_11distributed_9scheduler_SchedulerState)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_11distributed_9scheduler_SchedulerState)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self)); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1602 * _workers_dv: dict * * def __init__( # <<<<<<<<<<<<<< * self, * aliases: dict = None, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1662 * * @property * def aliases(self): # <<<<<<<<<<<<<< * return self._aliases * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7aliases_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7aliases_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_7aliases___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_7aliases___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1663 * @property * def aliases(self): * return self._aliases # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_aliases); __pyx_r = __pyx_v_self->_aliases; goto __pyx_L0; /* "distributed/scheduler.py":1662 * * @property * def aliases(self): # <<<<<<<<<<<<<< * return self._aliases * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1666 * * @property * def bandwidth(self): # <<<<<<<<<<<<<< * return self._bandwidth * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9bandwidth_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9bandwidth_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_9bandwidth___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9bandwidth___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1667 * @property * def bandwidth(self): * return self._bandwidth # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_bandwidth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1666 * * @property * def bandwidth(self): # <<<<<<<<<<<<<< * return self._bandwidth * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.bandwidth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1670 * * @property * def clients(self): # <<<<<<<<<<<<<< * return self._clients * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7clients_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7clients_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_7clients___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_7clients___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1671 * @property * def clients(self): * return self._clients # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_clients); __pyx_r = __pyx_v_self->_clients; goto __pyx_L0; /* "distributed/scheduler.py":1670 * * @property * def clients(self): # <<<<<<<<<<<<<< * return self._clients * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1674 * * @property * def extensions(self): # <<<<<<<<<<<<<< * return self._extensions * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_10extensions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_10extensions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_10extensions___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_10extensions___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1675 * @property * def extensions(self): * return self._extensions # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_extensions); __pyx_r = __pyx_v_self->_extensions; goto __pyx_L0; /* "distributed/scheduler.py":1674 * * @property * def extensions(self): # <<<<<<<<<<<<<< * return self._extensions * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1678 * * @property * def host_info(self): # <<<<<<<<<<<<<< * return self._host_info * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9host_info_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9host_info_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_9host_info___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9host_info___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1679 * @property * def host_info(self): * return self._host_info # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_host_info); __pyx_r = __pyx_v_self->_host_info; goto __pyx_L0; /* "distributed/scheduler.py":1678 * * @property * def host_info(self): # <<<<<<<<<<<<<< * return self._host_info * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1682 * * @property * def idle(self): # <<<<<<<<<<<<<< * return self._idle * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_4idle_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_4idle_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_4idle___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_4idle___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1683 * @property * def idle(self): * return self._idle # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_idle); __pyx_r = __pyx_v_self->_idle; goto __pyx_L0; /* "distributed/scheduler.py":1682 * * @property * def idle(self): # <<<<<<<<<<<<<< * return self._idle * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1686 * * @property * def n_tasks(self): # <<<<<<<<<<<<<< * return self._n_tasks * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7n_tasks_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7n_tasks_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_7n_tasks___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_7n_tasks___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1687 * @property * def n_tasks(self): * return self._n_tasks # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_n_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1686 * * @property * def n_tasks(self): # <<<<<<<<<<<<<< * return self._n_tasks * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.n_tasks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1690 * * @property * def resources(self): # <<<<<<<<<<<<<< * return self._resources * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9resources_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9resources_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_9resources___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9resources___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1691 * @property * def resources(self): * return self._resources # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_resources); __pyx_r = __pyx_v_self->_resources; goto __pyx_L0; /* "distributed/scheduler.py":1690 * * @property * def resources(self): # <<<<<<<<<<<<<< * return self._resources * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1694 * * @property * def saturated(self): # <<<<<<<<<<<<<< * return self._saturated * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9saturated_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9saturated_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_9saturated___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9saturated___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1695 * @property * def saturated(self): * return self._saturated # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_saturated); __pyx_r = __pyx_v_self->_saturated; goto __pyx_L0; /* "distributed/scheduler.py":1694 * * @property * def saturated(self): # <<<<<<<<<<<<<< * return self._saturated * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1698 * * @property * def tasks(self): # <<<<<<<<<<<<<< * return self._tasks * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_5tasks_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_5tasks_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_5tasks___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_5tasks___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1699 * @property * def tasks(self): * return self._tasks # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_tasks); __pyx_r = __pyx_v_self->_tasks; goto __pyx_L0; /* "distributed/scheduler.py":1698 * * @property * def tasks(self): # <<<<<<<<<<<<<< * return self._tasks * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1702 * * @property * def task_groups(self): # <<<<<<<<<<<<<< * return self._task_groups * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_11task_groups_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_11task_groups_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_11task_groups___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_11task_groups___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1703 * @property * def task_groups(self): * return self._task_groups # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_task_groups); __pyx_r = __pyx_v_self->_task_groups; goto __pyx_L0; /* "distributed/scheduler.py":1702 * * @property * def task_groups(self): # <<<<<<<<<<<<<< * return self._task_groups * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1706 * * @property * def task_prefixes(self): # <<<<<<<<<<<<<< * return self._task_prefixes * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_13task_prefixes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_13task_prefixes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_13task_prefixes___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_13task_prefixes___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1707 * @property * def task_prefixes(self): * return self._task_prefixes # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_task_prefixes); __pyx_r = __pyx_v_self->_task_prefixes; goto __pyx_L0; /* "distributed/scheduler.py":1706 * * @property * def task_prefixes(self): # <<<<<<<<<<<<<< * return self._task_prefixes * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1710 * * @property * def task_metadata(self): # <<<<<<<<<<<<<< * return self._task_metadata * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_13task_metadata_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_13task_metadata_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_13task_metadata___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_13task_metadata___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1711 * @property * def task_metadata(self): * return self._task_metadata # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_task_metadata); __pyx_r = __pyx_v_self->_task_metadata; goto __pyx_L0; /* "distributed/scheduler.py":1710 * * @property * def task_metadata(self): # <<<<<<<<<<<<<< * return self._task_metadata * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1714 * * @property * def total_nthreads(self): # <<<<<<<<<<<<<< * return self._total_nthreads * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_14total_nthreads_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_14total_nthreads_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_14total_nthreads___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_14total_nthreads___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1715 * @property * def total_nthreads(self): * return self._total_nthreads # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_total_nthreads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1714 * * @property * def total_nthreads(self): # <<<<<<<<<<<<<< * return self._total_nthreads * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.total_nthreads.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1718 * * @property * def total_occupancy(self): # <<<<<<<<<<<<<< * return self._total_occupancy * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_15total_occupancy_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_15total_occupancy_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_15total_occupancy___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_15total_occupancy___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1719 * @property * def total_occupancy(self): * return self._total_occupancy # <<<<<<<<<<<<<< * * @total_occupancy.setter */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_total_occupancy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1718 * * @property * def total_occupancy(self): # <<<<<<<<<<<<<< * return self._total_occupancy * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.total_occupancy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1722 * * @total_occupancy.setter * def total_occupancy(self, v: double): # <<<<<<<<<<<<<< * self._total_occupancy = v * */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_14SchedulerState_15total_occupancy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ static int __pyx_pw_11distributed_9scheduler_14SchedulerState_15total_occupancy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { double __pyx_v_v; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_v); { __pyx_v_v = __pyx_PyFloat_AsDouble(__pyx_arg_v); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1722, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.total_occupancy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_15total_occupancy_2__set__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((double)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_14SchedulerState_15total_occupancy_2__set__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, double __pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); /* "distributed/scheduler.py":1723 * @total_occupancy.setter * def total_occupancy(self, v: double): * self._total_occupancy = v # <<<<<<<<<<<<<< * * @property */ __pyx_v_self->_total_occupancy = __pyx_v_v; /* "distributed/scheduler.py":1722 * * @total_occupancy.setter * def total_occupancy(self, v: double): # <<<<<<<<<<<<<< * self._total_occupancy = v * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1726 * * @property * def unknown_durations(self): # <<<<<<<<<<<<<< * return self._unknown_durations * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_17unknown_durations_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_17unknown_durations_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_17unknown_durations___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_17unknown_durations___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1727 * @property * def unknown_durations(self): * return self._unknown_durations # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_unknown_durations); __pyx_r = __pyx_v_self->_unknown_durations; goto __pyx_L0; /* "distributed/scheduler.py":1726 * * @property * def unknown_durations(self): # <<<<<<<<<<<<<< * return self._unknown_durations * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1730 * * @property * def unrunnable(self): # <<<<<<<<<<<<<< * return self._unrunnable * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_10unrunnable_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_10unrunnable_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_10unrunnable___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_10unrunnable___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1731 * @property * def unrunnable(self): * return self._unrunnable # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_unrunnable); __pyx_r = __pyx_v_self->_unrunnable; goto __pyx_L0; /* "distributed/scheduler.py":1730 * * @property * def unrunnable(self): # <<<<<<<<<<<<<< * return self._unrunnable * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1734 * * @property * def validate(self): # <<<<<<<<<<<<<< * return self._validate * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_8validate_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_8validate_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_8validate___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_8validate___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1735 * @property * def validate(self): * return self._validate # <<<<<<<<<<<<<< * * @validate.setter */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_validate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1734 * * @property * def validate(self): # <<<<<<<<<<<<<< * return self._validate * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.validate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1738 * * @validate.setter * def validate(self, v: bint): # <<<<<<<<<<<<<< * self._validate = v * */ /* Python wrapper */ static int __pyx_pw_11distributed_9scheduler_14SchedulerState_8validate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ static int __pyx_pw_11distributed_9scheduler_14SchedulerState_8validate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { int __pyx_v_v; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_v); { __pyx_v_v = __Pyx_PyObject_IsTrue(__pyx_arg_v); if (unlikely((__pyx_v_v == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1738, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.validate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_8validate_2__set__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((int)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11distributed_9scheduler_14SchedulerState_8validate_2__set__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, int __pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); /* "distributed/scheduler.py":1739 * @validate.setter * def validate(self, v: bint): * self._validate = v # <<<<<<<<<<<<<< * * @property */ __pyx_v_self->_validate = __pyx_v_v; /* "distributed/scheduler.py":1738 * * @validate.setter * def validate(self, v: bint): # <<<<<<<<<<<<<< * self._validate = v * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1742 * * @property * def workers(self): # <<<<<<<<<<<<<< * return self._workers * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7workers_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7workers_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_7workers___get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_7workers___get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1743 * @property * def workers(self): * return self._workers # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_workers); __pyx_r = __pyx_v_self->_workers; goto __pyx_L0; /* "distributed/scheduler.py":1742 * * @property * def workers(self): # <<<<<<<<<<<<<< * return self._workers * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1746 * * @property * def __pdict__(self): # <<<<<<<<<<<<<< * return { * "bandwidth": self._bandwidth, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9__pdict___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9__pdict___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_9__pdict_____get__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_9__pdict_____get__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "distributed/scheduler.py":1747 * @property * def __pdict__(self): * return { # <<<<<<<<<<<<<< * "bandwidth": self._bandwidth, * "resources": self._resources, */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":1748 * def __pdict__(self): * return { * "bandwidth": self._bandwidth, # <<<<<<<<<<<<<< * "resources": self._resources, * "saturated": self._saturated, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_bandwidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bandwidth, __pyx_t_2) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1749 * return { * "bandwidth": self._bandwidth, * "resources": self._resources, # <<<<<<<<<<<<<< * "saturated": self._saturated, * "unrunnable": self._unrunnable, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_resources, __pyx_v_self->_resources) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1750 * "bandwidth": self._bandwidth, * "resources": self._resources, * "saturated": self._saturated, # <<<<<<<<<<<<<< * "unrunnable": self._unrunnable, * "n_tasks": self._n_tasks, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_saturated, __pyx_v_self->_saturated) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1751 * "resources": self._resources, * "saturated": self._saturated, * "unrunnable": self._unrunnable, # <<<<<<<<<<<<<< * "n_tasks": self._n_tasks, * "unknown_durations": self._unknown_durations, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_unrunnable, __pyx_v_self->_unrunnable) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1752 * "saturated": self._saturated, * "unrunnable": self._unrunnable, * "n_tasks": self._n_tasks, # <<<<<<<<<<<<<< * "unknown_durations": self._unknown_durations, * "validate": self._validate, */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_n_tasks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_n_tasks, __pyx_t_2) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1753 * "unrunnable": self._unrunnable, * "n_tasks": self._n_tasks, * "unknown_durations": self._unknown_durations, # <<<<<<<<<<<<<< * "validate": self._validate, * "tasks": self._tasks, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_unknown_durations, __pyx_v_self->_unknown_durations) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1754 * "n_tasks": self._n_tasks, * "unknown_durations": self._unknown_durations, * "validate": self._validate, # <<<<<<<<<<<<<< * "tasks": self._tasks, * "task_groups": self._task_groups, */ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_validate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_validate, __pyx_t_2) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1755 * "unknown_durations": self._unknown_durations, * "validate": self._validate, * "tasks": self._tasks, # <<<<<<<<<<<<<< * "task_groups": self._task_groups, * "task_prefixes": self._task_prefixes, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tasks, __pyx_v_self->_tasks) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1756 * "validate": self._validate, * "tasks": self._tasks, * "task_groups": self._task_groups, # <<<<<<<<<<<<<< * "task_prefixes": self._task_prefixes, * "total_nthreads": self._total_nthreads, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_task_groups, __pyx_v_self->_task_groups) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1757 * "tasks": self._tasks, * "task_groups": self._task_groups, * "task_prefixes": self._task_prefixes, # <<<<<<<<<<<<<< * "total_nthreads": self._total_nthreads, * "total_occupancy": self._total_occupancy, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_task_prefixes, __pyx_v_self->_task_prefixes) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1758 * "task_groups": self._task_groups, * "task_prefixes": self._task_prefixes, * "total_nthreads": self._total_nthreads, # <<<<<<<<<<<<<< * "total_occupancy": self._total_occupancy, * "extensions": self._extensions, */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_total_nthreads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_total_nthreads, __pyx_t_2) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1759 * "task_prefixes": self._task_prefixes, * "total_nthreads": self._total_nthreads, * "total_occupancy": self._total_occupancy, # <<<<<<<<<<<<<< * "extensions": self._extensions, * "clients": self._clients, */ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_total_occupancy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_total_occupancy, __pyx_t_2) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":1760 * "total_nthreads": self._total_nthreads, * "total_occupancy": self._total_occupancy, * "extensions": self._extensions, # <<<<<<<<<<<<<< * "clients": self._clients, * "workers": self._workers, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_extensions, __pyx_v_self->_extensions) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1761 * "total_occupancy": self._total_occupancy, * "extensions": self._extensions, * "clients": self._clients, # <<<<<<<<<<<<<< * "workers": self._workers, * "idle": self._idle, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_clients, __pyx_v_self->_clients) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1762 * "extensions": self._extensions, * "clients": self._clients, * "workers": self._workers, # <<<<<<<<<<<<<< * "idle": self._idle, * "host_info": self._host_info, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_workers, __pyx_v_self->_workers) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1763 * "clients": self._clients, * "workers": self._workers, * "idle": self._idle, # <<<<<<<<<<<<<< * "host_info": self._host_info, * } */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_idle, __pyx_v_self->_idle) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) /* "distributed/scheduler.py":1764 * "workers": self._workers, * "idle": self._idle, * "host_info": self._host_info, # <<<<<<<<<<<<<< * } * */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_host_info, __pyx_v_self->_host_info) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":1746 * * @property * def __pdict__(self): # <<<<<<<<<<<<<< * return { * "bandwidth": self._bandwidth, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.__pdict__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1767 * } * * def transition_released_waiting(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_3transition_released_waiting(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_3transition_released_waiting(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_released_waiting (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_2transition_released_waiting(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_2transition_released_waiting(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_dep = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr20__pyx_v_dts = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr21__pyx_v_dts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; char const *__pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_released_waiting", 0); /* "distributed/scheduler.py":1768 * * def transition_released_waiting(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":1769 * def transition_released_waiting(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * worker_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1769, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1769, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1769, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1771 * ts: TaskState = self._tasks[key] * dts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1771, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1772 * dts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1772, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1774 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts._run_spec * assert not ts._waiting_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1775 * * if self._validate: * assert ts._run_spec # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1775, __pyx_L3_error) if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1775, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1776 * if self._validate: * assert ts._run_spec * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._processing_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1776, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1777 * assert ts._run_spec * assert not ts._waiting_on * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not any([dts._state == "forgotten" for dts in ts._dependencies]) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1777, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1778 * assert not ts._waiting_on * assert not ts._who_has * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not any([dts._state == "forgotten" for dts in ts._dependencies]) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1778, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1778, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1779 * assert not ts._who_has * assert not ts._processing_on * assert not any([dts._state == "forgotten" for dts in ts._dependencies]) # <<<<<<<<<<<<<< * * if ts._has_lost_dependencies: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1779, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1779, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_10; __pyx_t_10 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_10, __pyx_t_9); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1779, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_10); if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1779, __pyx_L12_error) __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_10)); __pyx_t_10 = 0; __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_9genexpr20__pyx_v_dts->_state, __pyx_n_u_forgotten, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1779, __pyx_L12_error) __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1779, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_10); if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1779, __pyx_L12_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr20__pyx_v_dts); __pyx_9genexpr20__pyx_v_dts = 0; goto __pyx_L15_exit_scope; __pyx_L12_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr20__pyx_v_dts); __pyx_9genexpr20__pyx_v_dts = 0; goto __pyx_L3_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1779, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1779, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1779, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1774 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts._run_spec * assert not ts._waiting_on */ } /* "distributed/scheduler.py":1781 * assert not any([dts._state == "forgotten" for dts in ts._dependencies]) * * if ts._has_lost_dependencies: # <<<<<<<<<<<<<< * return {key: "forgotten"}, worker_msgs, client_msgs * */ __pyx_t_5 = (__pyx_v_ts->_has_lost_dependencies != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1782 * * if ts._has_lost_dependencies: * return {key: "forgotten"}, worker_msgs, client_msgs # <<<<<<<<<<<<<< * * ts.state = "waiting" */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1782, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_v_key, __pyx_n_u_forgotten) < 0) __PYX_ERR(0, 1782, __pyx_L3_error) __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1782, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":1781 * assert not any([dts._state == "forgotten" for dts in ts._dependencies]) * * if ts._has_lost_dependencies: # <<<<<<<<<<<<<< * return {key: "forgotten"}, worker_msgs, client_msgs * */ } /* "distributed/scheduler.py":1784 * return {key: "forgotten"}, worker_msgs, client_msgs * * ts.state = "waiting" # <<<<<<<<<<<<<< * * recommendations: dict = {} */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_waiting) < 0) __PYX_ERR(0, 1784, __pyx_L3_error) /* "distributed/scheduler.py":1786 * ts.state = "waiting" * * recommendations: dict = {} # <<<<<<<<<<<<<< * * dts: TaskState */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_recommendations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1789 * * dts: TaskState * for dts in ts._dependencies: # <<<<<<<<<<<<<< * if dts._exception_blame: * ts._exception_blame = dts._exception_blame */ __pyx_t_8 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_7, &__pyx_t_8, &__pyx_t_6, __pyx_t_9); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1789, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1789, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":1790 * dts: TaskState * for dts in ts._dependencies: * if dts._exception_blame: # <<<<<<<<<<<<<< * ts._exception_blame = dts._exception_blame * recommendations[key] = "erred" */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dts->_exception_blame); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1790, __pyx_L3_error) if (__pyx_t_5) { /* "distributed/scheduler.py":1791 * for dts in ts._dependencies: * if dts._exception_blame: * ts._exception_blame = dts._exception_blame # <<<<<<<<<<<<<< * recommendations[key] = "erred" * return recommendations, worker_msgs, client_msgs */ __pyx_t_6 = __pyx_v_dts->_exception_blame; __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_ts->_exception_blame); __Pyx_DECREF(__pyx_v_ts->_exception_blame); __pyx_v_ts->_exception_blame = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":1792 * if dts._exception_blame: * ts._exception_blame = dts._exception_blame * recommendations[key] = "erred" # <<<<<<<<<<<<<< * return recommendations, worker_msgs, client_msgs * */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_erred) < 0)) __PYX_ERR(0, 1792, __pyx_L3_error) /* "distributed/scheduler.py":1793 * ts._exception_blame = dts._exception_blame * recommendations[key] = "erred" * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * * for dts in ts._dependencies: */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1793, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":1790 * dts: TaskState * for dts in ts._dependencies: * if dts._exception_blame: # <<<<<<<<<<<<<< * ts._exception_blame = dts._exception_blame * recommendations[key] = "erred" */ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1795 * return recommendations, worker_msgs, client_msgs * * for dts in ts._dependencies: # <<<<<<<<<<<<<< * dep = dts._key * if not dts._who_has: */ __pyx_t_7 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1795, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_8, &__pyx_t_7, &__pyx_t_6, __pyx_t_9); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1795, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1795, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":1796 * * for dts in ts._dependencies: * dep = dts._key # <<<<<<<<<<<<<< * if not dts._who_has: * ts._waiting_on.add(dts) */ __pyx_t_6 = __pyx_v_dts->_key; __Pyx_INCREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_dep, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":1797 * for dts in ts._dependencies: * dep = dts._key * if not dts._who_has: # <<<<<<<<<<<<<< * ts._waiting_on.add(dts) * if dts._state == "released": */ __pyx_t_5 = (__pyx_v_dts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_has) != 0); __pyx_t_12 = ((!__pyx_t_5) != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":1798 * dep = dts._key * if not dts._who_has: * ts._waiting_on.add(dts) # <<<<<<<<<<<<<< * if dts._state == "released": * recommendations[dep] = "waiting" */ if (unlikely(__pyx_v_ts->_waiting_on == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1798, __pyx_L3_error) } __pyx_t_13 = PySet_Add(__pyx_v_ts->_waiting_on, ((PyObject *)__pyx_v_dts)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1798, __pyx_L3_error) /* "distributed/scheduler.py":1797 * for dts in ts._dependencies: * dep = dts._key * if not dts._who_has: # <<<<<<<<<<<<<< * ts._waiting_on.add(dts) * if dts._state == "released": */ } /* "distributed/scheduler.py":1799 * if not dts._who_has: * ts._waiting_on.add(dts) * if dts._state == "released": # <<<<<<<<<<<<<< * recommendations[dep] = "waiting" * else: */ __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_dts->_state, __pyx_n_u_released, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1799, __pyx_L3_error) __pyx_t_5 = (__pyx_t_12 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1800 * ts._waiting_on.add(dts) * if dts._state == "released": * recommendations[dep] = "waiting" # <<<<<<<<<<<<<< * else: * dts._waiters.add(ts) */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dep, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 1800, __pyx_L3_error) /* "distributed/scheduler.py":1799 * if not dts._who_has: * ts._waiting_on.add(dts) * if dts._state == "released": # <<<<<<<<<<<<<< * recommendations[dep] = "waiting" * else: */ goto __pyx_L23; } /* "distributed/scheduler.py":1802 * recommendations[dep] = "waiting" * else: * dts._waiters.add(ts) # <<<<<<<<<<<<<< * * ts._waiters = {dts for dts in ts._dependents if dts._state == "waiting"} */ /*else*/ { if (unlikely(__pyx_v_dts->_waiters == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1802, __pyx_L3_error) } __pyx_t_13 = PySet_Add(__pyx_v_dts->_waiters, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1802, __pyx_L3_error) } __pyx_L23:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1804 * dts._waiters.add(ts) * * ts._waiters = {dts for dts in ts._dependents if dts._state == "waiting"} # <<<<<<<<<<<<<< * * if not ts._waiting_on: */ { /* enter inner scope */ __pyx_t_4 = PySet_New(NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1804, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_10 = __Pyx_set_iterator(__pyx_v_ts->_dependents, 1, (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1804, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_10; __pyx_t_10 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_10, __pyx_t_9); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1804, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_10); if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1804, __pyx_L26_error) __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_10)); __pyx_t_10 = 0; __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_9genexpr21__pyx_v_dts->_state, __pyx_n_u_waiting, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1804, __pyx_L26_error) __pyx_t_12 = (__pyx_t_5 != 0); if (__pyx_t_12) { if (unlikely(PySet_Add(__pyx_t_4, (PyObject*)__pyx_9genexpr21__pyx_v_dts))) __PYX_ERR(0, 1804, __pyx_L26_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr21__pyx_v_dts); __pyx_9genexpr21__pyx_v_dts = 0; goto __pyx_L30_exit_scope; __pyx_L26_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr21__pyx_v_dts); __pyx_9genexpr21__pyx_v_dts = 0; goto __pyx_L3_error; __pyx_L30_exit_scope:; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_ts->_waiters); __Pyx_DECREF(__pyx_v_ts->_waiters); __pyx_v_ts->_waiters = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1806 * ts._waiters = {dts for dts in ts._dependents if dts._state == "waiting"} * * if not ts._waiting_on: # <<<<<<<<<<<<<< * if self._workers_dv: * recommendations[key] = "processing" */ __pyx_t_12 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); __pyx_t_5 = ((!__pyx_t_12) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1807 * * if not ts._waiting_on: * if self._workers_dv: # <<<<<<<<<<<<<< * recommendations[key] = "processing" * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_workers_dv); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1807, __pyx_L3_error) if (__pyx_t_5) { /* "distributed/scheduler.py":1808 * if not ts._waiting_on: * if self._workers_dv: * recommendations[key] = "processing" # <<<<<<<<<<<<<< * else: * self._unrunnable.add(ts) */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_processing_2) < 0)) __PYX_ERR(0, 1808, __pyx_L3_error) /* "distributed/scheduler.py":1807 * * if not ts._waiting_on: * if self._workers_dv: # <<<<<<<<<<<<<< * recommendations[key] = "processing" * else: */ goto __pyx_L32; } /* "distributed/scheduler.py":1810 * recommendations[key] = "processing" * else: * self._unrunnable.add(ts) # <<<<<<<<<<<<<< * ts.state = "no-worker" * */ /*else*/ { if (unlikely(__pyx_v_self->_unrunnable == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1810, __pyx_L3_error) } __pyx_t_13 = PySet_Add(__pyx_v_self->_unrunnable, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1810, __pyx_L3_error) /* "distributed/scheduler.py":1811 * else: * self._unrunnable.add(ts) * ts.state = "no-worker" # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_kp_u_no_worker) < 0) __PYX_ERR(0, 1811, __pyx_L3_error) } __pyx_L32:; /* "distributed/scheduler.py":1806 * ts._waiters = {dts for dts in ts._dependents if dts._state == "waiting"} * * if not ts._waiting_on: # <<<<<<<<<<<<<< * if self._workers_dv: * recommendations[key] = "processing" */ } /* "distributed/scheduler.py":1813 * ts.state = "no-worker" * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1813, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":1768 * * def transition_released_waiting(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":1814 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_released_waiting", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 1814, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "distributed/scheduler.py":1815 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_logger); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1815, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_exception); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1815, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_15, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_v_e); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1815, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":1816 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1816, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1816, __pyx_L38_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":1817 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_14 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1817, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __pyx_v_pdb = __pyx_t_14; __pyx_t_14 = 0; /* "distributed/scheduler.py":1819 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1819, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_16); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1819, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":1816 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":1820 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_no_worker_waiting(self, key): */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_10); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_10 = 0; __PYX_ERR(0, 1820, __pyx_L38_error) } /* "distributed/scheduler.py":1814 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L38_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_9 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_17 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_17; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":1768 * * def transition_released_waiting(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":1767 * } * * def transition_released_waiting(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_released_waiting", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_dep); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XDECREF((PyObject *)__pyx_9genexpr20__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_9genexpr21__pyx_v_dts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1822 * raise * * def transition_no_worker_waiting(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_5transition_no_worker_waiting(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_5transition_no_worker_waiting(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_no_worker_waiting (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_4transition_no_worker_waiting(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_4transition_no_worker_waiting(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_dep = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; char const *__pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_no_worker_waiting", 0); /* "distributed/scheduler.py":1823 * * def transition_no_worker_waiting(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":1824 * def transition_no_worker_waiting(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * worker_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1824, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1824, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1824, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1826 * ts: TaskState = self._tasks[key] * dts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1826, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1827 * dts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1827, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1829 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts in self._unrunnable * assert not ts._waiting_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1830 * * if self._validate: * assert ts in self._unrunnable # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_self->_unrunnable == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1830, __pyx_L3_error) } __pyx_t_5 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_self->_unrunnable, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1830, __pyx_L3_error) if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1830, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1831 * if self._validate: * assert ts in self._unrunnable * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._processing_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1831, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1832 * assert ts in self._unrunnable * assert not ts._waiting_on * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._processing_on * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1832, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1833 * assert not ts._waiting_on * assert not ts._who_has * assert not ts._processing_on # <<<<<<<<<<<<<< * * self._unrunnable.remove(ts) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1833, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1833, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1829 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts in self._unrunnable * assert not ts._waiting_on */ } /* "distributed/scheduler.py":1835 * assert not ts._processing_on * * self._unrunnable.remove(ts) # <<<<<<<<<<<<<< * * if ts._has_lost_dependencies: */ if (unlikely(__pyx_v_self->_unrunnable == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 1835, __pyx_L3_error) } __pyx_t_6 = __Pyx_PySet_Remove(__pyx_v_self->_unrunnable, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1835, __pyx_L3_error) /* "distributed/scheduler.py":1837 * self._unrunnable.remove(ts) * * if ts._has_lost_dependencies: # <<<<<<<<<<<<<< * return {key: "forgotten"}, worker_msgs, client_msgs * */ __pyx_t_5 = (__pyx_v_ts->_has_lost_dependencies != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1838 * * if ts._has_lost_dependencies: * return {key: "forgotten"}, worker_msgs, client_msgs # <<<<<<<<<<<<<< * * recommendations: dict = {} */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1838, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_v_key, __pyx_n_u_forgotten) < 0) __PYX_ERR(0, 1838, __pyx_L3_error) __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1838, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_client_msgs); __pyx_t_4 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":1837 * self._unrunnable.remove(ts) * * if ts._has_lost_dependencies: # <<<<<<<<<<<<<< * return {key: "forgotten"}, worker_msgs, client_msgs * */ } /* "distributed/scheduler.py":1840 * return {key: "forgotten"}, worker_msgs, client_msgs * * recommendations: dict = {} # <<<<<<<<<<<<<< * * for dts in ts._dependencies: */ __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1840, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_recommendations = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":1842 * recommendations: dict = {} * * for dts in ts._dependencies: # <<<<<<<<<<<<<< * dep = dts._key * if not dts._who_has: */ __pyx_t_8 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1842, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_7, __pyx_t_9, &__pyx_t_8, &__pyx_t_4, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1842, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1842, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":1843 * * for dts in ts._dependencies: * dep = dts._key # <<<<<<<<<<<<<< * if not dts._who_has: * ts._waiting_on.add(dts) */ __pyx_t_4 = __pyx_v_dts->_key; __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dep, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":1844 * for dts in ts._dependencies: * dep = dts._key * if not dts._who_has: # <<<<<<<<<<<<<< * ts._waiting_on.add(dts) * if dts._state == "released": */ __pyx_t_5 = (__pyx_v_dts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_has) != 0); __pyx_t_12 = ((!__pyx_t_5) != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":1845 * dep = dts._key * if not dts._who_has: * ts._waiting_on.add(dts) # <<<<<<<<<<<<<< * if dts._state == "released": * recommendations[dep] = "waiting" */ if (unlikely(__pyx_v_ts->_waiting_on == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1845, __pyx_L3_error) } __pyx_t_6 = PySet_Add(__pyx_v_ts->_waiting_on, ((PyObject *)__pyx_v_dts)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1845, __pyx_L3_error) /* "distributed/scheduler.py":1844 * for dts in ts._dependencies: * dep = dts._key * if not dts._who_has: # <<<<<<<<<<<<<< * ts._waiting_on.add(dts) * if dts._state == "released": */ } /* "distributed/scheduler.py":1846 * if not dts._who_has: * ts._waiting_on.add(dts) * if dts._state == "released": # <<<<<<<<<<<<<< * recommendations[dep] = "waiting" * else: */ __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_dts->_state, __pyx_n_u_released, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1846, __pyx_L3_error) __pyx_t_5 = (__pyx_t_12 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1847 * ts._waiting_on.add(dts) * if dts._state == "released": * recommendations[dep] = "waiting" # <<<<<<<<<<<<<< * else: * dts._waiters.add(ts) */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dep, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 1847, __pyx_L3_error) /* "distributed/scheduler.py":1846 * if not dts._who_has: * ts._waiting_on.add(dts) * if dts._state == "released": # <<<<<<<<<<<<<< * recommendations[dep] = "waiting" * else: */ goto __pyx_L14; } /* "distributed/scheduler.py":1849 * recommendations[dep] = "waiting" * else: * dts._waiters.add(ts) # <<<<<<<<<<<<<< * * ts.state = "waiting" */ /*else*/ { if (unlikely(__pyx_v_dts->_waiters == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1849, __pyx_L3_error) } __pyx_t_6 = PySet_Add(__pyx_v_dts->_waiters, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1849, __pyx_L3_error) } __pyx_L14:; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":1851 * dts._waiters.add(ts) * * ts.state = "waiting" # <<<<<<<<<<<<<< * * if not ts._waiting_on: */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_waiting) < 0) __PYX_ERR(0, 1851, __pyx_L3_error) /* "distributed/scheduler.py":1853 * ts.state = "waiting" * * if not ts._waiting_on: # <<<<<<<<<<<<<< * if self._workers_dv: * recommendations[key] = "processing" */ __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); __pyx_t_12 = ((!__pyx_t_5) != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":1854 * * if not ts._waiting_on: * if self._workers_dv: # <<<<<<<<<<<<<< * recommendations[key] = "processing" * else: */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_self->_workers_dv); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1854, __pyx_L3_error) if (__pyx_t_12) { /* "distributed/scheduler.py":1855 * if not ts._waiting_on: * if self._workers_dv: * recommendations[key] = "processing" # <<<<<<<<<<<<<< * else: * self._unrunnable.add(ts) */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_processing_2) < 0)) __PYX_ERR(0, 1855, __pyx_L3_error) /* "distributed/scheduler.py":1854 * * if not ts._waiting_on: * if self._workers_dv: # <<<<<<<<<<<<<< * recommendations[key] = "processing" * else: */ goto __pyx_L16; } /* "distributed/scheduler.py":1857 * recommendations[key] = "processing" * else: * self._unrunnable.add(ts) # <<<<<<<<<<<<<< * ts.state = "no-worker" * */ /*else*/ { if (unlikely(__pyx_v_self->_unrunnable == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1857, __pyx_L3_error) } __pyx_t_6 = PySet_Add(__pyx_v_self->_unrunnable, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1857, __pyx_L3_error) /* "distributed/scheduler.py":1858 * else: * self._unrunnable.add(ts) * ts.state = "no-worker" # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_kp_u_no_worker) < 0) __PYX_ERR(0, 1858, __pyx_L3_error) } __pyx_L16:; /* "distributed/scheduler.py":1853 * ts.state = "waiting" * * if not ts._waiting_on: # <<<<<<<<<<<<<< * if self._workers_dv: * recommendations[key] = "processing" */ } /* "distributed/scheduler.py":1860 * ts.state = "no-worker" * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1860, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":1823 * * def transition_no_worker_waiting(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":1861 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_no_worker_waiting", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 1861, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_v_e = __pyx_t_4; /*try:*/ { /* "distributed/scheduler.py":1862 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_logger); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1862, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_exception); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1862, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_15, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_v_e); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1862, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":1863 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1863, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1863, __pyx_L22_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_12) { /* "distributed/scheduler.py":1864 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_14 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1864, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_14); __pyx_v_pdb = __pyx_t_14; __pyx_t_14 = 0; /* "distributed/scheduler.py":1866 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1866, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_16); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1866, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":1863 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":1867 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * @ccall */ __Pyx_GIVEREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_4, __pyx_t_13); __pyx_t_7 = 0; __pyx_t_4 = 0; __pyx_t_13 = 0; __PYX_ERR(0, 1867, __pyx_L22_error) } /* "distributed/scheduler.py":1861 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_17 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_17; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":1823 * * def transition_no_worker_waiting(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":1822 * raise * * def transition_no_worker_waiting(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_no_worker_waiting", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_dep); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1871 * @ccall * @exceptval(check=False) * def decide_worker(self, ts: TaskState) -> WorkerState: # <<<<<<<<<<<<<< * """ * Decide on a worker for task *ts*. Return a WorkerState. */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7decide_worker(PyObject *__pyx_v_self, PyObject *__pyx_v_ts); /*proto*/ static struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_f_11distributed_9scheduler_14SchedulerState_decide_worker(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, int __pyx_skip_dispatch) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_valid_workers = 0; PyObject *__pyx_v_worker_pool = NULL; PyObject *__pyx_v_worker_pool_dv = NULL; Py_ssize_t __pyx_v_n_workers; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decide_worker", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_decide_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_7decide_worker)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 1871, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":1875 * Decide on a worker for task *ts*. Return a WorkerState. * """ * ws: WorkerState = None # <<<<<<<<<<<<<< * valid_workers: set = self.valid_workers(ts) * */ __Pyx_INCREF(Py_None); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); /* "distributed/scheduler.py":1876 * """ * ws: WorkerState = None * valid_workers: set = self.valid_workers(ts) # <<<<<<<<<<<<<< * * if ( */ __pyx_t_1 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->valid_workers(__pyx_v_self, __pyx_v_ts, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_valid_workers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":1879 * * if ( * valid_workers is not None # <<<<<<<<<<<<<< * and not valid_workers * and not ts._loose_restrictions */ __pyx_t_6 = (__pyx_v_valid_workers != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } /* "distributed/scheduler.py":1880 * if ( * valid_workers is not None * and not valid_workers # <<<<<<<<<<<<<< * and not ts._loose_restrictions * and self._workers_dv */ __pyx_t_7 = (__pyx_v_valid_workers != Py_None)&&(PySet_GET_SIZE(__pyx_v_valid_workers) != 0); __pyx_t_6 = ((!__pyx_t_7) != 0); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } /* "distributed/scheduler.py":1881 * valid_workers is not None * and not valid_workers * and not ts._loose_restrictions # <<<<<<<<<<<<<< * and self._workers_dv * ): */ __pyx_t_6 = ((!(__pyx_v_ts->_loose_restrictions != 0)) != 0); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } /* "distributed/scheduler.py":1882 * and not valid_workers * and not ts._loose_restrictions * and self._workers_dv # <<<<<<<<<<<<<< * ): * self._unrunnable.add(ts) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->_workers_dv); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1882, __pyx_L1_error) __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; /* "distributed/scheduler.py":1878 * valid_workers: set = self.valid_workers(ts) * * if ( # <<<<<<<<<<<<<< * valid_workers is not None * and not valid_workers */ if (__pyx_t_5) { /* "distributed/scheduler.py":1884 * and self._workers_dv * ): * self._unrunnable.add(ts) # <<<<<<<<<<<<<< * ts.state = "no-worker" * return ws */ if (unlikely(__pyx_v_self->_unrunnable == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1884, __pyx_L1_error) } __pyx_t_8 = PySet_Add(__pyx_v_self->_unrunnable, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1884, __pyx_L1_error) /* "distributed/scheduler.py":1885 * ): * self._unrunnable.add(ts) * ts.state = "no-worker" # <<<<<<<<<<<<<< * return ws * */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_kp_u_no_worker) < 0) __PYX_ERR(0, 1885, __pyx_L1_error) /* "distributed/scheduler.py":1886 * self._unrunnable.add(ts) * ts.state = "no-worker" * return ws # <<<<<<<<<<<<<< * * if ts._dependencies or valid_workers is not None: */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __pyx_r = __pyx_v_ws; goto __pyx_L0; /* "distributed/scheduler.py":1878 * valid_workers: set = self.valid_workers(ts) * * if ( # <<<<<<<<<<<<<< * valid_workers is not None * and not valid_workers */ } /* "distributed/scheduler.py":1888 * return ws * * if ts._dependencies or valid_workers is not None: # <<<<<<<<<<<<<< * ws = decide_worker( * ts, */ __pyx_t_6 = (__pyx_v_ts->_dependencies != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_dependencies) != 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L9_bool_binop_done; } __pyx_t_6 = (__pyx_v_valid_workers != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_5 = __pyx_t_7; __pyx_L9_bool_binop_done:; if (__pyx_t_5) { /* "distributed/scheduler.py":1891 * ws = decide_worker( * ts, * self._workers_dv.values(), # <<<<<<<<<<<<<< * valid_workers, * partial(self.worker_objective, ts), */ if (unlikely(__pyx_v_self->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 1891, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Values(__pyx_v_self->_workers_dv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":1893 * self._workers_dv.values(), * valid_workers, * partial(self.worker_objective, ts), # <<<<<<<<<<<<<< * ) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_partial); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_worker_objective); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_4, ((PyObject *)__pyx_v_ts)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_4, ((PyObject *)__pyx_v_ts)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, ((PyObject *)__pyx_v_ts)); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1889 * * if ts._dependencies or valid_workers is not None: * ws = decide_worker( # <<<<<<<<<<<<<< * ts, * self._workers_dv.values(), */ __pyx_t_3 = ((PyObject *)__pyx_f_11distributed_9scheduler_decide_worker(__pyx_v_ts, __pyx_t_1, __pyx_v_valid_workers, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":1888 * return ws * * if ts._dependencies or valid_workers is not None: # <<<<<<<<<<<<<< * ws = decide_worker( * ts, */ goto __pyx_L8; } /* "distributed/scheduler.py":1896 * ) * else: * worker_pool = self._idle or self._workers # <<<<<<<<<<<<<< * worker_pool_dv = cast(dict, worker_pool) * n_workers: Py_ssize_t = len(worker_pool_dv) */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_idle); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1896, __pyx_L1_error) if (!__pyx_t_5) { } else { __Pyx_INCREF(__pyx_v_self->_idle); __pyx_t_3 = __pyx_v_self->_idle; goto __pyx_L11_bool_binop_done; } __Pyx_INCREF(__pyx_v_self->_workers); __pyx_t_3 = __pyx_v_self->_workers; __pyx_L11_bool_binop_done:; __pyx_v_worker_pool = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":1897 * else: * worker_pool = self._idle or self._workers * worker_pool_dv = cast(dict, worker_pool) # <<<<<<<<<<<<<< * n_workers: Py_ssize_t = len(worker_pool_dv) * if n_workers < 20: # smart but linear in small case */ __pyx_t_3 = __pyx_v_worker_pool; __Pyx_INCREF(__pyx_t_3); __pyx_v_worker_pool_dv = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":1898 * worker_pool = self._idle or self._workers * worker_pool_dv = cast(dict, worker_pool) * n_workers: Py_ssize_t = len(worker_pool_dv) # <<<<<<<<<<<<<< * if n_workers < 20: # smart but linear in small case * ws = min(worker_pool.values(), key=operator.attrgetter("occupancy")) */ if (unlikely(__pyx_v_worker_pool_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 1898, __pyx_L1_error) } __pyx_t_12 = PyDict_Size(__pyx_v_worker_pool_dv); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1898, __pyx_L1_error) __pyx_v_n_workers = __pyx_t_12; /* "distributed/scheduler.py":1899 * worker_pool_dv = cast(dict, worker_pool) * n_workers: Py_ssize_t = len(worker_pool_dv) * if n_workers < 20: # smart but linear in small case # <<<<<<<<<<<<<< * ws = min(worker_pool.values(), key=operator.attrgetter("occupancy")) * else: # dumb but fast in large case */ __pyx_t_5 = ((__pyx_v_n_workers < 20) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1900 * n_workers: Py_ssize_t = len(worker_pool_dv) * if n_workers < 20: # smart but linear in small case * ws = min(worker_pool.values(), key=operator.attrgetter("occupancy")) # <<<<<<<<<<<<<< * else: # dumb but fast in large case * ws = worker_pool.values()[self._n_tasks % n_workers] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_worker_pool, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_operator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, __pyx_n_u_occupancy) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_occupancy); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":1899 * worker_pool_dv = cast(dict, worker_pool) * n_workers: Py_ssize_t = len(worker_pool_dv) * if n_workers < 20: # smart but linear in small case # <<<<<<<<<<<<<< * ws = min(worker_pool.values(), key=operator.attrgetter("occupancy")) * else: # dumb but fast in large case */ goto __pyx_L13; } /* "distributed/scheduler.py":1902 * ws = min(worker_pool.values(), key=operator.attrgetter("occupancy")) * else: # dumb but fast in large case * ws = worker_pool.values()[self._n_tasks % n_workers] # <<<<<<<<<<<<<< * * if self._validate: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_worker_pool, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_v_n_workers == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); __PYX_ERR(0, 1902, __pyx_L1_error) } __pyx_t_12 = __Pyx_mod_Py_ssize_t(__pyx_v_self->_n_tasks, __pyx_v_n_workers); __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_12, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_3)); __pyx_t_3 = 0; } __pyx_L13:; } __pyx_L8:; /* "distributed/scheduler.py":1904 * ws = worker_pool.values()[self._n_tasks % n_workers] * * if self._validate: # <<<<<<<<<<<<<< * assert ws is None or isinstance(ws, WorkerState), ( * type(ws), */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1905 * * if self._validate: * assert ws is None or isinstance(ws, WorkerState), ( # <<<<<<<<<<<<<< * type(ws), * ws, */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = (((PyObject *)__pyx_v_ws) == Py_None); __pyx_t_6 = (__pyx_t_7 != 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L15_bool_binop_done; } __pyx_t_6 = __Pyx_TypeCheck(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState); __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_5 = __pyx_t_7; __pyx_L15_bool_binop_done:; if (unlikely(!__pyx_t_5)) { /* "distributed/scheduler.py":1906 * if self._validate: * assert ws is None or isinstance(ws, WorkerState), ( * type(ws), # <<<<<<<<<<<<<< * ws, * ) */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ws)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ws)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ws)))); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_ws)); __pyx_t_1 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 1905, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":1909 * ws, * ) * assert ws._address in self._workers_dv # <<<<<<<<<<<<<< * * return ws */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_self->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1909, __pyx_L1_error) } __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_ws->_address, __pyx_v_self->_workers_dv, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1909, __pyx_L1_error) if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1909, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":1904 * ws = worker_pool.values()[self._n_tasks % n_workers] * * if self._validate: # <<<<<<<<<<<<<< * assert ws is None or isinstance(ws, WorkerState), ( * type(ws), */ } /* "distributed/scheduler.py":1911 * assert ws._address in self._workers_dv * * return ws # <<<<<<<<<<<<<< * * @ccall */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __pyx_r = __pyx_v_ws; goto __pyx_L0; /* "distributed/scheduler.py":1871 * @ccall * @exceptval(check=False) * def decide_worker(self, ts: TaskState) -> WorkerState: # <<<<<<<<<<<<<< * """ * Decide on a worker for task *ts*. Return a WorkerState. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.decide_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_valid_workers); __Pyx_XDECREF(__pyx_v_worker_pool); __Pyx_XDECREF(__pyx_v_worker_pool_dv); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7decide_worker(PyObject *__pyx_v_self, PyObject *__pyx_v_ts); /*proto*/ static char __pyx_doc_11distributed_9scheduler_14SchedulerState_6decide_worker[] = "\n Decide on a worker for task *ts*. Return a WorkerState.\n "; static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_7decide_worker(PyObject *__pyx_v_self, PyObject *__pyx_v_ts) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decide_worker (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 1871, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_6decide_worker(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_ts)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_6decide_worker(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decide_worker", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_11distributed_9scheduler_14SchedulerState_decide_worker(__pyx_v_self, __pyx_v_ts, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.decide_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1914 * * @ccall * def set_duration_estimate(self, ts: TaskState, ws: WorkerState) -> double: # <<<<<<<<<<<<<< * """Estimate task duration using worker state and task state. * */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9set_duration_estimate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static double __pyx_f_11distributed_9scheduler_14SchedulerState_set_duration_estimate(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch) { double __pyx_v_exec_time; double __pyx_v_duration; double __pyx_v_total_duration; double __pyx_v_comm; double __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; double __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_duration_estimate", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_duration_estimate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_9set_duration_estimate)) { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_ts)); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_ws)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_7; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":1921 * to be the average duration. * """ * exec_time: double = ws._executing.get(ts, 0) # <<<<<<<<<<<<<< * duration: double = self.get_task_duration(ts) * total_duration: double */ if (unlikely(__pyx_v_ws->_executing == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 1921, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_ws->_executing, ((PyObject *)__pyx_v_ts), __pyx_int_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_exec_time = __pyx_t_7; /* "distributed/scheduler.py":1922 * """ * exec_time: double = ws._executing.get(ts, 0) * duration: double = self.get_task_duration(ts) # <<<<<<<<<<<<<< * total_duration: double * if exec_time > 2 * duration: */ __pyx_t_7 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->get_task_duration(__pyx_v_self, __pyx_v_ts, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1922, __pyx_L1_error) __pyx_v_duration = __pyx_t_7; /* "distributed/scheduler.py":1924 * duration: double = self.get_task_duration(ts) * total_duration: double * if exec_time > 2 * duration: # <<<<<<<<<<<<<< * total_duration = 2 * exec_time * else: */ __pyx_t_8 = ((__pyx_v_exec_time > (2.0 * __pyx_v_duration)) != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":1925 * total_duration: double * if exec_time > 2 * duration: * total_duration = 2 * exec_time # <<<<<<<<<<<<<< * else: * comm: double = self.get_comm_cost(ts, ws) */ __pyx_v_total_duration = (2.0 * __pyx_v_exec_time); /* "distributed/scheduler.py":1924 * duration: double = self.get_task_duration(ts) * total_duration: double * if exec_time > 2 * duration: # <<<<<<<<<<<<<< * total_duration = 2 * exec_time * else: */ goto __pyx_L3; } /* "distributed/scheduler.py":1927 * total_duration = 2 * exec_time * else: * comm: double = self.get_comm_cost(ts, ws) # <<<<<<<<<<<<<< * total_duration = duration + comm * ws._processing[ts] = total_duration */ /*else*/ { __pyx_t_7 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->get_comm_cost(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L1_error) __pyx_v_comm = __pyx_t_7; /* "distributed/scheduler.py":1928 * else: * comm: double = self.get_comm_cost(ts, ws) * total_duration = duration + comm # <<<<<<<<<<<<<< * ws._processing[ts] = total_duration * return total_duration */ __pyx_v_total_duration = (__pyx_v_duration + __pyx_v_comm); } __pyx_L3:; /* "distributed/scheduler.py":1929 * comm: double = self.get_comm_cost(ts, ws) * total_duration = duration + comm * ws._processing[ts] = total_duration # <<<<<<<<<<<<<< * return total_duration * */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_total_duration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1929, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_ws->_processing, ((PyObject *)__pyx_v_ts), __pyx_t_1) < 0)) __PYX_ERR(0, 1929, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":1930 * total_duration = duration + comm * ws._processing[ts] = total_duration * return total_duration # <<<<<<<<<<<<<< * * def transition_waiting_processing(self, key): */ __pyx_r = __pyx_v_total_duration; goto __pyx_L0; /* "distributed/scheduler.py":1914 * * @ccall * def set_duration_estimate(self, ts: TaskState, ws: WorkerState) -> double: # <<<<<<<<<<<<<< * """Estimate task duration using worker state and task state. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.set_duration_estimate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9set_duration_estimate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_14SchedulerState_8set_duration_estimate[] = "Estimate task duration using worker state and task state.\n\n If a task takes longer than twice the current average duration we\n estimate the task duration to be 2x current-runtime, otherwise we set it\n to be the average duration.\n "; static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_9set_duration_estimate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_duration_estimate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_ws,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ws)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_duration_estimate", 1, 2, 2, 1); __PYX_ERR(0, 1914, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_duration_estimate") < 0)) __PYX_ERR(0, 1914, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[0]); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_duration_estimate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1914, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.set_duration_estimate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 1914, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState, 1, "ws", 0))) __PYX_ERR(0, 1914, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_8set_duration_estimate(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_ts, __pyx_v_ws); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_8set_duration_estimate(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_duration_estimate", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_14SchedulerState_set_duration_estimate(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.set_duration_estimate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1932 * return total_duration * * def transition_waiting_processing(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_11transition_waiting_processing(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_11transition_waiting_processing(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_waiting_processing (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_10transition_waiting_processing(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_10transition_waiting_processing(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_worker = NULL; double __pyx_v_duration_estimate; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr22__pyx_v_dts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; double __pyx_t_13; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_waiting_processing", 0); /* "distributed/scheduler.py":1933 * * def transition_waiting_processing(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":1934 * def transition_waiting_processing(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * worker_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1934, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1934, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1934, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1936 * ts: TaskState = self._tasks[key] * dts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1936, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1937 * dts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1937, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1939 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._who_has */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1940 * * if self._validate: * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._exception_blame */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1940, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1941 * if self._validate: * assert not ts._waiting_on * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._exception_blame * assert not ts._processing_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1941, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1942 * assert not ts._waiting_on * assert not ts._who_has * assert not ts._exception_blame # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._has_lost_dependencies */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_exception_blame); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1942, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1942, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1943 * assert not ts._who_has * assert not ts._exception_blame * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not ts._has_lost_dependencies * assert ts not in self._unrunnable */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1943, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1943, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1944 * assert not ts._exception_blame * assert not ts._processing_on * assert not ts._has_lost_dependencies # <<<<<<<<<<<<<< * assert ts not in self._unrunnable * assert all([dts._who_has for dts in ts._dependencies]) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((!(__pyx_v_ts->_has_lost_dependencies != 0)) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1944, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1945 * assert not ts._processing_on * assert not ts._has_lost_dependencies * assert ts not in self._unrunnable # <<<<<<<<<<<<<< * assert all([dts._who_has for dts in ts._dependencies]) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_self->_unrunnable == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1945, __pyx_L3_error) } __pyx_t_5 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_self->_unrunnable, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1945, __pyx_L3_error) if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1945, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1946 * assert not ts._has_lost_dependencies * assert ts not in self._unrunnable * assert all([dts._who_has for dts in ts._dependencies]) # <<<<<<<<<<<<<< * * ws: WorkerState = self.decide_worker(ts) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1946, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1946, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_10; __pyx_t_10 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_10, __pyx_t_9); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1946, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_10); if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1946, __pyx_L12_error) __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_10)); __pyx_t_10 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr22__pyx_v_dts->_who_has))) __PYX_ERR(0, 1946, __pyx_L12_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr22__pyx_v_dts); __pyx_9genexpr22__pyx_v_dts = 0; goto __pyx_L15_exit_scope; __pyx_L12_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr22__pyx_v_dts); __pyx_9genexpr22__pyx_v_dts = 0; goto __pyx_L3_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1946, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1946, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1946, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1939 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._who_has */ } /* "distributed/scheduler.py":1948 * assert all([dts._who_has for dts in ts._dependencies]) * * ws: WorkerState = self.decide_worker(ts) # <<<<<<<<<<<<<< * if ws is None: * return {}, worker_msgs, client_msgs */ __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->decide_worker(__pyx_v_self, __pyx_v_ts, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1948, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":1949 * * ws: WorkerState = self.decide_worker(ts) * if ws is None: # <<<<<<<<<<<<<< * return {}, worker_msgs, client_msgs * worker = ws._address */ __pyx_t_5 = (((PyObject *)__pyx_v_ws) == Py_None); __pyx_t_12 = (__pyx_t_5 != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":1950 * ws: WorkerState = self.decide_worker(ts) * if ws is None: * return {}, worker_msgs, client_msgs # <<<<<<<<<<<<<< * worker = ws._address * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1950, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1950, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":1949 * * ws: WorkerState = self.decide_worker(ts) * if ws is None: # <<<<<<<<<<<<<< * return {}, worker_msgs, client_msgs * worker = ws._address */ } /* "distributed/scheduler.py":1951 * if ws is None: * return {}, worker_msgs, client_msgs * worker = ws._address # <<<<<<<<<<<<<< * * duration_estimate = self.set_duration_estimate(ts, ws) */ __pyx_t_4 = __pyx_v_ws->_address; __Pyx_INCREF(__pyx_t_4); __pyx_v_worker = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1953 * worker = ws._address * * duration_estimate = self.set_duration_estimate(ts, ws) # <<<<<<<<<<<<<< * ts._processing_on = ws * ws._occupancy += duration_estimate */ __pyx_t_13 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->set_duration_estimate(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error) __pyx_v_duration_estimate = __pyx_t_13; /* "distributed/scheduler.py":1954 * * duration_estimate = self.set_duration_estimate(ts, ws) * ts._processing_on = ws # <<<<<<<<<<<<<< * ws._occupancy += duration_estimate * self._total_occupancy += duration_estimate */ __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); __Pyx_GOTREF(__pyx_v_ts->_processing_on); __Pyx_DECREF(((PyObject *)__pyx_v_ts->_processing_on)); __pyx_v_ts->_processing_on = __pyx_v_ws; /* "distributed/scheduler.py":1955 * duration_estimate = self.set_duration_estimate(ts, ws) * ts._processing_on = ws * ws._occupancy += duration_estimate # <<<<<<<<<<<<<< * self._total_occupancy += duration_estimate * ts.state = "processing" */ __pyx_v_ws->_occupancy = (__pyx_v_ws->_occupancy + __pyx_v_duration_estimate); /* "distributed/scheduler.py":1956 * ts._processing_on = ws * ws._occupancy += duration_estimate * self._total_occupancy += duration_estimate # <<<<<<<<<<<<<< * ts.state = "processing" * self.consume_resources(ts, ws) */ __pyx_v_self->_total_occupancy = (__pyx_v_self->_total_occupancy + __pyx_v_duration_estimate); /* "distributed/scheduler.py":1957 * ws._occupancy += duration_estimate * self._total_occupancy += duration_estimate * ts.state = "processing" # <<<<<<<<<<<<<< * self.consume_resources(ts, ws) * self.check_idle_saturated(ws) */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_processing_2) < 0) __PYX_ERR(0, 1957, __pyx_L3_error) /* "distributed/scheduler.py":1958 * self._total_occupancy += duration_estimate * ts.state = "processing" * self.consume_resources(ts, ws) # <<<<<<<<<<<<<< * self.check_idle_saturated(ws) * self._n_tasks += 1 */ __pyx_t_4 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->consume_resources(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1958, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1959 * ts.state = "processing" * self.consume_resources(ts, ws) * self.check_idle_saturated(ws) # <<<<<<<<<<<<<< * self._n_tasks += 1 * */ __pyx_t_4 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->check_idle_saturated(__pyx_v_self, __pyx_v_ws, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1959, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1960 * self.consume_resources(ts, ws) * self.check_idle_saturated(ws) * self._n_tasks += 1 # <<<<<<<<<<<<<< * * if ts._actor: */ __pyx_v_self->_n_tasks = (__pyx_v_self->_n_tasks + 1); /* "distributed/scheduler.py":1962 * self._n_tasks += 1 * * if ts._actor: # <<<<<<<<<<<<<< * ws._actors.add(ts) * */ __pyx_t_12 = (__pyx_v_ts->_actor != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":1963 * * if ts._actor: * ws._actors.add(ts) # <<<<<<<<<<<<<< * * # logger.debug("Send job to worker: %s, %s", worker, key) */ if (unlikely(__pyx_v_ws->_actors == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 1963, __pyx_L3_error) } __pyx_t_14 = PySet_Add(__pyx_v_ws->_actors, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1963, __pyx_L3_error) /* "distributed/scheduler.py":1962 * self._n_tasks += 1 * * if ts._actor: # <<<<<<<<<<<<<< * ws._actors.add(ts) * */ } /* "distributed/scheduler.py":1967 * # logger.debug("Send job to worker: %s, %s", worker, key) * * worker_msgs[worker] = [_task_to_msg(self, ts)] # <<<<<<<<<<<<<< * * return {}, worker_msgs, client_msgs */ __pyx_t_4 = __pyx_f_11distributed_9scheduler__task_to_msg(__pyx_v_self, __pyx_v_ts, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1967, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1967, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = 0; if (unlikely(PyDict_SetItem(__pyx_v_worker_msgs, __pyx_v_worker, __pyx_t_6) < 0)) __PYX_ERR(0, 1967, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":1969 * worker_msgs[worker] = [_task_to_msg(self, ts)] * * return {}, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1969, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1969, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":1933 * * def transition_waiting_processing(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":1970 * * return {}, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_waiting_processing", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 1970, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "distributed/scheduler.py":1971 * return {}, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1971, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_exception); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1971, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_16, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_e); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1971, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":1972 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1972, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1972, __pyx_L23_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_12) { /* "distributed/scheduler.py":1973 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_15 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1973, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_15); __pyx_v_pdb = __pyx_t_15; __pyx_t_15 = 0; /* "distributed/scheduler.py":1975 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1975, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_17); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1975, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":1972 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":1976 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_waiting_memory( */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_10); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_10 = 0; __PYX_ERR(0, 1976, __pyx_L23_error) } /* "distributed/scheduler.py":1970 * * return {}, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L23_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_9 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_18; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":1933 * * def transition_waiting_processing(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":1932 * return total_duration * * def transition_waiting_processing(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_waiting_processing", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_worker); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XDECREF((PyObject *)__pyx_9genexpr22__pyx_v_dts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":1978 * raise * * def transition_waiting_memory( # <<<<<<<<<<<<<< * self, key, nbytes=None, type=None, typename: str = None, worker=None, **kwargs * ): */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_13transition_waiting_memory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_13transition_waiting_memory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_nbytes = 0; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_worker = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_waiting_memory (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_nbytes,&__pyx_n_s_type,&__pyx_n_s_typename,&__pyx_n_s_worker,0}; PyObject* values[5] = {0,0,0,0,0}; /* "distributed/scheduler.py":1979 * * def transition_waiting_memory( * self, key, nbytes=None, type=None, typename: str = None, worker=None, **kwargs # <<<<<<<<<<<<<< * ): * try: */ values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject*)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typename); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "transition_waiting_memory") < 0)) __PYX_ERR(0, 1978, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_nbytes = values[1]; __pyx_v_type = values[2]; __pyx_v_typename = ((PyObject*)values[3]); __pyx_v_worker = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transition_waiting_memory", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1978, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_waiting_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typename), (&PyUnicode_Type), 1, "typename", 1))) __PYX_ERR(0, 1979, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_12transition_waiting_memory(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_key, __pyx_v_nbytes, __pyx_v_type, __pyx_v_typename, __pyx_v_worker, __pyx_v_kwargs); /* "distributed/scheduler.py":1978 * raise * * def transition_waiting_memory( # <<<<<<<<<<<<<< * self, key, nbytes=None, type=None, typename: str = None, worker=None, **kwargs * ): */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_12transition_waiting_memory(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_type, PyObject *__pyx_v_typename, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; struct __pyx_opt_args_11distributed_9scheduler__add_to_memory __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; char const *__pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_waiting_memory", 0); /* "distributed/scheduler.py":1981 * self, key, nbytes=None, type=None, typename: str = None, worker=None, **kwargs * ): * try: # <<<<<<<<<<<<<< * ws: WorkerState = self._workers_dv[worker] * ts: TaskState = self._tasks[key] */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":1982 * ): * try: * ws: WorkerState = self._workers_dv[worker] # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ if (unlikely(__pyx_v_self->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1982, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_workers_dv, __pyx_v_worker); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1982, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 1982, __pyx_L3_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1983 * try: * ws: WorkerState = self._workers_dv[worker] * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * worker_msgs: dict = {} * client_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1983, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1983, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 1983, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1984 * ws: WorkerState = self._workers_dv[worker] * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1984, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1985 * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1985, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1987 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * assert ts._waiting_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":1988 * * if self._validate: * assert not ts._processing_on # <<<<<<<<<<<<<< * assert ts._waiting_on * assert ts._state == "waiting" */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1988, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1988, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1989 * if self._validate: * assert not ts._processing_on * assert ts._waiting_on # <<<<<<<<<<<<<< * assert ts._state == "waiting" * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1989, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1990 * assert not ts._processing_on * assert ts._waiting_on * assert ts._state == "waiting" # <<<<<<<<<<<<<< * * ts._waiting_on.clear() */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_waiting, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1990, __pyx_L3_error) if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1990, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":1987 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * assert ts._waiting_on */ } /* "distributed/scheduler.py":1992 * assert ts._state == "waiting" * * ts._waiting_on.clear() # <<<<<<<<<<<<<< * * if nbytes is not None: */ if (unlikely(__pyx_v_ts->_waiting_on == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 1992, __pyx_L3_error) } __pyx_t_6 = PySet_Clear(__pyx_v_ts->_waiting_on); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1992, __pyx_L3_error) /* "distributed/scheduler.py":1994 * ts._waiting_on.clear() * * if nbytes is not None: # <<<<<<<<<<<<<< * ts.set_nbytes(nbytes) * */ __pyx_t_5 = (__pyx_v_nbytes != Py_None); __pyx_t_7 = (__pyx_t_5 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":1995 * * if nbytes is not None: * ts.set_nbytes(nbytes) # <<<<<<<<<<<<<< * * self.check_idle_saturated(ws) */ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_nbytes); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1995, __pyx_L3_error) __pyx_t_4 = __pyx_f_11distributed_9scheduler_9TaskState_set_nbytes(__pyx_v_ts, __pyx_t_8, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1994 * ts._waiting_on.clear() * * if nbytes is not None: # <<<<<<<<<<<<<< * ts.set_nbytes(nbytes) * */ } /* "distributed/scheduler.py":1997 * ts.set_nbytes(nbytes) * * self.check_idle_saturated(ws) # <<<<<<<<<<<<<< * * recommendations: dict = {} */ __pyx_t_4 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->check_idle_saturated(__pyx_v_self, __pyx_v_ws, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1997, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":1999 * self.check_idle_saturated(ws) * * recommendations: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1999, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_recommendations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2000 * * recommendations: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * _add_to_memory( */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2000, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_client_msgs, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":2002 * client_msgs: dict = {} * * _add_to_memory( # <<<<<<<<<<<<<< * self, ts, ws, recommendations, client_msgs, type=type, typename=typename * ) */ __pyx_t_9.__pyx_n = 2; __pyx_t_9.type = __pyx_v_type; __pyx_t_9.typename = __pyx_v_typename; __pyx_t_4 = __pyx_f_11distributed_9scheduler__add_to_memory(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, __pyx_v_recommendations, __pyx_v_client_msgs, &__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2002, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2006 * ) * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._waiting_on */ __pyx_t_7 = (__pyx_v_self->_validate != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":2007 * * if self._validate: * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert ts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2007, __pyx_L3_error) if (unlikely(!((!__pyx_t_7) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2007, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2008 * if self._validate: * assert not ts._processing_on * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert ts._who_has * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_7) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2008, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2009 * assert not ts._processing_on * assert not ts._waiting_on * assert ts._who_has # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!__pyx_t_7)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2009, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2006 * ) * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._waiting_on */ } /* "distributed/scheduler.py":2011 * assert ts._who_has * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2011, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":1981 * self, key, nbytes=None, type=None, typename: str = None, worker=None, **kwargs * ): * try: # <<<<<<<<<<<<<< * ws: WorkerState = self._workers_dv[worker] * ts: TaskState = self._tasks[key] */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2012 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_waiting_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 2012, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __pyx_v_e = __pyx_t_11; /*try:*/ { /* "distributed/scheduler.py":2013 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2013, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exception); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2013, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_14, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_e); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2013, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":2014 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2014, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2014, __pyx_L17_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_7) { /* "distributed/scheduler.py":2015 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_13 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2015, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __pyx_v_pdb = __pyx_t_13; __pyx_t_13 = 0; /* "distributed/scheduler.py":2017 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2017, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2017, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":2014 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2018 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_processing_memory( */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_11, __pyx_t_12); __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __PYX_ERR(0, 2018, __pyx_L17_error) } /* "distributed/scheduler.py":2012 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L17_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_10 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":1981 * self, key, nbytes=None, type=None, typename: str = None, worker=None, **kwargs * ): * try: # <<<<<<<<<<<<<< * ws: WorkerState = self._workers_dv[worker] * ts: TaskState = self._tasks[key] */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":1978 * raise * * def transition_waiting_memory( # <<<<<<<<<<<<<< * self, key, nbytes=None, type=None, typename: str = None, worker=None, **kwargs * ): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_waiting_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2020 * raise * * def transition_processing_memory( # <<<<<<<<<<<<<< * self, * key, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_15transition_processing_memory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_15transition_processing_memory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_nbytes = 0; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_startstops = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_processing_memory (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_nbytes,&__pyx_n_s_type,&__pyx_n_s_typename,&__pyx_n_s_worker,&__pyx_n_s_startstops,0}; PyObject* values[6] = {0,0,0,0,0,0}; /* "distributed/scheduler.py":2023 * self, * key, * nbytes=None, # <<<<<<<<<<<<<< * type=None, * typename: str = None, */ values[1] = ((PyObject *)Py_None); /* "distributed/scheduler.py":2024 * key, * nbytes=None, * type=None, # <<<<<<<<<<<<<< * typename: str = None, * worker=None, */ values[2] = ((PyObject *)Py_None); /* "distributed/scheduler.py":2025 * nbytes=None, * type=None, * typename: str = None, # <<<<<<<<<<<<<< * worker=None, * startstops=None, */ values[3] = ((PyObject*)Py_None); /* "distributed/scheduler.py":2026 * type=None, * typename: str = None, * worker=None, # <<<<<<<<<<<<<< * startstops=None, * **kwargs, */ values[4] = ((PyObject *)Py_None); /* "distributed/scheduler.py":2027 * typename: str = None, * worker=None, * startstops=None, # <<<<<<<<<<<<<< * **kwargs, * ): */ values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typename); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_startstops); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "transition_processing_memory") < 0)) __PYX_ERR(0, 2020, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_nbytes = values[1]; __pyx_v_type = values[2]; __pyx_v_typename = ((PyObject*)values[3]); __pyx_v_worker = values[4]; __pyx_v_startstops = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transition_processing_memory", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2020, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_processing_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typename), (&PyUnicode_Type), 1, "typename", 1))) __PYX_ERR(0, 2025, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_14transition_processing_memory(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_key, __pyx_v_nbytes, __pyx_v_type, __pyx_v_typename, __pyx_v_worker, __pyx_v_startstops, __pyx_v_kwargs); /* "distributed/scheduler.py":2020 * raise * * def transition_processing_memory( # <<<<<<<<<<<<<< * self, * key, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_14transition_processing_memory(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_type, PyObject *__pyx_v_typename, PyObject *__pyx_v_worker, PyObject *__pyx_v_startstops, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_wws = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_L = NULL; PyObject *__pyx_v_startstop = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_action = NULL; PyObject *__pyx_v_compute_start = NULL; PyObject *__pyx_v_compute_stop = NULL; double __pyx_v_old_duration; PyObject *__pyx_v_new_duration = NULL; PyObject *__pyx_v_avg_duration = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_tts = 0; PyObject *__pyx_v_old = NULL; double __pyx_v_comm; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); int __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *(*__pyx_t_16)(PyObject *); double __pyx_t_17; struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_t_18 = NULL; struct __pyx_opt_args_11distributed_9scheduler__add_to_memory __pyx_t_19; int __pyx_t_20; char const *__pyx_t_21; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_processing_memory", 0); /* "distributed/scheduler.py":2032 * ws: WorkerState * wws: WorkerState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * try: */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2033 * wws: WorkerState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_client_msgs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2034 * worker_msgs: dict = {} * client_msgs: dict = {} * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * assert worker */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":2035 * client_msgs: dict = {} * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * assert worker * assert isinstance(worker, str) */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2035, __pyx_L3_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2035, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2035, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2036 * try: * ts: TaskState = self._tasks[key] * assert worker # <<<<<<<<<<<<<< * assert isinstance(worker, str) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_worker); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2036, __pyx_L3_error) if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2036, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2037 * ts: TaskState = self._tasks[key] * assert worker * assert isinstance(worker, str) # <<<<<<<<<<<<<< * * if self._validate: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = PyUnicode_Check(__pyx_v_worker); if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2037, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2039 * assert isinstance(worker, str) * * if self._validate: # <<<<<<<<<<<<<< * assert ts._processing_on * ws = ts._processing_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2040 * * if self._validate: * assert ts._processing_on # <<<<<<<<<<<<<< * ws = ts._processing_on * assert ts in ws._processing */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2040, __pyx_L3_error) if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2040, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2041 * if self._validate: * assert ts._processing_on * ws = ts._processing_on # <<<<<<<<<<<<<< * assert ts in ws._processing * assert not ts._waiting_on */ __pyx_t_1 = ((PyObject *)__pyx_v_ts->_processing_on); __Pyx_INCREF(__pyx_t_1); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2042 * assert ts._processing_on * ws = ts._processing_on * assert ts in ws._processing # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._who_has, (ts, ts._who_has) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2042, __pyx_L3_error) } __pyx_t_5 = (__Pyx_PyDict_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_ws->_processing, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2042, __pyx_L3_error) if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2042, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2043 * ws = ts._processing_on * assert ts in ws._processing * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._who_has, (ts, ts._who_has) * assert not ts._exception_blame */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2043, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2044 * assert ts in ws._processing * assert not ts._waiting_on * assert not ts._who_has, (ts, ts._who_has) # <<<<<<<<<<<<<< * assert not ts._exception_blame * assert ts._state == "processing" */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ts)); __Pyx_INCREF(__pyx_v_ts->_who_has); __Pyx_GIVEREF(__pyx_v_ts->_who_has); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ts->_who_has); __pyx_t_6 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2044, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 2044, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2045 * assert not ts._waiting_on * assert not ts._who_has, (ts, ts._who_has) * assert not ts._exception_blame # <<<<<<<<<<<<<< * assert ts._state == "processing" * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_exception_blame); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2045, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2045, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2046 * assert not ts._who_has, (ts, ts._who_has) * assert not ts._exception_blame * assert ts._state == "processing" # <<<<<<<<<<<<<< * * ws = self._workers_dv.get(worker) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2046, __pyx_L3_error) if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2046, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2039 * assert isinstance(worker, str) * * if self._validate: # <<<<<<<<<<<<<< * assert ts._processing_on * ws = ts._processing_on */ } /* "distributed/scheduler.py":2048 * assert ts._state == "processing" * * ws = self._workers_dv.get(worker) # <<<<<<<<<<<<<< * if ws is None: * return {key: "released"}, worker_msgs, client_msgs */ if (unlikely(__pyx_v_self->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 2048, __pyx_L3_error) } __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_workers_dv, __pyx_v_worker, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2048, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 2048, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":2049 * * ws = self._workers_dv.get(worker) * if ws is None: # <<<<<<<<<<<<<< * return {key: "released"}, worker_msgs, client_msgs * */ __pyx_t_5 = (((PyObject *)__pyx_v_ws) == Py_None); __pyx_t_7 = (__pyx_t_5 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":2050 * ws = self._workers_dv.get(worker) * if ws is None: * return {key: "released"}, worker_msgs, client_msgs # <<<<<<<<<<<<<< * * if ws != ts._processing_on: # someone else has this task */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2050, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_v_key, __pyx_n_u_released) < 0) __PYX_ERR(0, 2050, __pyx_L3_error) __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2050, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_client_msgs); __pyx_t_6 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2049 * * ws = self._workers_dv.get(worker) * if ws is None: # <<<<<<<<<<<<<< * return {key: "released"}, worker_msgs, client_msgs * */ } /* "distributed/scheduler.py":2052 * return {key: "released"}, worker_msgs, client_msgs * * if ws != ts._processing_on: # someone else has this task # <<<<<<<<<<<<<< * logger.info( * "Unexpected worker completed task, likely due to" */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_ws), ((PyObject *)__pyx_v_ts->_processing_on), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L3_error) __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2052, __pyx_L3_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* "distributed/scheduler.py":2053 * * if ws != ts._processing_on: # someone else has this task * logger.info( # <<<<<<<<<<<<<< * "Unexpected worker completed task, likely due to" * " work stealing. Expected: %s, Got: %s, Key: %s", */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2053, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2053, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":2058 * ts._processing_on, * ws, * key, # <<<<<<<<<<<<<< * ) * return {}, worker_msgs, client_msgs */ __pyx_t_6 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_kp_u_Unexpected_worker_completed_task, ((PyObject *)__pyx_v_ts->_processing_on), ((PyObject *)__pyx_v_ws), __pyx_v_key}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_kp_u_Unexpected_worker_completed_task, ((PyObject *)__pyx_v_ts->_processing_on), ((PyObject *)__pyx_v_ws), __pyx_v_key}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_10 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2053, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_kp_u_Unexpected_worker_completed_task); __Pyx_GIVEREF(__pyx_kp_u_Unexpected_worker_completed_task); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_kp_u_Unexpected_worker_completed_task); __Pyx_INCREF(((PyObject *)__pyx_v_ts->_processing_on)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts->_processing_on)); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, ((PyObject *)__pyx_v_ts->_processing_on)); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, ((PyObject *)__pyx_v_ws)); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_v_key); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2060 * key, * ) * return {}, worker_msgs, client_msgs # <<<<<<<<<<<<<< * * if startstops: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2060, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2060, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_client_msgs); __pyx_t_1 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2052 * return {key: "released"}, worker_msgs, client_msgs * * if ws != ts._processing_on: # someone else has this task # <<<<<<<<<<<<<< * logger.info( * "Unexpected worker completed task, likely due to" */ } /* "distributed/scheduler.py":2062 * return {}, worker_msgs, client_msgs * * if startstops: # <<<<<<<<<<<<<< * L = list() * for startstop in startstops: */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_startstops); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2062, __pyx_L3_error) if (__pyx_t_7) { /* "distributed/scheduler.py":2063 * * if startstops: * L = list() # <<<<<<<<<<<<<< * for startstop in startstops: * stop = startstop["stop"] */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2063, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_L = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2064 * if startstops: * L = list() * for startstop in startstops: # <<<<<<<<<<<<<< * stop = startstop["stop"] * start = startstop["start"] */ if (likely(PyList_CheckExact(__pyx_v_startstops)) || PyTuple_CheckExact(__pyx_v_startstops)) { __pyx_t_8 = __pyx_v_startstops; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_startstops); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2064, __pyx_L3_error) } for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 2064, __pyx_L3_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 2064, __pyx_L3_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 2064, __pyx_L3_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_startstop, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2065 * L = list() * for startstop in startstops: * stop = startstop["stop"] # <<<<<<<<<<<<<< * start = startstop["start"] * action = startstop["action"] */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_startstop, __pyx_n_u_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2066 * for startstop in startstops: * stop = startstop["stop"] * start = startstop["start"] # <<<<<<<<<<<<<< * action = startstop["action"] * if action == "compute": */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_startstop, __pyx_n_u_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2066, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2067 * stop = startstop["stop"] * start = startstop["start"] * action = startstop["action"] # <<<<<<<<<<<<<< * if action == "compute": * L.append((start, stop)) */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_startstop, __pyx_n_u_action); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2067, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_action, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2068 * start = startstop["start"] * action = startstop["action"] * if action == "compute": # <<<<<<<<<<<<<< * L.append((start, stop)) * */ __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_action, __pyx_n_u_compute, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2068, __pyx_L3_error) if (__pyx_t_7) { /* "distributed/scheduler.py":2069 * action = startstop["action"] * if action == "compute": * L.append((start, stop)) # <<<<<<<<<<<<<< * * # record timings of all actions -- a cheaper way of */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start); __Pyx_INCREF(__pyx_v_stop); __Pyx_GIVEREF(__pyx_v_stop); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_stop); __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_1); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 2069, __pyx_L3_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2068 * start = startstop["start"] * action = startstop["action"] * if action == "compute": # <<<<<<<<<<<<<< * L.append((start, stop)) * */ } /* "distributed/scheduler.py":2073 * # record timings of all actions -- a cheaper way of * # getting timing info compared with get_task_stream() * ts._prefix._all_durations[action] += stop - start # <<<<<<<<<<<<<< * * if len(L) > 0: */ __Pyx_INCREF(__pyx_v_ts->_prefix->_all_durations); __pyx_t_1 = __pyx_v_ts->_prefix->_all_durations; __Pyx_INCREF(__pyx_v_action); __pyx_t_10 = __pyx_v_action; __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2073, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_14 = PyNumber_Subtract(__pyx_v_stop, __pyx_v_start); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2073, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2073, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_10, __pyx_t_15) < 0)) __PYX_ERR(0, 2073, __pyx_L3_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2064 * if startstops: * L = list() * for startstop in startstops: # <<<<<<<<<<<<<< * stop = startstop["stop"] * start = startstop["start"] */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2075 * ts._prefix._all_durations[action] += stop - start * * if len(L) > 0: # <<<<<<<<<<<<<< * compute_start, compute_stop = L[0] * else: # This is very rare */ __pyx_t_11 = PyList_GET_SIZE(__pyx_v_L); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2075, __pyx_L3_error) __pyx_t_7 = ((__pyx_t_11 > 0) != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":2076 * * if len(L) > 0: * compute_start, compute_stop = L[0] # <<<<<<<<<<<<<< * else: # This is very rare * compute_start = compute_stop = None */ __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_L, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2076, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 2076, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_10); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2076, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2076, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_1)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_10 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_10)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) __PYX_ERR(0, 2076, __pyx_L3_error) __pyx_t_16 = NULL; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L18_unpacking_done; __pyx_L17_unpacking_failed:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_16 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 2076, __pyx_L3_error) __pyx_L18_unpacking_done:; } __pyx_v_compute_start = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_compute_stop = __pyx_t_10; __pyx_t_10 = 0; /* "distributed/scheduler.py":2075 * ts._prefix._all_durations[action] += stop - start * * if len(L) > 0: # <<<<<<<<<<<<<< * compute_start, compute_stop = L[0] * else: # This is very rare */ goto __pyx_L16; } /* "distributed/scheduler.py":2078 * compute_start, compute_stop = L[0] * else: # This is very rare * compute_start = compute_stop = None # <<<<<<<<<<<<<< * else: * compute_start = compute_stop = None */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_compute_start = Py_None; __Pyx_INCREF(Py_None); __pyx_v_compute_stop = Py_None; } __pyx_L16:; /* "distributed/scheduler.py":2062 * return {}, worker_msgs, client_msgs * * if startstops: # <<<<<<<<<<<<<< * L = list() * for startstop in startstops: */ goto __pyx_L12; } /* "distributed/scheduler.py":2080 * compute_start = compute_stop = None * else: * compute_start = compute_stop = None # <<<<<<<<<<<<<< * * ############################# */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_compute_start = Py_None; __Pyx_INCREF(Py_None); __pyx_v_compute_stop = Py_None; } __pyx_L12:; /* "distributed/scheduler.py":2085 * # Update Timing Information # * ############################# * if compute_start and ws._processing.get(ts, True): # <<<<<<<<<<<<<< * # Update average task duration for worker * old_duration = ts._prefix._duration_average */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_compute_start); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2085, __pyx_L3_error) if (__pyx_t_5) { } else { __pyx_t_7 = __pyx_t_5; goto __pyx_L20_bool_binop_done; } if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 2085, __pyx_L3_error) } __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_ws->_processing, ((PyObject *)__pyx_v_ts), Py_True); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2085, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2085, __pyx_L3_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_7 = __pyx_t_5; __pyx_L20_bool_binop_done:; if (__pyx_t_7) { /* "distributed/scheduler.py":2087 * if compute_start and ws._processing.get(ts, True): * # Update average task duration for worker * old_duration = ts._prefix._duration_average # <<<<<<<<<<<<<< * new_duration = compute_stop - compute_start * if old_duration < 0: */ __pyx_t_17 = __pyx_v_ts->_prefix->_duration_average; __pyx_v_old_duration = __pyx_t_17; /* "distributed/scheduler.py":2088 * # Update average task duration for worker * old_duration = ts._prefix._duration_average * new_duration = compute_stop - compute_start # <<<<<<<<<<<<<< * if old_duration < 0: * avg_duration = new_duration */ __pyx_t_8 = PyNumber_Subtract(__pyx_v_compute_stop, __pyx_v_compute_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2088, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_new_duration = __pyx_t_8; __pyx_t_8 = 0; /* "distributed/scheduler.py":2089 * old_duration = ts._prefix._duration_average * new_duration = compute_stop - compute_start * if old_duration < 0: # <<<<<<<<<<<<<< * avg_duration = new_duration * else: */ __pyx_t_7 = ((__pyx_v_old_duration < 0.0) != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":2090 * new_duration = compute_stop - compute_start * if old_duration < 0: * avg_duration = new_duration # <<<<<<<<<<<<<< * else: * avg_duration = 0.5 * old_duration + 0.5 * new_duration */ __Pyx_INCREF(__pyx_v_new_duration); __pyx_v_avg_duration = __pyx_v_new_duration; /* "distributed/scheduler.py":2089 * old_duration = ts._prefix._duration_average * new_duration = compute_stop - compute_start * if old_duration < 0: # <<<<<<<<<<<<<< * avg_duration = new_duration * else: */ goto __pyx_L22; } /* "distributed/scheduler.py":2092 * avg_duration = new_duration * else: * avg_duration = 0.5 * old_duration + 0.5 * new_duration # <<<<<<<<<<<<<< * * ts._prefix._duration_average = avg_duration */ /*else*/ { __pyx_t_8 = PyFloat_FromDouble((0.5 * __pyx_v_old_duration)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2092, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_new_duration); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2092, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2092, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_avg_duration = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L22:; /* "distributed/scheduler.py":2094 * avg_duration = 0.5 * old_duration + 0.5 * new_duration * * ts._prefix._duration_average = avg_duration # <<<<<<<<<<<<<< * ts._group._duration += new_duration * */ __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_avg_duration); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L3_error) __pyx_v_ts->_prefix->_duration_average = __pyx_t_17; /* "distributed/scheduler.py":2095 * * ts._prefix._duration_average = avg_duration * ts._group._duration += new_duration # <<<<<<<<<<<<<< * * tts: TaskState */ __Pyx_INCREF(((PyObject *)__pyx_v_ts->_group)); __pyx_t_18 = __pyx_v_ts->_group; __pyx_t_1 = PyFloat_FromDouble(__pyx_t_18->_duration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2095, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_new_duration); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2095, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2095, __pyx_L3_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_18->_duration = __pyx_t_17; __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; /* "distributed/scheduler.py":2098 * * tts: TaskState * for tts in self._unknown_durations.pop(ts._prefix._name, ()): # <<<<<<<<<<<<<< * if tts._processing_on: * wws = tts._processing_on */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_unknown_durations, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_ts->_prefix->_name, __pyx_empty_tuple}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_ts->_prefix->_name, __pyx_empty_tuple}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_v_ts->_prefix->_name); __Pyx_GIVEREF(__pyx_v_ts->_prefix->_name); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_9, __pyx_v_ts->_prefix->_name); __Pyx_INCREF(__pyx_empty_tuple); __Pyx_GIVEREF(__pyx_empty_tuple); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_9, __pyx_empty_tuple); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { __pyx_t_1 = __pyx_t_10; __Pyx_INCREF(__pyx_t_1); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2098, __pyx_L3_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 2098, __pyx_L3_error) #else __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 2098, __pyx_L3_error) #else __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); #endif } } else { __pyx_t_10 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 2098, __pyx_L3_error) } break; } __Pyx_GOTREF(__pyx_t_10); } if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2098, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_tts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_10)); __pyx_t_10 = 0; /* "distributed/scheduler.py":2099 * tts: TaskState * for tts in self._unknown_durations.pop(ts._prefix._name, ()): * if tts._processing_on: # <<<<<<<<<<<<<< * wws = tts._processing_on * old = wws._processing[tts] */ __pyx_t_7 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_tts->_processing_on)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2099, __pyx_L3_error) if (__pyx_t_7) { /* "distributed/scheduler.py":2100 * for tts in self._unknown_durations.pop(ts._prefix._name, ()): * if tts._processing_on: * wws = tts._processing_on # <<<<<<<<<<<<<< * old = wws._processing[tts] * comm = self.get_comm_cost(tts, wws) */ __pyx_t_10 = ((PyObject *)__pyx_v_tts->_processing_on); __Pyx_INCREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_wws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_10)); __pyx_t_10 = 0; /* "distributed/scheduler.py":2101 * if tts._processing_on: * wws = tts._processing_on * old = wws._processing[tts] # <<<<<<<<<<<<<< * comm = self.get_comm_cost(tts, wws) * wws._processing[tts] = avg_duration + comm */ if (unlikely(__pyx_v_wws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2101, __pyx_L3_error) } __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_wws->_processing, ((PyObject *)__pyx_v_tts)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2101, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_10); __pyx_t_10 = 0; /* "distributed/scheduler.py":2102 * wws = tts._processing_on * old = wws._processing[tts] * comm = self.get_comm_cost(tts, wws) # <<<<<<<<<<<<<< * wws._processing[tts] = avg_duration + comm * wws._occupancy += avg_duration + comm - old */ __pyx_t_17 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->get_comm_cost(__pyx_v_self, __pyx_v_tts, __pyx_v_wws, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error) __pyx_v_comm = __pyx_t_17; /* "distributed/scheduler.py":2103 * old = wws._processing[tts] * comm = self.get_comm_cost(tts, wws) * wws._processing[tts] = avg_duration + comm # <<<<<<<<<<<<<< * wws._occupancy += avg_duration + comm - old * self._total_occupancy += avg_duration + comm - old */ __pyx_t_10 = PyFloat_FromDouble(__pyx_v_comm); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2103, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = PyNumber_Add(__pyx_v_avg_duration, __pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2103, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(__pyx_v_wws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2103, __pyx_L3_error) } if (unlikely(PyDict_SetItem(__pyx_v_wws->_processing, ((PyObject *)__pyx_v_tts), __pyx_t_15) < 0)) __PYX_ERR(0, 2103, __pyx_L3_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2104 * comm = self.get_comm_cost(tts, wws) * wws._processing[tts] = avg_duration + comm * wws._occupancy += avg_duration + comm - old # <<<<<<<<<<<<<< * self._total_occupancy += avg_duration + comm - old * */ __pyx_t_15 = PyFloat_FromDouble(__pyx_v_wws->_occupancy); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_10 = PyFloat_FromDouble(__pyx_v_comm); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = PyNumber_Add(__pyx_v_avg_duration, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyNumber_Subtract(__pyx_t_8, __pyx_v_old); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2104, __pyx_L3_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_wws->_occupancy = __pyx_t_17; /* "distributed/scheduler.py":2105 * wws._processing[tts] = avg_duration + comm * wws._occupancy += avg_duration + comm - old * self._total_occupancy += avg_duration + comm - old # <<<<<<<<<<<<<< * * ############################ */ __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->_total_occupancy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2105, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyFloat_FromDouble(__pyx_v_comm); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2105, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = PyNumber_Add(__pyx_v_avg_duration, __pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2105, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyNumber_Subtract(__pyx_t_15, __pyx_v_old); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2105, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2105, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_15); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2105, __pyx_L3_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_v_self->_total_occupancy = __pyx_t_17; /* "distributed/scheduler.py":2099 * tts: TaskState * for tts in self._unknown_durations.pop(ts._prefix._name, ()): * if tts._processing_on: # <<<<<<<<<<<<<< * wws = tts._processing_on * old = wws._processing[tts] */ } /* "distributed/scheduler.py":2098 * * tts: TaskState * for tts in self._unknown_durations.pop(ts._prefix._name, ()): # <<<<<<<<<<<<<< * if tts._processing_on: * wws = tts._processing_on */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2085 * # Update Timing Information # * ############################# * if compute_start and ws._processing.get(ts, True): # <<<<<<<<<<<<<< * # Update average task duration for worker * old_duration = ts._prefix._duration_average */ } /* "distributed/scheduler.py":2110 * # Update State Information # * ############################ * if nbytes is not None: # <<<<<<<<<<<<<< * ts.set_nbytes(nbytes) * */ __pyx_t_7 = (__pyx_v_nbytes != Py_None); __pyx_t_5 = (__pyx_t_7 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2111 * ############################ * if nbytes is not None: * ts.set_nbytes(nbytes) # <<<<<<<<<<<<<< * * recommendations: dict = {} */ __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_nbytes); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2111, __pyx_L3_error) __pyx_t_1 = __pyx_f_11distributed_9scheduler_9TaskState_set_nbytes(__pyx_v_ts, __pyx_t_11, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2111, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2110 * # Update State Information # * ############################ * if nbytes is not None: # <<<<<<<<<<<<<< * ts.set_nbytes(nbytes) * */ } /* "distributed/scheduler.py":2113 * ts.set_nbytes(nbytes) * * recommendations: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2113, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_recommendations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2114 * * recommendations: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * _remove_from_processing(self, ts) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2114, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_client_msgs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":2116 * client_msgs: dict = {} * * _remove_from_processing(self, ts) # <<<<<<<<<<<<<< * * _add_to_memory( */ __pyx_t_1 = __pyx_f_11distributed_9scheduler__remove_from_processing(__pyx_v_self, __pyx_v_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2116, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2118 * _remove_from_processing(self, ts) * * _add_to_memory( # <<<<<<<<<<<<<< * self, ts, ws, recommendations, client_msgs, type=type, typename=typename * ) */ __pyx_t_19.__pyx_n = 2; __pyx_t_19.type = __pyx_v_type; __pyx_t_19.typename = __pyx_v_typename; __pyx_t_1 = __pyx_f_11distributed_9scheduler__add_to_memory(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, __pyx_v_recommendations, __pyx_v_client_msgs, &__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2118, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2122 * ) * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._waiting_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2123 * * if self._validate: * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not ts._waiting_on * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2123, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2123, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2124 * if self._validate: * assert not ts._processing_on * assert not ts._waiting_on # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2124, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2122 * ) * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._waiting_on */ } /* "distributed/scheduler.py":2126 * assert not ts._waiting_on * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2126, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2034 * worker_msgs: dict = {} * client_msgs: dict = {} * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * assert worker */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2127 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_processing_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_15, &__pyx_t_10) < 0) __PYX_ERR(0, 2127, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_15); __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_15); __pyx_v_e = __pyx_t_15; /*try:*/ { /* "distributed/scheduler.py":2128 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2128, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exception); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2128, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_8 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_e); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2128, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2129 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2129, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2129, __pyx_L33_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":2130 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_8 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2130, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_pdb = __pyx_t_8; __pyx_t_8 = 0; /* "distributed/scheduler.py":2132 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2132, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_8 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2132, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2129 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2133 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_memory_released(self, key, safe: bint = False): */ __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_15, __pyx_t_10); __pyx_t_1 = 0; __pyx_t_15 = 0; __pyx_t_10 = 0; __PYX_ERR(0, 2133, __pyx_L33_error) } /* "distributed/scheduler.py":2127 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L33_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __pyx_t_9 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27); } __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24); __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2034 * worker_msgs: dict = {} * client_msgs: dict = {} * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * assert worker */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; } /* "distributed/scheduler.py":2020 * raise * * def transition_processing_memory( # <<<<<<<<<<<<<< * self, * key, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(((PyObject *)__pyx_t_18)); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_processing_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_v_wws); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_L); __Pyx_XDECREF(__pyx_v_startstop); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_action); __Pyx_XDECREF(__pyx_v_compute_start); __Pyx_XDECREF(__pyx_v_compute_stop); __Pyx_XDECREF(__pyx_v_new_duration); __Pyx_XDECREF(__pyx_v_avg_duration); __Pyx_XDECREF((PyObject *)__pyx_v_tts); __Pyx_XDECREF(__pyx_v_old); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2135 * raise * * def transition_memory_released(self, key, safe: bint = False): # <<<<<<<<<<<<<< * ws: WorkerState * try: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_17transition_memory_released(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_17transition_memory_released(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; int __pyx_v_safe; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_memory_released (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_safe,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transition_memory_released") < 0)) __PYX_ERR(0, 2135, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; if (values[1]) { __pyx_v_safe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error) } else { __pyx_v_safe = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transition_memory_released", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2135, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_memory_released", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_16transition_memory_released(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_key, __pyx_v_safe); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_16transition_memory_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_v_safe) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_report_msg = NULL; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_t_14; Py_ssize_t __pyx_t_15; struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; char const *__pyx_t_21; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_memory_released", 0); /* "distributed/scheduler.py":2137 * def transition_memory_released(self, key, safe: bint = False): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2138 * ws: WorkerState * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * worker_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2138, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2138, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2138, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2140 * ts: TaskState = self._tasks[key] * dts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2140, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2141 * dts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2141, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2143 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._processing_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2144 * * if self._validate: * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._processing_on * if safe: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2144, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2145 * if self._validate: * assert not ts._waiting_on * assert not ts._processing_on # <<<<<<<<<<<<<< * if safe: * assert not ts._waiters */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2145, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2145, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2146 * assert not ts._waiting_on * assert not ts._processing_on * if safe: # <<<<<<<<<<<<<< * assert not ts._waiters * */ __pyx_t_5 = (__pyx_v_safe != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2147 * assert not ts._processing_on * if safe: * assert not ts._waiters # <<<<<<<<<<<<<< * * if ts._actor: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2147, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2146 * assert not ts._waiting_on * assert not ts._processing_on * if safe: # <<<<<<<<<<<<<< * assert not ts._waiters * */ } /* "distributed/scheduler.py":2143 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._processing_on */ } /* "distributed/scheduler.py":2149 * assert not ts._waiters * * if ts._actor: # <<<<<<<<<<<<<< * for ws in ts._who_has: * ws._actors.discard(ts) */ __pyx_t_5 = (__pyx_v_ts->_actor != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2150 * * if ts._actor: * for ws in ts._who_has: # <<<<<<<<<<<<<< * ws._actors.discard(ts) * if ts._who_wants: */ __pyx_t_6 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_v_ts->_who_has, 1, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2150, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_7, &__pyx_t_6, &__pyx_t_9, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2150, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 2150, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":2151 * if ts._actor: * for ws in ts._who_has: * ws._actors.discard(ts) # <<<<<<<<<<<<<< * if ts._who_wants: * ts._exception_blame = ts */ if (unlikely(__pyx_v_ws->_actors == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2151, __pyx_L3_error) } __pyx_t_11 = __Pyx_PySet_Discard(__pyx_v_ws->_actors, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2151, __pyx_L3_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2152 * for ws in ts._who_has: * ws._actors.discard(ts) * if ts._who_wants: # <<<<<<<<<<<<<< * ts._exception_blame = ts * ts._exception = "Worker holding Actor was lost" */ __pyx_t_5 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2153 * ws._actors.discard(ts) * if ts._who_wants: * ts._exception_blame = ts # <<<<<<<<<<<<<< * ts._exception = "Worker holding Actor was lost" * return ( */ __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); __Pyx_GOTREF(__pyx_v_ts->_exception_blame); __Pyx_DECREF(__pyx_v_ts->_exception_blame); __pyx_v_ts->_exception_blame = ((PyObject *)__pyx_v_ts); /* "distributed/scheduler.py":2154 * if ts._who_wants: * ts._exception_blame = ts * ts._exception = "Worker holding Actor was lost" # <<<<<<<<<<<<<< * return ( * {ts._key: "erred"}, */ __Pyx_INCREF(__pyx_kp_u_Worker_holding_Actor_was_lost); __Pyx_GIVEREF(__pyx_kp_u_Worker_holding_Actor_was_lost); __Pyx_GOTREF(__pyx_v_ts->_exception); __Pyx_DECREF(__pyx_v_ts->_exception); __pyx_v_ts->_exception = __pyx_kp_u_Worker_holding_Actor_was_lost; /* "distributed/scheduler.py":2155 * ts._exception_blame = ts * ts._exception = "Worker holding Actor was lost" * return ( # <<<<<<<<<<<<<< * {ts._key: "erred"}, * worker_msgs, */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":2156 * ts._exception = "Worker holding Actor was lost" * return ( * {ts._key: "erred"}, # <<<<<<<<<<<<<< * worker_msgs, * client_msgs, */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2156, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_v_ts->_key, __pyx_n_u_erred) < 0) __PYX_ERR(0, 2156, __pyx_L3_error) /* "distributed/scheduler.py":2158 * {ts._key: "erred"}, * worker_msgs, * client_msgs, # <<<<<<<<<<<<<< * ) # don't try to recreate * */ __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2156, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_client_msgs); __pyx_t_4 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2152 * for ws in ts._who_has: * ws._actors.discard(ts) * if ts._who_wants: # <<<<<<<<<<<<<< * ts._exception_blame = ts * ts._exception = "Worker holding Actor was lost" */ } /* "distributed/scheduler.py":2149 * assert not ts._waiters * * if ts._actor: # <<<<<<<<<<<<<< * for ws in ts._who_has: * ws._actors.discard(ts) */ } /* "distributed/scheduler.py":2161 * ) # don't try to recreate * * recommendations: dict = {} # <<<<<<<<<<<<<< * * for dts in ts._waiters: */ __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2161, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_recommendations = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2163 * recommendations: dict = {} * * for dts in ts._waiters: # <<<<<<<<<<<<<< * if dts._state in ("no-worker", "processing"): * recommendations[dts._key] = "waiting" */ __pyx_t_7 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_ts->_waiters, 1, (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2163, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_9, __pyx_t_6, &__pyx_t_7, &__pyx_t_4, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2163, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2163, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":2164 * * for dts in ts._waiters: * if dts._state in ("no-worker", "processing"): # <<<<<<<<<<<<<< * recommendations[dts._key] = "waiting" * elif dts._state == "waiting": */ __Pyx_INCREF(__pyx_v_dts->_state); __pyx_t_12 = __pyx_v_dts->_state; __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_kp_u_no_worker, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 2164, __pyx_L3_error) __pyx_t_14 = (__pyx_t_13 != 0); if (!__pyx_t_14) { } else { __pyx_t_5 = __pyx_t_14; goto __pyx_L18_bool_binop_done; } __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 2164, __pyx_L3_error) __pyx_t_13 = (__pyx_t_14 != 0); __pyx_t_5 = __pyx_t_13; __pyx_L18_bool_binop_done:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = (__pyx_t_5 != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":2165 * for dts in ts._waiters: * if dts._state in ("no-worker", "processing"): * recommendations[dts._key] = "waiting" # <<<<<<<<<<<<<< * elif dts._state == "waiting": * dts._waiting_on.add(ts) */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 2165, __pyx_L3_error) /* "distributed/scheduler.py":2164 * * for dts in ts._waiters: * if dts._state in ("no-worker", "processing"): # <<<<<<<<<<<<<< * recommendations[dts._key] = "waiting" * elif dts._state == "waiting": */ goto __pyx_L17; } /* "distributed/scheduler.py":2166 * if dts._state in ("no-worker", "processing"): * recommendations[dts._key] = "waiting" * elif dts._state == "waiting": # <<<<<<<<<<<<<< * dts._waiting_on.add(ts) * */ __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_v_dts->_state, __pyx_n_u_waiting, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 2166, __pyx_L3_error) __pyx_t_5 = (__pyx_t_13 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2167 * recommendations[dts._key] = "waiting" * elif dts._state == "waiting": * dts._waiting_on.add(ts) # <<<<<<<<<<<<<< * * # XXX factor this out? */ if (unlikely(__pyx_v_dts->_waiting_on == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 2167, __pyx_L3_error) } __pyx_t_11 = PySet_Add(__pyx_v_dts->_waiting_on, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2167, __pyx_L3_error) /* "distributed/scheduler.py":2166 * if dts._state in ("no-worker", "processing"): * recommendations[dts._key] = "waiting" * elif dts._state == "waiting": # <<<<<<<<<<<<<< * dts._waiting_on.add(ts) * */ } __pyx_L17:; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2170 * * # XXX factor this out? * for ws in ts._who_has: # <<<<<<<<<<<<<< * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() */ __pyx_t_6 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_ts->_who_has, 1, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2170, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_9, __pyx_t_7, &__pyx_t_6, &__pyx_t_4, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2170, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 2170, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":2171 * # XXX factor this out? * for ws in ts._who_has: * ws._has_what.remove(ts) # <<<<<<<<<<<<<< * ws._nbytes -= ts.get_nbytes() * ts._group._nbytes_in_memory -= ts.get_nbytes() */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 2171, __pyx_L3_error) } __pyx_t_11 = __Pyx_PySet_Remove(__pyx_v_ws->_has_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2171, __pyx_L3_error) /* "distributed/scheduler.py":2172 * for ws in ts._who_has: * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() # <<<<<<<<<<<<<< * ts._group._nbytes_in_memory -= ts.get_nbytes() * worker_msgs[ws._address] = [ */ __pyx_t_15 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L3_error) __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes - __pyx_t_15); /* "distributed/scheduler.py":2173 * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() * ts._group._nbytes_in_memory -= ts.get_nbytes() # <<<<<<<<<<<<<< * worker_msgs[ws._address] = [ * { */ __Pyx_INCREF(((PyObject *)__pyx_v_ts->_group)); __pyx_t_16 = __pyx_v_ts->_group; __pyx_t_15 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2173, __pyx_L3_error) __pyx_t_16->_nbytes_in_memory = (__pyx_t_16->_nbytes_in_memory - __pyx_t_15); __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; /* "distributed/scheduler.py":2176 * worker_msgs[ws._address] = [ * { * "op": "delete-data", # <<<<<<<<<<<<<< * "keys": [key], * "report": False, */ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2176, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_op, __pyx_kp_u_delete_data) < 0) __PYX_ERR(0, 2176, __pyx_L3_error) /* "distributed/scheduler.py":2177 * { * "op": "delete-data", * "keys": [key], # <<<<<<<<<<<<<< * "report": False, * } */ __pyx_t_17 = PyList_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2177, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyList_SET_ITEM(__pyx_t_17, 0, __pyx_v_key); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_keys, __pyx_t_17) < 0) __PYX_ERR(0, 2176, __pyx_L3_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "distributed/scheduler.py":2178 * "op": "delete-data", * "keys": [key], * "report": False, # <<<<<<<<<<<<<< * } * ] */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_report, Py_False) < 0) __PYX_ERR(0, 2176, __pyx_L3_error) /* "distributed/scheduler.py":2174 * ws._nbytes -= ts.get_nbytes() * ts._group._nbytes_in_memory -= ts.get_nbytes() * worker_msgs[ws._address] = [ # <<<<<<<<<<<<<< * { * "op": "delete-data", */ __pyx_t_17 = PyList_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2174, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_17, 0, __pyx_t_4); __pyx_t_4 = 0; if (unlikely(PyDict_SetItem(__pyx_v_worker_msgs, __pyx_v_ws->_address, __pyx_t_17) < 0)) __PYX_ERR(0, 2174, __pyx_L3_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2182 * ] * * ts._who_has.clear() # <<<<<<<<<<<<<< * * ts.state = "released" */ if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 2182, __pyx_L3_error) } __pyx_t_11 = PySet_Clear(__pyx_v_ts->_who_has); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2182, __pyx_L3_error) /* "distributed/scheduler.py":2184 * ts._who_has.clear() * * ts.state = "released" # <<<<<<<<<<<<<< * * report_msg = {"op": "lost-data", "key": key} */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_released) < 0) __PYX_ERR(0, 2184, __pyx_L3_error) /* "distributed/scheduler.py":2186 * ts.state = "released" * * report_msg = {"op": "lost-data", "key": key} # <<<<<<<<<<<<<< * cs: ClientState * for cs in ts._who_wants: */ __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2186, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_op, __pyx_kp_u_lost_data) < 0) __PYX_ERR(0, 2186, __pyx_L3_error) if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_key, __pyx_v_key) < 0) __PYX_ERR(0, 2186, __pyx_L3_error) __pyx_v_report_msg = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2188 * report_msg = {"op": "lost-data", "key": key} * cs: ClientState * for cs in ts._who_wants: # <<<<<<<<<<<<<< * client_msgs[cs._client_key] = [report_msg] * */ __pyx_t_7 = 0; __pyx_t_17 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2188, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = __pyx_t_17; __pyx_t_17 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_9, __pyx_t_6, &__pyx_t_7, &__pyx_t_17, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2188, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_17); if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 2188, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_17)); __pyx_t_17 = 0; /* "distributed/scheduler.py":2189 * cs: ClientState * for cs in ts._who_wants: * client_msgs[cs._client_key] = [report_msg] # <<<<<<<<<<<<<< * * if not ts._run_spec: # pure data */ __pyx_t_17 = PyList_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2189, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_INCREF(__pyx_v_report_msg); __Pyx_GIVEREF(__pyx_v_report_msg); PyList_SET_ITEM(__pyx_t_17, 0, __pyx_v_report_msg); if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_cs->_client_key, __pyx_t_17) < 0)) __PYX_ERR(0, 2189, __pyx_L3_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2191 * client_msgs[cs._client_key] = [report_msg] * * if not ts._run_spec: # pure data # <<<<<<<<<<<<<< * recommendations[key] = "forgotten" * elif ts._has_lost_dependencies: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2191, __pyx_L3_error) __pyx_t_13 = ((!__pyx_t_5) != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":2192 * * if not ts._run_spec: # pure data * recommendations[key] = "forgotten" # <<<<<<<<<<<<<< * elif ts._has_lost_dependencies: * recommendations[key] = "forgotten" */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_forgotten) < 0)) __PYX_ERR(0, 2192, __pyx_L3_error) /* "distributed/scheduler.py":2191 * client_msgs[cs._client_key] = [report_msg] * * if not ts._run_spec: # pure data # <<<<<<<<<<<<<< * recommendations[key] = "forgotten" * elif ts._has_lost_dependencies: */ goto __pyx_L24; } /* "distributed/scheduler.py":2193 * if not ts._run_spec: # pure data * recommendations[key] = "forgotten" * elif ts._has_lost_dependencies: # <<<<<<<<<<<<<< * recommendations[key] = "forgotten" * elif ts._who_wants or ts._waiters: */ __pyx_t_13 = (__pyx_v_ts->_has_lost_dependencies != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":2194 * recommendations[key] = "forgotten" * elif ts._has_lost_dependencies: * recommendations[key] = "forgotten" # <<<<<<<<<<<<<< * elif ts._who_wants or ts._waiters: * recommendations[key] = "waiting" */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_forgotten) < 0)) __PYX_ERR(0, 2194, __pyx_L3_error) /* "distributed/scheduler.py":2193 * if not ts._run_spec: # pure data * recommendations[key] = "forgotten" * elif ts._has_lost_dependencies: # <<<<<<<<<<<<<< * recommendations[key] = "forgotten" * elif ts._who_wants or ts._waiters: */ goto __pyx_L24; } /* "distributed/scheduler.py":2195 * elif ts._has_lost_dependencies: * recommendations[key] = "forgotten" * elif ts._who_wants or ts._waiters: # <<<<<<<<<<<<<< * recommendations[key] = "waiting" * */ __pyx_t_5 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); if (!__pyx_t_5) { } else { __pyx_t_13 = __pyx_t_5; goto __pyx_L25_bool_binop_done; } __pyx_t_5 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); __pyx_t_13 = __pyx_t_5; __pyx_L25_bool_binop_done:; if (__pyx_t_13) { /* "distributed/scheduler.py":2196 * recommendations[key] = "forgotten" * elif ts._who_wants or ts._waiters: * recommendations[key] = "waiting" # <<<<<<<<<<<<<< * * if self._validate: */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 2196, __pyx_L3_error) /* "distributed/scheduler.py":2195 * elif ts._has_lost_dependencies: * recommendations[key] = "forgotten" * elif ts._who_wants or ts._waiters: # <<<<<<<<<<<<<< * recommendations[key] = "waiting" * */ } __pyx_L24:; /* "distributed/scheduler.py":2198 * recommendations[key] = "waiting" * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._waiting_on * */ __pyx_t_13 = (__pyx_v_self->_validate != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":2199 * * if self._validate: * assert not ts._waiting_on # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_13 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_13) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2199, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2198 * recommendations[key] = "waiting" * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._waiting_on * */ } /* "distributed/scheduler.py":2201 * assert not ts._waiting_on * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2201, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2137 * def transition_memory_released(self, key, safe: bint = False): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2202 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_memory_released", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_17, &__pyx_t_4) < 0) __PYX_ERR(0, 2202, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_17); __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_17); __pyx_v_e = __pyx_t_17; /*try:*/ { /* "distributed/scheduler.py":2203 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_logger); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2203, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_exception); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2203, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_19 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_19)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } __pyx_t_18 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_19, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_v_e); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2203, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":2204 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2204, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 2204, __pyx_L33_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__pyx_t_13) { /* "distributed/scheduler.py":2205 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_18 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2205, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_18); __pyx_v_pdb = __pyx_t_18; __pyx_t_18 = 0; /* "distributed/scheduler.py":2207 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2207, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_19)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } __pyx_t_18 = (__pyx_t_19) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19) : __Pyx_PyObject_CallNoArg(__pyx_t_20); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2207, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":2204 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2208 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_released_erred(self, key): */ __Pyx_GIVEREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_17, __pyx_t_4); __pyx_t_9 = 0; __pyx_t_17 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 2208, __pyx_L33_error) } /* "distributed/scheduler.py":2202 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L33_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27); } __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24); __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_21; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2137 * def transition_memory_released(self, key, safe: bint = False): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2135 * raise * * def transition_memory_released(self, key, safe: bint = False): # <<<<<<<<<<<<<< * ws: WorkerState * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(((PyObject *)__pyx_t_16)); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_memory_released", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_report_msg); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2210 * raise * * def transition_released_erred(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_19transition_released_erred(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_19transition_released_erred(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_released_erred (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_18transition_released_erred(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_18transition_released_erred(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_failing_ts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_report_msg = NULL; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; Py_ssize_t __pyx_t_15; Py_ssize_t __pyx_t_16; int __pyx_t_17; int __pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; char const *__pyx_t_21; PyObject *__pyx_t_22 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_released_erred", 0); /* "distributed/scheduler.py":2211 * * def transition_released_erred(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2212 * def transition_released_erred(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * failing_ts: TaskState */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2212, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2212, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2212, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2215 * dts: TaskState * failing_ts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2215, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2216 * failing_ts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2216, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2218 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * with log_errors(pdb=LOG_PDB): * assert ts._exception_blame */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2219 * * if self._validate: * with log_errors(pdb=LOG_PDB): # <<<<<<<<<<<<<< * assert ts._exception_blame * assert not ts._who_has */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2219, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2219, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2219, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pdb, __pyx_t_7) < 0) __PYX_ERR(0, 2219, __pyx_L3_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2219, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2219, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2219, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2219, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "distributed/scheduler.py":2220 * if self._validate: * with log_errors(pdb=LOG_PDB): * assert ts._exception_blame # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._waiting_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_exception_blame); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2220, __pyx_L14_error) if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2220, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2221 * with log_errors(pdb=LOG_PDB): * assert ts._exception_blame * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._waiters */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2221, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2222 * assert ts._exception_blame * assert not ts._who_has * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._waiters * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2222, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2223 * assert not ts._who_has * assert not ts._waiting_on * assert not ts._waiters # <<<<<<<<<<<<<< * * recommendations: dict = {} */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2223, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2219 * * if self._validate: * with log_errors(pdb=LOG_PDB): # <<<<<<<<<<<<<< * assert ts._exception_blame * assert not ts._who_has */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L19_try_end; __pyx_L14_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_released_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 2219, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2219, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2219, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_5 < 0) __PYX_ERR(0, 2219, __pyx_L16_except_error) __pyx_t_14 = ((!(__pyx_t_5 != 0)) != 0); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_6, __pyx_t_4); __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 2219, __pyx_L16_except_error) } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L15_exception_handled; } __pyx_L16_except_error:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L3_error; __pyx_L15_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_L19_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_8) { __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2219, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } goto __pyx_L13; } __pyx_L13:; } goto __pyx_L23; __pyx_L10_error:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L3_error; __pyx_L23:; } /* "distributed/scheduler.py":2218 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * with log_errors(pdb=LOG_PDB): * assert ts._exception_blame */ } /* "distributed/scheduler.py":2225 * assert not ts._waiters * * recommendations: dict = {} # <<<<<<<<<<<<<< * * failing_ts = ts._exception_blame */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2225, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_recommendations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2227 * recommendations: dict = {} * * failing_ts = ts._exception_blame # <<<<<<<<<<<<<< * * for dts in ts._dependents: */ if (!(likely(((__pyx_v_ts->_exception_blame) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ts->_exception_blame, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2227, __pyx_L3_error) __pyx_t_4 = __pyx_v_ts->_exception_blame; __Pyx_INCREF(__pyx_t_4); __pyx_v_failing_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2229 * failing_ts = ts._exception_blame * * for dts in ts._dependents: # <<<<<<<<<<<<<< * dts._exception_blame = failing_ts * if not dts._who_has: */ __pyx_t_15 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_dependents, 1, (&__pyx_t_16), (&__pyx_t_17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2229, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_18 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_16, &__pyx_t_15, &__pyx_t_6, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 2229, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2229, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":2230 * * for dts in ts._dependents: * dts._exception_blame = failing_ts # <<<<<<<<<<<<<< * if not dts._who_has: * recommendations[dts._key] = "erred" */ __Pyx_INCREF(((PyObject *)__pyx_v_failing_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_failing_ts)); __Pyx_GOTREF(__pyx_v_dts->_exception_blame); __Pyx_DECREF(__pyx_v_dts->_exception_blame); __pyx_v_dts->_exception_blame = ((PyObject *)__pyx_v_failing_ts); /* "distributed/scheduler.py":2231 * for dts in ts._dependents: * dts._exception_blame = failing_ts * if not dts._who_has: # <<<<<<<<<<<<<< * recommendations[dts._key] = "erred" * */ __pyx_t_14 = (__pyx_v_dts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_has) != 0); __pyx_t_5 = ((!__pyx_t_14) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2232 * dts._exception_blame = failing_ts * if not dts._who_has: * recommendations[dts._key] = "erred" # <<<<<<<<<<<<<< * * report_msg = { */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_erred) < 0)) __PYX_ERR(0, 2232, __pyx_L3_error) /* "distributed/scheduler.py":2231 * for dts in ts._dependents: * dts._exception_blame = failing_ts * if not dts._who_has: # <<<<<<<<<<<<<< * recommendations[dts._key] = "erred" * */ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2235 * * report_msg = { * "op": "task-erred", # <<<<<<<<<<<<<< * "key": key, * "exception": failing_ts._exception, */ __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2235, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_op, __pyx_kp_u_task_erred) < 0) __PYX_ERR(0, 2235, __pyx_L3_error) /* "distributed/scheduler.py":2236 * report_msg = { * "op": "task-erred", * "key": key, # <<<<<<<<<<<<<< * "exception": failing_ts._exception, * "traceback": failing_ts._traceback, */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_key, __pyx_v_key) < 0) __PYX_ERR(0, 2235, __pyx_L3_error) /* "distributed/scheduler.py":2237 * "op": "task-erred", * "key": key, * "exception": failing_ts._exception, # <<<<<<<<<<<<<< * "traceback": failing_ts._traceback, * } */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_exception, __pyx_v_failing_ts->_exception) < 0) __PYX_ERR(0, 2235, __pyx_L3_error) /* "distributed/scheduler.py":2238 * "key": key, * "exception": failing_ts._exception, * "traceback": failing_ts._traceback, # <<<<<<<<<<<<<< * } * cs: ClientState */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_traceback, __pyx_v_failing_ts->_traceback) < 0) __PYX_ERR(0, 2235, __pyx_L3_error) __pyx_v_report_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2241 * } * cs: ClientState * for cs in ts._who_wants: # <<<<<<<<<<<<<< * client_msgs[cs._client_key] = [report_msg] * */ __pyx_t_16 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_15), (&__pyx_t_17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2241, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_18 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_15, &__pyx_t_16, &__pyx_t_6, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 2241, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 2241, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":2242 * cs: ClientState * for cs in ts._who_wants: * client_msgs[cs._client_key] = [report_msg] # <<<<<<<<<<<<<< * * ts.state = "erred" */ __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2242, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_report_msg); __Pyx_GIVEREF(__pyx_v_report_msg); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_report_msg); if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_cs->_client_key, __pyx_t_6) < 0)) __PYX_ERR(0, 2242, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2244 * client_msgs[cs._client_key] = [report_msg] * * ts.state = "erred" # <<<<<<<<<<<<<< * * # TODO: waiting data? */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_erred) < 0) __PYX_ERR(0, 2244, __pyx_L3_error) /* "distributed/scheduler.py":2247 * * # TODO: waiting data? * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2247, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2211 * * def transition_released_erred(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2248 * # TODO: waiting data? * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_17) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_released_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 2248, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "distributed/scheduler.py":2249 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_logger); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2249, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_exception); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2249, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_19 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_19)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } __pyx_t_9 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_19, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_v_e); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2249, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2250 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2250, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2250, __pyx_L34_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":2251 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_9 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2251, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_pdb = __pyx_t_9; __pyx_t_9 = 0; /* "distributed/scheduler.py":2253 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2253, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_19)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } __pyx_t_9 = (__pyx_t_19) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19) : __Pyx_PyObject_CallNoArg(__pyx_t_20); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2253, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2250 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2254 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_erred_released(self, key): */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_7); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __PYX_ERR(0, 2254, __pyx_L34_error) } /* "distributed/scheduler.py":2248 * # TODO: waiting data? * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L34_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_13, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_12, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_17 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_13, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_12, __pyx_t_11); __pyx_t_8 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_21; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2211 * * def transition_released_erred(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2210 * raise * * def transition_released_erred(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_released_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_v_failing_ts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_report_msg); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2256 * raise * * def transition_erred_released(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_21transition_erred_released(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_21transition_erred_released(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_erred_released (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_20transition_erred_released(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_20transition_erred_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_report_msg = NULL; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr23__pyx_v_dts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; int __pyx_t_15; int __pyx_t_16; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; char const *__pyx_t_21; PyObject *__pyx_t_22 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_erred_released", 0); /* "distributed/scheduler.py":2257 * * def transition_erred_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2258 * def transition_erred_released(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * worker_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2258, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2258, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2258, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2260 * ts: TaskState = self._tasks[key] * dts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2260, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2261 * dts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2261, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2263 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * with log_errors(pdb=LOG_PDB): * assert all([dts._state != "erred" for dts in ts._dependencies]) */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2264 * * if self._validate: * with log_errors(pdb=LOG_PDB): # <<<<<<<<<<<<<< * assert all([dts._state != "erred" for dts in ts._dependencies]) * assert ts._exception_blame */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pdb, __pyx_t_7) < 0) __PYX_ERR(0, 2264, __pyx_L3_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2264, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2264, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "distributed/scheduler.py":2265 * if self._validate: * with log_errors(pdb=LOG_PDB): * assert all([dts._state != "erred" for dts in ts._dependencies]) # <<<<<<<<<<<<<< * assert ts._exception_blame * assert not ts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { { /* enter inner scope */ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2265, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_14), (&__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2265, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_16 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_14, &__pyx_t_13, &__pyx_t_4, __pyx_t_15); if (unlikely(__pyx_t_16 == 0)) break; if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 2265, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2265, __pyx_L22_error) __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_9genexpr23__pyx_v_dts->_state, __pyx_n_u_erred, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2265, __pyx_L22_error) __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2265, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2265, __pyx_L22_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr23__pyx_v_dts); __pyx_9genexpr23__pyx_v_dts = 0; goto __pyx_L25_exit_scope; __pyx_L22_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr23__pyx_v_dts); __pyx_9genexpr23__pyx_v_dts = 0; goto __pyx_L14_error; __pyx_L25_exit_scope:; } /* exit inner scope */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2265, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2265, __pyx_L14_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2265, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2266 * with log_errors(pdb=LOG_PDB): * assert all([dts._state != "erred" for dts in ts._dependencies]) * assert ts._exception_blame # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._waiting_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_exception_blame); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2266, __pyx_L14_error) if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2266, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2267 * assert all([dts._state != "erred" for dts in ts._dependencies]) * assert ts._exception_blame * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._waiters */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2267, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2268 * assert ts._exception_blame * assert not ts._who_has * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._waiters * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2268, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2269 * assert not ts._who_has * assert not ts._waiting_on * assert not ts._waiters # <<<<<<<<<<<<<< * * recommendations: dict = {} */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2269, __pyx_L14_error) } } #endif /* "distributed/scheduler.py":2264 * * if self._validate: * with log_errors(pdb=LOG_PDB): # <<<<<<<<<<<<<< * assert all([dts._state != "erred" for dts in ts._dependencies]) * assert ts._exception_blame */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L19_try_end; __pyx_L14_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_erred_released", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(0, 2264, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2264, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2264, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_5 < 0) __PYX_ERR(0, 2264, __pyx_L16_except_error) __pyx_t_18 = ((!(__pyx_t_5 != 0)) != 0); if (__pyx_t_18) { __Pyx_GIVEREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_7, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 2264, __pyx_L16_except_error) } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L15_exception_handled; } __pyx_L16_except_error:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L3_error; __pyx_L15_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_L19_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_8) { __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } goto __pyx_L13; } __pyx_L13:; } goto __pyx_L29; __pyx_L10_error:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L3_error; __pyx_L29:; } /* "distributed/scheduler.py":2263 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * with log_errors(pdb=LOG_PDB): * assert all([dts._state != "erred" for dts in ts._dependencies]) */ } /* "distributed/scheduler.py":2271 * assert not ts._waiters * * recommendations: dict = {} # <<<<<<<<<<<<<< * * ts._exception = None */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2271, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_recommendations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2273 * recommendations: dict = {} * * ts._exception = None # <<<<<<<<<<<<<< * ts._exception_blame = None * ts._traceback = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_ts->_exception); __Pyx_DECREF(__pyx_v_ts->_exception); __pyx_v_ts->_exception = Py_None; /* "distributed/scheduler.py":2274 * * ts._exception = None * ts._exception_blame = None # <<<<<<<<<<<<<< * ts._traceback = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_ts->_exception_blame); __Pyx_DECREF(__pyx_v_ts->_exception_blame); __pyx_v_ts->_exception_blame = Py_None; /* "distributed/scheduler.py":2275 * ts._exception = None * ts._exception_blame = None * ts._traceback = None # <<<<<<<<<<<<<< * * for dts in ts._dependents: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_ts->_traceback); __Pyx_DECREF(__pyx_v_ts->_traceback); __pyx_v_ts->_traceback = Py_None; /* "distributed/scheduler.py":2277 * ts._traceback = None * * for dts in ts._dependents: # <<<<<<<<<<<<<< * if dts._state == "erred": * recommendations[dts._key] = "waiting" */ __pyx_t_14 = 0; __pyx_t_7 = __Pyx_set_iterator(__pyx_v_ts->_dependents, 1, (&__pyx_t_13), (&__pyx_t_15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2277, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_16 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_13, &__pyx_t_14, &__pyx_t_7, __pyx_t_15); if (unlikely(__pyx_t_16 == 0)) break; if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 2277, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2277, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_7)); __pyx_t_7 = 0; /* "distributed/scheduler.py":2278 * * for dts in ts._dependents: * if dts._state == "erred": # <<<<<<<<<<<<<< * recommendations[dts._key] = "waiting" * */ __pyx_t_18 = (__Pyx_PyUnicode_Equals(__pyx_v_dts->_state, __pyx_n_u_erred, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 2278, __pyx_L3_error) __pyx_t_5 = (__pyx_t_18 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2279 * for dts in ts._dependents: * if dts._state == "erred": * recommendations[dts._key] = "waiting" # <<<<<<<<<<<<<< * * report_msg = {"op": "task-retried", "key": key} */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 2279, __pyx_L3_error) /* "distributed/scheduler.py":2278 * * for dts in ts._dependents: * if dts._state == "erred": # <<<<<<<<<<<<<< * recommendations[dts._key] = "waiting" * */ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2281 * recommendations[dts._key] = "waiting" * * report_msg = {"op": "task-retried", "key": key} # <<<<<<<<<<<<<< * cs: ClientState * for cs in ts._who_wants: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2281, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_op, __pyx_kp_u_task_retried) < 0) __PYX_ERR(0, 2281, __pyx_L3_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_key, __pyx_v_key) < 0) __PYX_ERR(0, 2281, __pyx_L3_error) __pyx_v_report_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2283 * report_msg = {"op": "task-retried", "key": key} * cs: ClientState * for cs in ts._who_wants: # <<<<<<<<<<<<<< * client_msgs[cs._client_key] = [report_msg] * */ __pyx_t_13 = 0; __pyx_t_7 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_14), (&__pyx_t_15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2283, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_16 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_14, &__pyx_t_13, &__pyx_t_7, __pyx_t_15); if (unlikely(__pyx_t_16 == 0)) break; if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 2283, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 2283, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_7)); __pyx_t_7 = 0; /* "distributed/scheduler.py":2284 * cs: ClientState * for cs in ts._who_wants: * client_msgs[cs._client_key] = [report_msg] # <<<<<<<<<<<<<< * * ts.state = "released" */ __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2284, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_report_msg); __Pyx_GIVEREF(__pyx_v_report_msg); PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_report_msg); if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_cs->_client_key, __pyx_t_7) < 0)) __PYX_ERR(0, 2284, __pyx_L3_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2286 * client_msgs[cs._client_key] = [report_msg] * * ts.state = "released" # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_released) < 0) __PYX_ERR(0, 2286, __pyx_L3_error) /* "distributed/scheduler.py":2288 * ts.state = "released" * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2288, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2257 * * def transition_erred_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2289 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_15) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_erred_released", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(0, 2289, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_v_e = __pyx_t_7; /*try:*/ { /* "distributed/scheduler.py":2290 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_logger); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2290, __pyx_L40_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_exception); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2290, __pyx_L40_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_19 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_19)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } __pyx_t_9 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_19, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_v_e); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2290, __pyx_L40_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2291 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2291, __pyx_L40_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2291, __pyx_L40_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":2292 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_9 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2292, __pyx_L40_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_pdb = __pyx_t_9; __pyx_t_9 = 0; /* "distributed/scheduler.py":2294 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2294, __pyx_L40_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_19)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } __pyx_t_9 = (__pyx_t_19) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19) : __Pyx_PyObject_CallNoArg(__pyx_t_20); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2294, __pyx_L40_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2291 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2295 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_waiting_released(self, key): */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __PYX_ERR(0, 2295, __pyx_L40_error) } /* "distributed/scheduler.py":2289 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L40_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_17, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_12, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_15 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_17, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_12, __pyx_t_11); __pyx_t_8 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_21; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2257 * * def transition_erred_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2256 * raise * * def transition_erred_released(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_erred_released", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_report_msg); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XDECREF((PyObject *)__pyx_9genexpr23__pyx_v_dts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2297 * raise * * def transition_waiting_released(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_23transition_waiting_released(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_23transition_waiting_released(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_waiting_released (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_22transition_waiting_released(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_22transition_waiting_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_s = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_waiting_released", 0); /* "distributed/scheduler.py":2298 * * def transition_waiting_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2299 * def transition_waiting_released(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * worker_msgs: dict = {} * client_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2299, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2299, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2299, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2300 * try: * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2300, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2301 * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2301, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2303 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._processing_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2304 * * if self._validate: * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._processing_on * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2304, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2305 * if self._validate: * assert not ts._who_has * assert not ts._processing_on # <<<<<<<<<<<<<< * * recommendations: dict = {} */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2305, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2305, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2303 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._processing_on */ } /* "distributed/scheduler.py":2307 * assert not ts._processing_on * * recommendations: dict = {} # <<<<<<<<<<<<<< * * dts: TaskState */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2307, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_recommendations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2310 * * dts: TaskState * for dts in ts._dependencies: # <<<<<<<<<<<<<< * s = dts._waiters * if ts in s: */ __pyx_t_6 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2310, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_7, &__pyx_t_6, &__pyx_t_9, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2310, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2310, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":2311 * dts: TaskState * for dts in ts._dependencies: * s = dts._waiters # <<<<<<<<<<<<<< * if ts in s: * s.discard(ts) */ __pyx_t_9 = __pyx_v_dts->_waiters; __Pyx_INCREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":2312 * for dts in ts._dependencies: * s = dts._waiters * if ts in s: # <<<<<<<<<<<<<< * s.discard(ts) * if not s and not dts._who_wants: */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2312, __pyx_L3_error) } __pyx_t_5 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_s, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2312, __pyx_L3_error) __pyx_t_11 = (__pyx_t_5 != 0); if (__pyx_t_11) { /* "distributed/scheduler.py":2313 * s = dts._waiters * if ts in s: * s.discard(ts) # <<<<<<<<<<<<<< * if not s and not dts._who_wants: * recommendations[dts._key] = "released" */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2313, __pyx_L3_error) } __pyx_t_12 = __Pyx_PySet_Discard(__pyx_v_s, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2313, __pyx_L3_error) /* "distributed/scheduler.py":2314 * if ts in s: * s.discard(ts) * if not s and not dts._who_wants: # <<<<<<<<<<<<<< * recommendations[dts._key] = "released" * ts._waiting_on.clear() */ __pyx_t_5 = (__pyx_v_s != Py_None)&&(PySet_GET_SIZE(__pyx_v_s) != 0); __pyx_t_13 = ((!__pyx_t_5) != 0); if (__pyx_t_13) { } else { __pyx_t_11 = __pyx_t_13; goto __pyx_L14_bool_binop_done; } __pyx_t_13 = (__pyx_v_dts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_wants) != 0); __pyx_t_5 = ((!__pyx_t_13) != 0); __pyx_t_11 = __pyx_t_5; __pyx_L14_bool_binop_done:; if (__pyx_t_11) { /* "distributed/scheduler.py":2315 * s.discard(ts) * if not s and not dts._who_wants: * recommendations[dts._key] = "released" # <<<<<<<<<<<<<< * ts._waiting_on.clear() * */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 2315, __pyx_L3_error) /* "distributed/scheduler.py":2314 * if ts in s: * s.discard(ts) * if not s and not dts._who_wants: # <<<<<<<<<<<<<< * recommendations[dts._key] = "released" * ts._waiting_on.clear() */ } /* "distributed/scheduler.py":2312 * for dts in ts._dependencies: * s = dts._waiters * if ts in s: # <<<<<<<<<<<<<< * s.discard(ts) * if not s and not dts._who_wants: */ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2316 * if not s and not dts._who_wants: * recommendations[dts._key] = "released" * ts._waiting_on.clear() # <<<<<<<<<<<<<< * * ts.state = "released" */ if (unlikely(__pyx_v_ts->_waiting_on == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 2316, __pyx_L3_error) } __pyx_t_12 = PySet_Clear(__pyx_v_ts->_waiting_on); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2316, __pyx_L3_error) /* "distributed/scheduler.py":2318 * ts._waiting_on.clear() * * ts.state = "released" # <<<<<<<<<<<<<< * * if ts._has_lost_dependencies: */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_released) < 0) __PYX_ERR(0, 2318, __pyx_L3_error) /* "distributed/scheduler.py":2320 * ts.state = "released" * * if ts._has_lost_dependencies: # <<<<<<<<<<<<<< * recommendations[key] = "forgotten" * elif not ts._exception_blame and (ts._who_wants or ts._waiters): */ __pyx_t_11 = (__pyx_v_ts->_has_lost_dependencies != 0); if (__pyx_t_11) { /* "distributed/scheduler.py":2321 * * if ts._has_lost_dependencies: * recommendations[key] = "forgotten" # <<<<<<<<<<<<<< * elif not ts._exception_blame and (ts._who_wants or ts._waiters): * recommendations[key] = "waiting" */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_forgotten) < 0)) __PYX_ERR(0, 2321, __pyx_L3_error) /* "distributed/scheduler.py":2320 * ts.state = "released" * * if ts._has_lost_dependencies: # <<<<<<<<<<<<<< * recommendations[key] = "forgotten" * elif not ts._exception_blame and (ts._who_wants or ts._waiters): */ goto __pyx_L16; } /* "distributed/scheduler.py":2322 * if ts._has_lost_dependencies: * recommendations[key] = "forgotten" * elif not ts._exception_blame and (ts._who_wants or ts._waiters): # <<<<<<<<<<<<<< * recommendations[key] = "waiting" * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_exception_blame); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2322, __pyx_L3_error) __pyx_t_13 = ((!__pyx_t_5) != 0); if (__pyx_t_13) { } else { __pyx_t_11 = __pyx_t_13; goto __pyx_L17_bool_binop_done; } __pyx_t_13 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); if (!__pyx_t_13) { } else { __pyx_t_11 = __pyx_t_13; goto __pyx_L17_bool_binop_done; } __pyx_t_13 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); __pyx_t_11 = __pyx_t_13; __pyx_L17_bool_binop_done:; if (__pyx_t_11) { /* "distributed/scheduler.py":2323 * recommendations[key] = "forgotten" * elif not ts._exception_blame and (ts._who_wants or ts._waiters): * recommendations[key] = "waiting" # <<<<<<<<<<<<<< * else: * ts._waiters.clear() */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 2323, __pyx_L3_error) /* "distributed/scheduler.py":2322 * if ts._has_lost_dependencies: * recommendations[key] = "forgotten" * elif not ts._exception_blame and (ts._who_wants or ts._waiters): # <<<<<<<<<<<<<< * recommendations[key] = "waiting" * else: */ goto __pyx_L16; } /* "distributed/scheduler.py":2325 * recommendations[key] = "waiting" * else: * ts._waiters.clear() # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ /*else*/ { if (unlikely(__pyx_v_ts->_waiters == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 2325, __pyx_L3_error) } __pyx_t_12 = PySet_Clear(__pyx_v_ts->_waiters); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2325, __pyx_L3_error) } __pyx_L16:; /* "distributed/scheduler.py":2327 * ts._waiters.clear() * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2327, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2298 * * def transition_waiting_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2328 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_waiting_released", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_14) < 0) __PYX_ERR(0, 2328, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_9); __pyx_v_e = __pyx_t_9; /*try:*/ { /* "distributed/scheduler.py":2329 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2329, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_exception); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2329, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_16, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_e); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2329, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2330 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2330, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 2330, __pyx_L25_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_11) { /* "distributed/scheduler.py":2331 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_15 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2331, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_15); __pyx_v_pdb = __pyx_t_15; __pyx_t_15 = 0; /* "distributed/scheduler.py":2333 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2333, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_17); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2333, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2330 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2334 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_processing_released(self, key): */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_9, __pyx_t_14); __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_14 = 0; __PYX_ERR(0, 2334, __pyx_L25_error) } /* "distributed/scheduler.py":2328 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L25_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_18; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2298 * * def transition_waiting_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2297 * raise * * def transition_waiting_released(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_waiting_released", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2336 * raise * * def transition_processing_released(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_25transition_processing_released(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_25transition_processing_released(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_processing_released (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_24transition_processing_released(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_24transition_processing_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_w = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_s = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_processing_released", 0); /* "distributed/scheduler.py":2337 * * def transition_processing_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2338 * def transition_processing_released(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * worker_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2338, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2338, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2338, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2340 * ts: TaskState = self._tasks[key] * dts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2340, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2341 * dts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2341, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2343 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts._processing_on * assert not ts._who_has */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2344 * * if self._validate: * assert ts._processing_on # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._waiting_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2344, __pyx_L3_error) if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2344, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2345 * if self._validate: * assert ts._processing_on * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert self._tasks[key].state == "processing" */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2345, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2346 * assert ts._processing_on * assert not ts._who_has * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert self._tasks[key].state == "processing" * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2346, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2347 * assert not ts._who_has * assert not ts._waiting_on * assert self._tasks[key].state == "processing" # <<<<<<<<<<<<<< * * w: str = _remove_from_processing(self, ts) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2347, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2347, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2347, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2347, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2347, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2343 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts._processing_on * assert not ts._who_has */ } /* "distributed/scheduler.py":2349 * assert self._tasks[key].state == "processing" * * w: str = _remove_from_processing(self, ts) # <<<<<<<<<<<<<< * if w: * worker_msgs[w] = [{"op": "release-task", "key": key}] */ __pyx_t_6 = __pyx_f_11distributed_9scheduler__remove_from_processing(__pyx_v_self, __pyx_v_ts); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2349, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_w = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":2350 * * w: str = _remove_from_processing(self, ts) * if w: # <<<<<<<<<<<<<< * worker_msgs[w] = [{"op": "release-task", "key": key}] * */ __pyx_t_5 = (__pyx_v_w != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_w) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2351 * w: str = _remove_from_processing(self, ts) * if w: * worker_msgs[w] = [{"op": "release-task", "key": key}] # <<<<<<<<<<<<<< * * ts.state = "released" */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2351, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_op, __pyx_kp_u_release_task) < 0) __PYX_ERR(0, 2351, __pyx_L3_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_key, __pyx_v_key) < 0) __PYX_ERR(0, 2351, __pyx_L3_error) __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2351, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; if (unlikely(PyDict_SetItem(__pyx_v_worker_msgs, __pyx_v_w, __pyx_t_4) < 0)) __PYX_ERR(0, 2351, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2350 * * w: str = _remove_from_processing(self, ts) * if w: # <<<<<<<<<<<<<< * worker_msgs[w] = [{"op": "release-task", "key": key}] * */ } /* "distributed/scheduler.py":2353 * worker_msgs[w] = [{"op": "release-task", "key": key}] * * ts.state = "released" # <<<<<<<<<<<<<< * * recommendations: dict = {} */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_released) < 0) __PYX_ERR(0, 2353, __pyx_L3_error) /* "distributed/scheduler.py":2355 * ts.state = "released" * * recommendations: dict = {} # <<<<<<<<<<<<<< * * if ts._has_lost_dependencies: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2355, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_recommendations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2357 * recommendations: dict = {} * * if ts._has_lost_dependencies: # <<<<<<<<<<<<<< * recommendations[key] = "forgotten" * elif ts._waiters or ts._who_wants: */ __pyx_t_5 = (__pyx_v_ts->_has_lost_dependencies != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2358 * * if ts._has_lost_dependencies: * recommendations[key] = "forgotten" # <<<<<<<<<<<<<< * elif ts._waiters or ts._who_wants: * recommendations[key] = "waiting" */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_forgotten) < 0)) __PYX_ERR(0, 2358, __pyx_L3_error) /* "distributed/scheduler.py":2357 * recommendations: dict = {} * * if ts._has_lost_dependencies: # <<<<<<<<<<<<<< * recommendations[key] = "forgotten" * elif ts._waiters or ts._who_wants: */ goto __pyx_L11; } /* "distributed/scheduler.py":2359 * if ts._has_lost_dependencies: * recommendations[key] = "forgotten" * elif ts._waiters or ts._who_wants: # <<<<<<<<<<<<<< * recommendations[key] = "waiting" * */ __pyx_t_7 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); if (!__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L12_bool_binop_done; } __pyx_t_7 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); __pyx_t_5 = __pyx_t_7; __pyx_L12_bool_binop_done:; if (__pyx_t_5) { /* "distributed/scheduler.py":2360 * recommendations[key] = "forgotten" * elif ts._waiters or ts._who_wants: * recommendations[key] = "waiting" # <<<<<<<<<<<<<< * * if recommendations.get(key) != "waiting": */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 2360, __pyx_L3_error) /* "distributed/scheduler.py":2359 * if ts._has_lost_dependencies: * recommendations[key] = "forgotten" * elif ts._waiters or ts._who_wants: # <<<<<<<<<<<<<< * recommendations[key] = "waiting" * */ } __pyx_L11:; /* "distributed/scheduler.py":2362 * recommendations[key] = "waiting" * * if recommendations.get(key) != "waiting": # <<<<<<<<<<<<<< * for dts in ts._dependencies: * if dts._state != "released": */ __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_recommendations, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_waiting, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2362, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":2363 * * if recommendations.get(key) != "waiting": * for dts in ts._dependencies: # <<<<<<<<<<<<<< * if dts._state != "released": * s = dts._waiters */ __pyx_t_8 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2363, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_9, &__pyx_t_8, &__pyx_t_6, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 2363, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2363, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":2364 * if recommendations.get(key) != "waiting": * for dts in ts._dependencies: * if dts._state != "released": # <<<<<<<<<<<<<< * s = dts._waiters * s.discard(ts) */ __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_dts->_state, __pyx_n_u_released, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2364, __pyx_L3_error) __pyx_t_7 = (__pyx_t_5 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":2365 * for dts in ts._dependencies: * if dts._state != "released": * s = dts._waiters # <<<<<<<<<<<<<< * s.discard(ts) * if not s and not dts._who_wants: */ __pyx_t_6 = __pyx_v_dts->_waiters; __Pyx_INCREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":2366 * if dts._state != "released": * s = dts._waiters * s.discard(ts) # <<<<<<<<<<<<<< * if not s and not dts._who_wants: * recommendations[dts._key] = "released" */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2366, __pyx_L3_error) } __pyx_t_12 = __Pyx_PySet_Discard(__pyx_v_s, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2366, __pyx_L3_error) /* "distributed/scheduler.py":2367 * s = dts._waiters * s.discard(ts) * if not s and not dts._who_wants: # <<<<<<<<<<<<<< * recommendations[dts._key] = "released" * ts._waiters.clear() */ __pyx_t_5 = (__pyx_v_s != Py_None)&&(PySet_GET_SIZE(__pyx_v_s) != 0); __pyx_t_13 = ((!__pyx_t_5) != 0); if (__pyx_t_13) { } else { __pyx_t_7 = __pyx_t_13; goto __pyx_L19_bool_binop_done; } __pyx_t_13 = (__pyx_v_dts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_wants) != 0); __pyx_t_5 = ((!__pyx_t_13) != 0); __pyx_t_7 = __pyx_t_5; __pyx_L19_bool_binop_done:; if (__pyx_t_7) { /* "distributed/scheduler.py":2368 * s.discard(ts) * if not s and not dts._who_wants: * recommendations[dts._key] = "released" # <<<<<<<<<<<<<< * ts._waiters.clear() * */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 2368, __pyx_L3_error) /* "distributed/scheduler.py":2367 * s = dts._waiters * s.discard(ts) * if not s and not dts._who_wants: # <<<<<<<<<<<<<< * recommendations[dts._key] = "released" * ts._waiters.clear() */ } /* "distributed/scheduler.py":2364 * if recommendations.get(key) != "waiting": * for dts in ts._dependencies: * if dts._state != "released": # <<<<<<<<<<<<<< * s = dts._waiters * s.discard(ts) */ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2369 * if not s and not dts._who_wants: * recommendations[dts._key] = "released" * ts._waiters.clear() # <<<<<<<<<<<<<< * * if self._validate: */ if (unlikely(__pyx_v_ts->_waiters == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 2369, __pyx_L3_error) } __pyx_t_12 = PySet_Clear(__pyx_v_ts->_waiters); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2369, __pyx_L3_error) /* "distributed/scheduler.py":2362 * recommendations[key] = "waiting" * * if recommendations.get(key) != "waiting": # <<<<<<<<<<<<<< * for dts in ts._dependencies: * if dts._state != "released": */ } /* "distributed/scheduler.py":2371 * ts._waiters.clear() * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * */ __pyx_t_7 = (__pyx_v_self->_validate != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":2372 * * if self._validate: * assert not ts._processing_on # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2372, __pyx_L3_error) if (unlikely(!((!__pyx_t_7) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2372, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2371 * ts._waiters.clear() * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * */ } /* "distributed/scheduler.py":2374 * assert not ts._processing_on * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2374, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2337 * * def transition_processing_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":2375 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_processing_released", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_14) < 0) __PYX_ERR(0, 2375, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "distributed/scheduler.py":2376 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2376, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_exception); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2376, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_16, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_e); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2376, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2377 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2377, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2377, __pyx_L27_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_7) { /* "distributed/scheduler.py":2378 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_15 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2378, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_15); __pyx_v_pdb = __pyx_t_15; __pyx_t_15 = 0; /* "distributed/scheduler.py":2380 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2380, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_17); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2380, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2377 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2381 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_processing_erred( */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_14); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_14 = 0; __PYX_ERR(0, 2381, __pyx_L27_error) } /* "distributed/scheduler.py":2375 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L27_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_18; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2337 * * def transition_processing_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2336 * raise * * def transition_processing_released(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_processing_released", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2383 * raise * * def transition_processing_erred( # <<<<<<<<<<<<<< * self, key, cause=None, exception=None, traceback=None, **kwargs * ): */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_27transition_processing_erred(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_27transition_processing_erred(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_cause = 0; PyObject *__pyx_v_exception = 0; PyObject *__pyx_v_traceback = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_processing_erred (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_cause,&__pyx_n_s_exception,&__pyx_n_s_traceback,0}; PyObject* values[4] = {0,0,0,0}; /* "distributed/scheduler.py":2384 * * def transition_processing_erred( * self, key, cause=None, exception=None, traceback=None, **kwargs # <<<<<<<<<<<<<< * ): * ws: WorkerState */ values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cause); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_traceback); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "transition_processing_erred") < 0)) __PYX_ERR(0, 2383, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_cause = values[1]; __pyx_v_exception = values[2]; __pyx_v_traceback = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transition_processing_erred", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2383, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_processing_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_26transition_processing_erred(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_key, __pyx_v_cause, __pyx_v_exception, __pyx_v_traceback, __pyx_v_kwargs); /* "distributed/scheduler.py":2383 * raise * * def transition_processing_erred( # <<<<<<<<<<<<<< * self, key, cause=None, exception=None, traceback=None, **kwargs * ): */ /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_26transition_processing_erred(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_cause, PyObject *__pyx_v_exception, PyObject *__pyx_v_traceback, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_failing_ts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_s = NULL; PyObject *__pyx_v_report_msg = NULL; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_processing_erred", 0); /* "distributed/scheduler.py":2387 * ): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2388 * ws: WorkerState * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * failing_ts: TaskState */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2388, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2388, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2388, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2391 * dts: TaskState * failing_ts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2391, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2392 * failing_ts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2392, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2394 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert cause or ts._exception_blame * assert ts._processing_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2395 * * if self._validate: * assert cause or ts._exception_blame # <<<<<<<<<<<<<< * assert ts._processing_on * assert not ts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_cause); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2395, __pyx_L3_error) if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L10_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_exception_blame); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2395, __pyx_L3_error) __pyx_t_5 = __pyx_t_6; __pyx_L10_bool_binop_done:; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2395, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2396 * if self._validate: * assert cause or ts._exception_blame * assert ts._processing_on # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._waiting_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2396, __pyx_L3_error) if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2396, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2397 * assert cause or ts._exception_blame * assert ts._processing_on * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._waiting_on * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2397, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2398 * assert ts._processing_on * assert not ts._who_has * assert not ts._waiting_on # <<<<<<<<<<<<<< * * if ts._actor: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2398, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2394 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert cause or ts._exception_blame * assert ts._processing_on */ } /* "distributed/scheduler.py":2400 * assert not ts._waiting_on * * if ts._actor: # <<<<<<<<<<<<<< * ws = ts._processing_on * ws._actors.remove(ts) */ __pyx_t_5 = (__pyx_v_ts->_actor != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2401 * * if ts._actor: * ws = ts._processing_on # <<<<<<<<<<<<<< * ws._actors.remove(ts) * */ __pyx_t_4 = ((PyObject *)__pyx_v_ts->_processing_on); __Pyx_INCREF(__pyx_t_4); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2402 * if ts._actor: * ws = ts._processing_on * ws._actors.remove(ts) # <<<<<<<<<<<<<< * * _remove_from_processing(self, ts) */ if (unlikely(__pyx_v_ws->_actors == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 2402, __pyx_L3_error) } __pyx_t_7 = __Pyx_PySet_Remove(__pyx_v_ws->_actors, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2402, __pyx_L3_error) /* "distributed/scheduler.py":2400 * assert not ts._waiting_on * * if ts._actor: # <<<<<<<<<<<<<< * ws = ts._processing_on * ws._actors.remove(ts) */ } /* "distributed/scheduler.py":2404 * ws._actors.remove(ts) * * _remove_from_processing(self, ts) # <<<<<<<<<<<<<< * * if exception is not None: */ __pyx_t_4 = __pyx_f_11distributed_9scheduler__remove_from_processing(__pyx_v_self, __pyx_v_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2404, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2406 * _remove_from_processing(self, ts) * * if exception is not None: # <<<<<<<<<<<<<< * ts._exception = exception * if traceback is not None: */ __pyx_t_5 = (__pyx_v_exception != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":2407 * * if exception is not None: * ts._exception = exception # <<<<<<<<<<<<<< * if traceback is not None: * ts._traceback = traceback */ __Pyx_INCREF(__pyx_v_exception); __Pyx_GIVEREF(__pyx_v_exception); __Pyx_GOTREF(__pyx_v_ts->_exception); __Pyx_DECREF(__pyx_v_ts->_exception); __pyx_v_ts->_exception = __pyx_v_exception; /* "distributed/scheduler.py":2406 * _remove_from_processing(self, ts) * * if exception is not None: # <<<<<<<<<<<<<< * ts._exception = exception * if traceback is not None: */ } /* "distributed/scheduler.py":2408 * if exception is not None: * ts._exception = exception * if traceback is not None: # <<<<<<<<<<<<<< * ts._traceback = traceback * if cause is not None: */ __pyx_t_6 = (__pyx_v_traceback != Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2409 * ts._exception = exception * if traceback is not None: * ts._traceback = traceback # <<<<<<<<<<<<<< * if cause is not None: * failing_ts = self._tasks[cause] */ __Pyx_INCREF(__pyx_v_traceback); __Pyx_GIVEREF(__pyx_v_traceback); __Pyx_GOTREF(__pyx_v_ts->_traceback); __Pyx_DECREF(__pyx_v_ts->_traceback); __pyx_v_ts->_traceback = __pyx_v_traceback; /* "distributed/scheduler.py":2408 * if exception is not None: * ts._exception = exception * if traceback is not None: # <<<<<<<<<<<<<< * ts._traceback = traceback * if cause is not None: */ } /* "distributed/scheduler.py":2410 * if traceback is not None: * ts._traceback = traceback * if cause is not None: # <<<<<<<<<<<<<< * failing_ts = self._tasks[cause] * ts._exception_blame = failing_ts */ __pyx_t_5 = (__pyx_v_cause != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":2411 * ts._traceback = traceback * if cause is not None: * failing_ts = self._tasks[cause] # <<<<<<<<<<<<<< * ts._exception_blame = failing_ts * else: */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2411, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_cause); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2411, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2411, __pyx_L3_error) __pyx_v_failing_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2412 * if cause is not None: * failing_ts = self._tasks[cause] * ts._exception_blame = failing_ts # <<<<<<<<<<<<<< * else: * failing_ts = ts._exception_blame */ __Pyx_INCREF(((PyObject *)__pyx_v_failing_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_failing_ts)); __Pyx_GOTREF(__pyx_v_ts->_exception_blame); __Pyx_DECREF(__pyx_v_ts->_exception_blame); __pyx_v_ts->_exception_blame = ((PyObject *)__pyx_v_failing_ts); /* "distributed/scheduler.py":2410 * if traceback is not None: * ts._traceback = traceback * if cause is not None: # <<<<<<<<<<<<<< * failing_ts = self._tasks[cause] * ts._exception_blame = failing_ts */ goto __pyx_L15; } /* "distributed/scheduler.py":2414 * ts._exception_blame = failing_ts * else: * failing_ts = ts._exception_blame # <<<<<<<<<<<<<< * * recommendations: dict = {} */ /*else*/ { if (!(likely(((__pyx_v_ts->_exception_blame) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ts->_exception_blame, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2414, __pyx_L3_error) __pyx_t_4 = __pyx_v_ts->_exception_blame; __Pyx_INCREF(__pyx_t_4); __pyx_v_failing_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L15:; /* "distributed/scheduler.py":2416 * failing_ts = ts._exception_blame * * recommendations: dict = {} # <<<<<<<<<<<<<< * * for dts in ts._dependents: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2416, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_recommendations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2418 * recommendations: dict = {} * * for dts in ts._dependents: # <<<<<<<<<<<<<< * dts._exception_blame = failing_ts * recommendations[dts._key] = "erred" */ __pyx_t_8 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_v_ts->_dependents, 1, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2418, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_9, &__pyx_t_8, &__pyx_t_11, __pyx_t_10); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 2418, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2418, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_11)); __pyx_t_11 = 0; /* "distributed/scheduler.py":2419 * * for dts in ts._dependents: * dts._exception_blame = failing_ts # <<<<<<<<<<<<<< * recommendations[dts._key] = "erred" * */ __Pyx_INCREF(((PyObject *)__pyx_v_failing_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_failing_ts)); __Pyx_GOTREF(__pyx_v_dts->_exception_blame); __Pyx_DECREF(__pyx_v_dts->_exception_blame); __pyx_v_dts->_exception_blame = ((PyObject *)__pyx_v_failing_ts); /* "distributed/scheduler.py":2420 * for dts in ts._dependents: * dts._exception_blame = failing_ts * recommendations[dts._key] = "erred" # <<<<<<<<<<<<<< * * for dts in ts._dependencies: */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_erred) < 0)) __PYX_ERR(0, 2420, __pyx_L3_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2422 * recommendations[dts._key] = "erred" * * for dts in ts._dependencies: # <<<<<<<<<<<<<< * s = dts._waiters * s.discard(ts) */ __pyx_t_9 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_8), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2422, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_8, &__pyx_t_9, &__pyx_t_11, __pyx_t_10); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 2422, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2422, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_11)); __pyx_t_11 = 0; /* "distributed/scheduler.py":2423 * * for dts in ts._dependencies: * s = dts._waiters # <<<<<<<<<<<<<< * s.discard(ts) * if not s and not dts._who_wants: */ __pyx_t_11 = __pyx_v_dts->_waiters; __Pyx_INCREF(__pyx_t_11); __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; /* "distributed/scheduler.py":2424 * for dts in ts._dependencies: * s = dts._waiters * s.discard(ts) # <<<<<<<<<<<<<< * if not s and not dts._who_wants: * recommendations[dts._key] = "released" */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2424, __pyx_L3_error) } __pyx_t_7 = __Pyx_PySet_Discard(__pyx_v_s, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2424, __pyx_L3_error) /* "distributed/scheduler.py":2425 * s = dts._waiters * s.discard(ts) * if not s and not dts._who_wants: # <<<<<<<<<<<<<< * recommendations[dts._key] = "released" * */ __pyx_t_5 = (__pyx_v_s != Py_None)&&(PySet_GET_SIZE(__pyx_v_s) != 0); __pyx_t_13 = ((!__pyx_t_5) != 0); if (__pyx_t_13) { } else { __pyx_t_6 = __pyx_t_13; goto __pyx_L21_bool_binop_done; } __pyx_t_13 = (__pyx_v_dts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_wants) != 0); __pyx_t_5 = ((!__pyx_t_13) != 0); __pyx_t_6 = __pyx_t_5; __pyx_L21_bool_binop_done:; if (__pyx_t_6) { /* "distributed/scheduler.py":2426 * s.discard(ts) * if not s and not dts._who_wants: * recommendations[dts._key] = "released" # <<<<<<<<<<<<<< * * ts._waiters.clear() # do anything with this? */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 2426, __pyx_L3_error) /* "distributed/scheduler.py":2425 * s = dts._waiters * s.discard(ts) * if not s and not dts._who_wants: # <<<<<<<<<<<<<< * recommendations[dts._key] = "released" * */ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2428 * recommendations[dts._key] = "released" * * ts._waiters.clear() # do anything with this? # <<<<<<<<<<<<<< * * ts.state = "erred" */ if (unlikely(__pyx_v_ts->_waiters == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 2428, __pyx_L3_error) } __pyx_t_7 = PySet_Clear(__pyx_v_ts->_waiters); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2428, __pyx_L3_error) /* "distributed/scheduler.py":2430 * ts._waiters.clear() # do anything with this? * * ts.state = "erred" # <<<<<<<<<<<<<< * * report_msg = { */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_erred) < 0) __PYX_ERR(0, 2430, __pyx_L3_error) /* "distributed/scheduler.py":2433 * * report_msg = { * "op": "task-erred", # <<<<<<<<<<<<<< * "key": key, * "exception": failing_ts._exception, */ __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2433, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_op, __pyx_kp_u_task_erred) < 0) __PYX_ERR(0, 2433, __pyx_L3_error) /* "distributed/scheduler.py":2434 * report_msg = { * "op": "task-erred", * "key": key, # <<<<<<<<<<<<<< * "exception": failing_ts._exception, * "traceback": failing_ts._traceback, */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_key, __pyx_v_key) < 0) __PYX_ERR(0, 2433, __pyx_L3_error) /* "distributed/scheduler.py":2435 * "op": "task-erred", * "key": key, * "exception": failing_ts._exception, # <<<<<<<<<<<<<< * "traceback": failing_ts._traceback, * } */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_exception, __pyx_v_failing_ts->_exception) < 0) __PYX_ERR(0, 2433, __pyx_L3_error) /* "distributed/scheduler.py":2436 * "key": key, * "exception": failing_ts._exception, * "traceback": failing_ts._traceback, # <<<<<<<<<<<<<< * } * cs: ClientState */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_traceback, __pyx_v_failing_ts->_traceback) < 0) __PYX_ERR(0, 2433, __pyx_L3_error) __pyx_v_report_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2439 * } * cs: ClientState * for cs in ts._who_wants: # <<<<<<<<<<<<<< * client_msgs[cs._client_key] = [report_msg] * */ __pyx_t_8 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2439, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_9, &__pyx_t_8, &__pyx_t_11, __pyx_t_10); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 2439, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 2439, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_11)); __pyx_t_11 = 0; /* "distributed/scheduler.py":2440 * cs: ClientState * for cs in ts._who_wants: * client_msgs[cs._client_key] = [report_msg] # <<<<<<<<<<<<<< * * cs = self._clients["fire-and-forget"] */ __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2440, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_report_msg); __Pyx_GIVEREF(__pyx_v_report_msg); PyList_SET_ITEM(__pyx_t_11, 0, __pyx_v_report_msg); if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_cs->_client_key, __pyx_t_11) < 0)) __PYX_ERR(0, 2440, __pyx_L3_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2442 * client_msgs[cs._client_key] = [report_msg] * * cs = self._clients["fire-and-forget"] # <<<<<<<<<<<<<< * if ts in cs._wants_what: * _client_releases_keys( */ if (unlikely(__pyx_v_self->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2442, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_clients, __pyx_kp_u_fire_and_forget); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2442, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 2442, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":2443 * * cs = self._clients["fire-and-forget"] * if ts in cs._wants_what: # <<<<<<<<<<<<<< * _client_releases_keys( * self, */ if (unlikely(__pyx_v_cs->_wants_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2443, __pyx_L3_error) } __pyx_t_6 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_cs->_wants_what, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2443, __pyx_L3_error) __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2447 * self, * cs=cs, * keys=[key], # <<<<<<<<<<<<<< * recommendations=recommendations, * ) */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2447, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_key); /* "distributed/scheduler.py":2445 * if ts in cs._wants_what: * _client_releases_keys( * self, # <<<<<<<<<<<<<< * cs=cs, * keys=[key], */ __pyx_t_11 = __pyx_t_4; __Pyx_INCREF(__pyx_t_11); /* "distributed/scheduler.py":2444 * cs = self._clients["fire-and-forget"] * if ts in cs._wants_what: * _client_releases_keys( # <<<<<<<<<<<<<< * self, * cs=cs, */ __pyx_t_14 = __pyx_f_11distributed_9scheduler__client_releases_keys(__pyx_v_self, ((PyObject*)__pyx_t_11), __pyx_v_cs, __pyx_v_recommendations); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2444, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (void)(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":2443 * * cs = self._clients["fire-and-forget"] * if ts in cs._wants_what: # <<<<<<<<<<<<<< * _client_releases_keys( * self, */ } /* "distributed/scheduler.py":2451 * ) * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2452 * * if self._validate: * assert not ts._processing_on # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2452, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2452, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2451 * ) * * if self._validate: # <<<<<<<<<<<<<< * assert not ts._processing_on * */ } /* "distributed/scheduler.py":2454 * assert not ts._processing_on * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2454, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_14; __pyx_t_14 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2387 * ): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2455 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_processing_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_4, &__pyx_t_11) < 0) __PYX_ERR(0, 2455, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_v_e = __pyx_t_4; /*try:*/ { /* "distributed/scheduler.py":2456 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2456, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_exception); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2456, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_16, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_e); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2456, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2457 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2457, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2457, __pyx_L32_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":2458 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_15 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2458, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_15); __pyx_v_pdb = __pyx_t_15; __pyx_t_15 = 0; /* "distributed/scheduler.py":2460 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2460, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_17); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2460, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2457 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2461 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_no_worker_released(self, key): */ __Pyx_GIVEREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_4, __pyx_t_11); __pyx_t_14 = 0; __pyx_t_4 = 0; __pyx_t_11 = 0; __PYX_ERR(0, 2461, __pyx_L32_error) } /* "distributed/scheduler.py":2455 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L32_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_10 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_18; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2387 * ): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2383 * raise * * def transition_processing_erred( # <<<<<<<<<<<<<< * self, key, cause=None, exception=None, traceback=None, **kwargs * ): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_processing_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_v_failing_ts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_report_msg); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2463 * raise * * def transition_no_worker_released(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_29transition_no_worker_released(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_29transition_no_worker_released(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_no_worker_released (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_28transition_no_worker_released(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_28transition_no_worker_released(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_no_worker_released", 0); /* "distributed/scheduler.py":2464 * * def transition_no_worker_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2465 * def transition_no_worker_released(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * worker_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2465, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2465, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2465, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2467 * ts: TaskState = self._tasks[key] * dts: TaskState * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2467, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2468 * dts: TaskState * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2468, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2470 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert self._tasks[key].state == "no-worker" * assert not ts._who_has */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2471 * * if self._validate: * assert self._tasks[key].state == "no-worker" # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._waiting_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2471, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2471, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2471, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_no_worker, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2471, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2471, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2472 * if self._validate: * assert self._tasks[key].state == "no-worker" * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._waiting_on * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2472, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2473 * assert self._tasks[key].state == "no-worker" * assert not ts._who_has * assert not ts._waiting_on # <<<<<<<<<<<<<< * * self._unrunnable.remove(ts) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2473, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2470 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert self._tasks[key].state == "no-worker" * assert not ts._who_has */ } /* "distributed/scheduler.py":2475 * assert not ts._waiting_on * * self._unrunnable.remove(ts) # <<<<<<<<<<<<<< * ts.state = "released" * */ if (unlikely(__pyx_v_self->_unrunnable == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 2475, __pyx_L3_error) } __pyx_t_7 = __Pyx_PySet_Remove(__pyx_v_self->_unrunnable, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2475, __pyx_L3_error) /* "distributed/scheduler.py":2476 * * self._unrunnable.remove(ts) * ts.state = "released" # <<<<<<<<<<<<<< * * for dts in ts._dependencies: */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_released) < 0) __PYX_ERR(0, 2476, __pyx_L3_error) /* "distributed/scheduler.py":2478 * ts.state = "released" * * for dts in ts._dependencies: # <<<<<<<<<<<<<< * dts._waiters.discard(ts) * */ __pyx_t_8 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2478, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_8, &__pyx_t_4, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 2478, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2478, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":2479 * * for dts in ts._dependencies: * dts._waiters.discard(ts) # <<<<<<<<<<<<<< * * ts._waiters.clear() */ if (unlikely(__pyx_v_dts->_waiters == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2479, __pyx_L3_error) } __pyx_t_7 = __Pyx_PySet_Discard(__pyx_v_dts->_waiters, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2479, __pyx_L3_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":2481 * dts._waiters.discard(ts) * * ts._waiters.clear() # <<<<<<<<<<<<<< * * return {}, worker_msgs, client_msgs */ if (unlikely(__pyx_v_ts->_waiters == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 2481, __pyx_L3_error) } __pyx_t_7 = PySet_Clear(__pyx_v_ts->_waiters); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2481, __pyx_L3_error) /* "distributed/scheduler.py":2483 * ts._waiters.clear() * * return {}, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2483, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2483, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2464 * * def transition_no_worker_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":2484 * * return {}, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_no_worker_released", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 2484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "distributed/scheduler.py":2485 * return {}, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2485, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exception); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2485, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_14, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_e); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2485, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":2486 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2486, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2486, __pyx_L17_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":2487 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_13 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2487, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __pyx_v_pdb = __pyx_t_13; __pyx_t_13 = 0; /* "distributed/scheduler.py":2489 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2489, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2489, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":2486 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2490 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * @ccall */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_12); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_12 = 0; __PYX_ERR(0, 2490, __pyx_L17_error) } /* "distributed/scheduler.py":2484 * * return {}, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L17_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_16; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2464 * * def transition_no_worker_released(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * dts: TaskState */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2463 * raise * * def transition_no_worker_released(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_no_worker_released", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2493 * * @ccall * def remove_key(self, key): # <<<<<<<<<<<<<< * ts: TaskState = self._tasks.pop(key) * assert ts._state == "forgotten" */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_31remove_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_remove_key(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_key", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_31remove_key)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2494 * @ccall * def remove_key(self, key): * ts: TaskState = self._tasks.pop(key) # <<<<<<<<<<<<<< * assert ts._state == "forgotten" * self._unrunnable.discard(ts) */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); __PYX_ERR(0, 2494, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Pop(__pyx_v_self->_tasks, __pyx_v_key, ((PyObject *)NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2494, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2495 * def remove_key(self, key): * ts: TaskState = self._tasks.pop(key) * assert ts._state == "forgotten" # <<<<<<<<<<<<<< * self._unrunnable.discard(ts) * cs: ClientState */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_forgotten, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2495, __pyx_L1_error) if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2495, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":2496 * ts: TaskState = self._tasks.pop(key) * assert ts._state == "forgotten" * self._unrunnable.discard(ts) # <<<<<<<<<<<<<< * cs: ClientState * for cs in ts._who_wants: */ if (unlikely(__pyx_v_self->_unrunnable == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2496, __pyx_L1_error) } __pyx_t_6 = __Pyx_PySet_Discard(__pyx_v_self->_unrunnable, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 2496, __pyx_L1_error) /* "distributed/scheduler.py":2498 * self._unrunnable.discard(ts) * cs: ClientState * for cs in ts._who_wants: # <<<<<<<<<<<<<< * cs._wants_what.remove(ts) * ts._who_wants.clear() */ __pyx_t_7 = 0; __pyx_t_2 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":2499 * cs: ClientState * for cs in ts._who_wants: * cs._wants_what.remove(ts) # <<<<<<<<<<<<<< * ts._who_wants.clear() * ts._processing_on = None */ if (unlikely(__pyx_v_cs->_wants_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 2499, __pyx_L1_error) } __pyx_t_6 = __Pyx_PySet_Remove(__pyx_v_cs->_wants_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 2499, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2500 * for cs in ts._who_wants: * cs._wants_what.remove(ts) * ts._who_wants.clear() # <<<<<<<<<<<<<< * ts._processing_on = None * ts._exception_blame = ts._exception = ts._traceback = None */ if (unlikely(__pyx_v_ts->_who_wants == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 2500, __pyx_L1_error) } __pyx_t_6 = PySet_Clear(__pyx_v_ts->_who_wants); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 2500, __pyx_L1_error) /* "distributed/scheduler.py":2501 * cs._wants_what.remove(ts) * ts._who_wants.clear() * ts._processing_on = None # <<<<<<<<<<<<<< * ts._exception_blame = ts._exception = ts._traceback = None * self._task_metadata.pop(key, None) */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_ts->_processing_on); __Pyx_DECREF(((PyObject *)__pyx_v_ts->_processing_on)); __pyx_v_ts->_processing_on = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); /* "distributed/scheduler.py":2502 * ts._who_wants.clear() * ts._processing_on = None * ts._exception_blame = ts._exception = ts._traceback = None # <<<<<<<<<<<<<< * self._task_metadata.pop(key, None) * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_ts->_exception_blame); __Pyx_DECREF(__pyx_v_ts->_exception_blame); __pyx_v_ts->_exception_blame = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_ts->_exception); __Pyx_DECREF(__pyx_v_ts->_exception); __pyx_v_ts->_exception = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_ts->_traceback); __Pyx_DECREF(__pyx_v_ts->_traceback); __pyx_v_ts->_traceback = Py_None; /* "distributed/scheduler.py":2503 * ts._processing_on = None * ts._exception_blame = ts._exception = ts._traceback = None * self._task_metadata.pop(key, None) # <<<<<<<<<<<<<< * * def transition_memory_forgotten(self, key): */ if (unlikely(__pyx_v_self->_task_metadata == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); __PYX_ERR(0, 2503, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Pop(__pyx_v_self->_task_metadata, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2493 * * @ccall * def remove_key(self, key): # <<<<<<<<<<<<<< * ts: TaskState = self._tasks.pop(key) * assert ts._state == "forgotten" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.remove_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_31remove_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_31remove_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_key (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_30remove_key(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_30remove_key(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_key", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_14SchedulerState_remove_key(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.remove_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2505 * self._task_metadata.pop(key, None) * * def transition_memory_forgotten(self, key): # <<<<<<<<<<<<<< * ws: WorkerState * try: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_33transition_memory_forgotten(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_33transition_memory_forgotten(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_memory_forgotten (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_32transition_memory_forgotten(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_32transition_memory_forgotten(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_memory_forgotten", 0); /* "distributed/scheduler.py":2507 * def transition_memory_forgotten(self, key): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2508 * ws: WorkerState * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * worker_msgs: dict = {} * client_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2508, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2508, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2508, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2509 * try: * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2509, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2510 * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2510, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2512 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts._state == "memory" * assert not ts._processing_on */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2513 * * if self._validate: * assert ts._state == "memory" # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._waiting_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2513, __pyx_L3_error) if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2513, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2514 * if self._validate: * assert ts._state == "memory" * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not ts._waiting_on * if not ts._run_spec: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2514, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2514, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2515 * assert ts._state == "memory" * assert not ts._processing_on * assert not ts._waiting_on # <<<<<<<<<<<<<< * if not ts._run_spec: * # It's ok to forget a pure data task */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2515, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2516 * assert not ts._processing_on * assert not ts._waiting_on * if not ts._run_spec: # <<<<<<<<<<<<<< * # It's ok to forget a pure data task * pass */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2516, __pyx_L3_error) __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { goto __pyx_L10; } /* "distributed/scheduler.py":2519 * # It's ok to forget a pure data task * pass * elif ts._has_lost_dependencies: # <<<<<<<<<<<<<< * # It's ok to forget a task with forgotten dependencies * pass */ __pyx_t_6 = (__pyx_v_ts->_has_lost_dependencies != 0); if (__pyx_t_6) { goto __pyx_L10; } /* "distributed/scheduler.py":2522 * # It's ok to forget a task with forgotten dependencies * pass * elif not ts._who_wants and not ts._waiters and not ts._dependents: # <<<<<<<<<<<<<< * # It's ok to forget a task that nobody needs * pass */ __pyx_t_5 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); __pyx_t_7 = ((!__pyx_t_5) != 0); if (__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L11_bool_binop_done; } __pyx_t_7 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); __pyx_t_5 = ((!__pyx_t_7) != 0); if (__pyx_t_5) { } else { __pyx_t_6 = __pyx_t_5; goto __pyx_L11_bool_binop_done; } __pyx_t_5 = (__pyx_v_ts->_dependents != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_dependents) != 0); __pyx_t_7 = ((!__pyx_t_5) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L11_bool_binop_done:; if (__pyx_t_6) { goto __pyx_L10; } /* "distributed/scheduler.py":2526 * pass * else: * assert 0, (ts,) # <<<<<<<<<<<<<< * * recommendations: dict = {} */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!0)) { __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2526, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ts)); __pyx_t_8 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2526, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 2526, __pyx_L3_error) } } #endif } __pyx_L10:; /* "distributed/scheduler.py":2512 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts._state == "memory" * assert not ts._processing_on */ } /* "distributed/scheduler.py":2528 * assert 0, (ts,) * * recommendations: dict = {} # <<<<<<<<<<<<<< * * if ts._actor: */ __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2528, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_recommendations = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2530 * recommendations: dict = {} * * if ts._actor: # <<<<<<<<<<<<<< * for ws in ts._who_has: * ws._actors.discard(ts) */ __pyx_t_6 = (__pyx_v_ts->_actor != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":2531 * * if ts._actor: * for ws in ts._who_has: # <<<<<<<<<<<<<< * ws._actors.discard(ts) * */ __pyx_t_9 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_ts->_who_has, 1, (&__pyx_t_10), (&__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2531, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_8, __pyx_t_10, &__pyx_t_9, &__pyx_t_4, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 2531, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 2531, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":2532 * if ts._actor: * for ws in ts._who_has: * ws._actors.discard(ts) # <<<<<<<<<<<<<< * * _propagate_forgotten(self, ts, recommendations, worker_msgs) */ if (unlikely(__pyx_v_ws->_actors == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2532, __pyx_L3_error) } __pyx_t_13 = __Pyx_PySet_Discard(__pyx_v_ws->_actors, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 2532, __pyx_L3_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2530 * recommendations: dict = {} * * if ts._actor: # <<<<<<<<<<<<<< * for ws in ts._who_has: * ws._actors.discard(ts) */ } /* "distributed/scheduler.py":2534 * ws._actors.discard(ts) * * _propagate_forgotten(self, ts, recommendations, worker_msgs) # <<<<<<<<<<<<<< * * client_msgs = _task_to_client_msgs(self, ts) */ __pyx_t_8 = __pyx_f_11distributed_9scheduler__propagate_forgotten(__pyx_v_self, __pyx_v_ts, __pyx_v_recommendations, __pyx_v_worker_msgs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2534, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2536 * _propagate_forgotten(self, ts, recommendations, worker_msgs) * * client_msgs = _task_to_client_msgs(self, ts) # <<<<<<<<<<<<<< * self.remove_key(key) * */ __pyx_t_8 = __pyx_f_11distributed_9scheduler__task_to_client_msgs(__pyx_v_self, __pyx_v_ts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2536, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_client_msgs, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "distributed/scheduler.py":2537 * * client_msgs = _task_to_client_msgs(self, ts) * self.remove_key(key) # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ __pyx_t_8 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->remove_key(__pyx_v_self, __pyx_v_key, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2537, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2539 * self.remove_key(key) * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2539, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2507 * def transition_memory_forgotten(self, key): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":2540 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_11) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_memory_forgotten", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_4, &__pyx_t_14) < 0) __PYX_ERR(0, 2540, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_v_e = __pyx_t_4; /*try:*/ { /* "distributed/scheduler.py":2541 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2541, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_exception); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2541, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_16, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_e); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2541, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2542 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2542, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2542, __pyx_L22_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_6) { /* "distributed/scheduler.py":2543 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_15 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2543, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_15); __pyx_v_pdb = __pyx_t_15; __pyx_t_15 = 0; /* "distributed/scheduler.py":2545 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2545, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_17); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2545, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2542 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2546 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition_released_forgotten(self, key): */ __Pyx_GIVEREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_4, __pyx_t_14); __pyx_t_8 = 0; __pyx_t_4 = 0; __pyx_t_14 = 0; __PYX_ERR(0, 2546, __pyx_L22_error) } /* "distributed/scheduler.py":2540 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_18; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2507 * def transition_memory_forgotten(self, key): * ws: WorkerState * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2505 * self._task_metadata.pop(key, None) * * def transition_memory_forgotten(self, key): # <<<<<<<<<<<<<< * ws: WorkerState * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_memory_forgotten", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2548 * raise * * def transition_released_forgotten(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_35transition_released_forgotten(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_35transition_released_forgotten(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition_released_forgotten (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_34transition_released_forgotten(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_34transition_released_forgotten(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition_released_forgotten", 0); /* "distributed/scheduler.py":2549 * * def transition_released_forgotten(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":2550 * def transition_released_forgotten(self, key): * try: * ts: TaskState = self._tasks[key] # <<<<<<<<<<<<<< * worker_msgs: dict = {} * client_msgs: dict = {} */ if (unlikely(__pyx_v_self->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2550, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2550, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2550, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2551 * try: * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2551, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2552 * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * * if self._validate: */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2552, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_client_msgs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2554 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts._state in ("released", "erred") * assert not ts._who_has */ __pyx_t_5 = (__pyx_v_self->_validate != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2555 * * if self._validate: * assert ts._state in ("released", "erred") # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._processing_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __Pyx_INCREF(__pyx_v_ts->_state); __pyx_t_6 = __pyx_v_ts->_state; __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_released, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2555, __pyx_L3_error) __pyx_t_8 = (__pyx_t_7 != 0); if (!__pyx_t_8) { } else { __pyx_t_5 = __pyx_t_8; goto __pyx_L10_bool_binop_done; } __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_erred, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 2555, __pyx_L3_error) __pyx_t_7 = (__pyx_t_8 != 0); __pyx_t_5 = __pyx_t_7; __pyx_L10_bool_binop_done:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2555, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2556 * if self._validate: * assert ts._state in ("released", "erred") * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._waiting_on, (ts, ts._waiting_on) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2556, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2557 * assert ts._state in ("released", "erred") * assert not ts._who_has * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not ts._waiting_on, (ts, ts._waiting_on) * if not ts._run_spec: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2557, __pyx_L3_error) if (unlikely(!((!__pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2557, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2558 * assert not ts._who_has * assert not ts._processing_on * assert not ts._waiting_on, (ts, ts._waiting_on) # <<<<<<<<<<<<<< * if not ts._run_spec: * # It's ok to forget a pure data task */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_5) != 0))) { __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2558, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ts)); __Pyx_INCREF(__pyx_v_ts->_waiting_on); __Pyx_GIVEREF(__pyx_v_ts->_waiting_on); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ts->_waiting_on); __pyx_t_9 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2558, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 2558, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":2559 * assert not ts._processing_on * assert not ts._waiting_on, (ts, ts._waiting_on) * if not ts._run_spec: # <<<<<<<<<<<<<< * # It's ok to forget a pure data task * pass */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2559, __pyx_L3_error) __pyx_t_7 = ((!__pyx_t_5) != 0); if (__pyx_t_7) { goto __pyx_L12; } /* "distributed/scheduler.py":2562 * # It's ok to forget a pure data task * pass * elif ts._has_lost_dependencies: # <<<<<<<<<<<<<< * # It's ok to forget a task with forgotten dependencies * pass */ __pyx_t_7 = (__pyx_v_ts->_has_lost_dependencies != 0); if (__pyx_t_7) { goto __pyx_L12; } /* "distributed/scheduler.py":2565 * # It's ok to forget a task with forgotten dependencies * pass * elif not ts._who_wants and not ts._waiters and not ts._dependents: # <<<<<<<<<<<<<< * # It's ok to forget a task that nobody needs * pass */ __pyx_t_5 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); __pyx_t_8 = ((!__pyx_t_5) != 0); if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L13_bool_binop_done; } __pyx_t_8 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); __pyx_t_5 = ((!__pyx_t_8) != 0); if (__pyx_t_5) { } else { __pyx_t_7 = __pyx_t_5; goto __pyx_L13_bool_binop_done; } __pyx_t_5 = (__pyx_v_ts->_dependents != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_dependents) != 0); __pyx_t_8 = ((!__pyx_t_5) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L13_bool_binop_done:; if (__pyx_t_7) { goto __pyx_L12; } /* "distributed/scheduler.py":2569 * pass * else: * assert 0, (ts,) # <<<<<<<<<<<<<< * * recommendations: dict = {} */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!0)) { __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2569, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_ts)); __pyx_t_4 = PyTuple_Pack(1, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2569, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 2569, __pyx_L3_error) } } #endif } __pyx_L12:; /* "distributed/scheduler.py":2554 * client_msgs: dict = {} * * if self._validate: # <<<<<<<<<<<<<< * assert ts._state in ("released", "erred") * assert not ts._who_has */ } /* "distributed/scheduler.py":2571 * assert 0, (ts,) * * recommendations: dict = {} # <<<<<<<<<<<<<< * _propagate_forgotten(self, ts, recommendations, worker_msgs) * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2571, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_recommendations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2572 * * recommendations: dict = {} * _propagate_forgotten(self, ts, recommendations, worker_msgs) # <<<<<<<<<<<<<< * * client_msgs = _task_to_client_msgs(self, ts) */ __pyx_t_4 = __pyx_f_11distributed_9scheduler__propagate_forgotten(__pyx_v_self, __pyx_v_ts, __pyx_v_recommendations, __pyx_v_worker_msgs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2572, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2574 * _propagate_forgotten(self, ts, recommendations, worker_msgs) * * client_msgs = _task_to_client_msgs(self, ts) # <<<<<<<<<<<<<< * self.remove_key(key) * */ __pyx_t_4 = __pyx_f_11distributed_9scheduler__task_to_client_msgs(__pyx_v_self, __pyx_v_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2574, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_client_msgs, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":2575 * * client_msgs = _task_to_client_msgs(self, ts) * self.remove_key(key) # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ __pyx_t_4 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->remove_key(__pyx_v_self, __pyx_v_key, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2575, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2577 * self.remove_key(key) * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2577, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":2549 * * def transition_released_forgotten(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2578 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_released_forgotten", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_11) < 0) __PYX_ERR(0, 2578, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_9); __pyx_v_e = __pyx_t_9; /*try:*/ { /* "distributed/scheduler.py":2579 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2579, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_exception); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2579, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); } } __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_13, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_e); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2579, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":2580 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2580, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2580, __pyx_L21_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_7) { /* "distributed/scheduler.py":2581 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_12 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2581, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_12); __pyx_v_pdb = __pyx_t_12; __pyx_t_12 = 0; /* "distributed/scheduler.py":2583 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2583, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); } } __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2583, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":2580 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":2584 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * ############################## */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_9, __pyx_t_11); __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_11 = 0; __PYX_ERR(0, 2584, __pyx_L21_error) } /* "distributed/scheduler.py":2578 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L21_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_10 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":2549 * * def transition_released_forgotten(self, key): * try: # <<<<<<<<<<<<<< * ts: TaskState = self._tasks[key] * worker_msgs: dict = {} */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "distributed/scheduler.py":2548 * raise * * def transition_released_forgotten(self, key): # <<<<<<<<<<<<<< * try: * ts: TaskState = self._tasks[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.transition_released_forgotten", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2592 * @ccall * @exceptval(check=False) * def check_idle_saturated(self, ws: WorkerState, occ: double = -1.0): # <<<<<<<<<<<<<< * """Update the status of the idle and saturated state * */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_37check_idle_saturated(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_check_idle_saturated(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch, struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_check_idle_saturated *__pyx_optional_args) { double __pyx_v_occ = __pyx_k__13; Py_ssize_t __pyx_v_total_nthreads; Py_ssize_t __pyx_v_nc; Py_ssize_t __pyx_v_p; double __pyx_v_total_occupancy; double __pyx_v_avg; PyObject *__pyx_v_idle = NULL; PyObject *__pyx_v_saturated = 0; double __pyx_v_pending; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; double __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_idle_saturated", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_occ = __pyx_optional_args->occ; } } /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_idle_saturated); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_37check_idle_saturated)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_occ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_ws), __pyx_t_3}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2592, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_ws), __pyx_t_3}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2592, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2606 * This is useful for load balancing and adaptivity. * """ * total_nthreads: Py_ssize_t = self._total_nthreads # <<<<<<<<<<<<<< * if total_nthreads == 0 or ws.status == Status.closed: * return */ __pyx_t_8 = __pyx_v_self->_total_nthreads; __pyx_v_total_nthreads = __pyx_t_8; /* "distributed/scheduler.py":2607 * """ * total_nthreads: Py_ssize_t = self._total_nthreads * if total_nthreads == 0 or ws.status == Status.closed: # <<<<<<<<<<<<<< * return * if occ < 0: */ __pyx_t_10 = ((__pyx_v_total_nthreads == 0) != 0); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ws), __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_closed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L4_bool_binop_done:; if (__pyx_t_9) { /* "distributed/scheduler.py":2608 * total_nthreads: Py_ssize_t = self._total_nthreads * if total_nthreads == 0 or ws.status == Status.closed: * return # <<<<<<<<<<<<<< * if occ < 0: * occ = ws._occupancy */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":2607 * """ * total_nthreads: Py_ssize_t = self._total_nthreads * if total_nthreads == 0 or ws.status == Status.closed: # <<<<<<<<<<<<<< * return * if occ < 0: */ } /* "distributed/scheduler.py":2609 * if total_nthreads == 0 or ws.status == Status.closed: * return * if occ < 0: # <<<<<<<<<<<<<< * occ = ws._occupancy * */ __pyx_t_9 = ((__pyx_v_occ < 0.0) != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":2610 * return * if occ < 0: * occ = ws._occupancy # <<<<<<<<<<<<<< * * nc: Py_ssize_t = ws._nthreads */ __pyx_t_11 = __pyx_v_ws->_occupancy; __pyx_v_occ = __pyx_t_11; /* "distributed/scheduler.py":2609 * if total_nthreads == 0 or ws.status == Status.closed: * return * if occ < 0: # <<<<<<<<<<<<<< * occ = ws._occupancy * */ } /* "distributed/scheduler.py":2612 * occ = ws._occupancy * * nc: Py_ssize_t = ws._nthreads # <<<<<<<<<<<<<< * p: Py_ssize_t = len(ws._processing) * total_occupancy: double = self._total_occupancy */ __pyx_t_8 = __pyx_v_ws->_nthreads; __pyx_v_nc = __pyx_t_8; /* "distributed/scheduler.py":2613 * * nc: Py_ssize_t = ws._nthreads * p: Py_ssize_t = len(ws._processing) # <<<<<<<<<<<<<< * total_occupancy: double = self._total_occupancy * avg: double = total_occupancy / total_nthreads */ __pyx_t_2 = __pyx_v_ws->_processing; __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 2613, __pyx_L1_error) } __pyx_t_8 = PyDict_Size(__pyx_t_2); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_p = __pyx_t_8; /* "distributed/scheduler.py":2614 * nc: Py_ssize_t = ws._nthreads * p: Py_ssize_t = len(ws._processing) * total_occupancy: double = self._total_occupancy # <<<<<<<<<<<<<< * avg: double = total_occupancy / total_nthreads * */ __pyx_t_11 = __pyx_v_self->_total_occupancy; __pyx_v_total_occupancy = __pyx_t_11; /* "distributed/scheduler.py":2615 * p: Py_ssize_t = len(ws._processing) * total_occupancy: double = self._total_occupancy * avg: double = total_occupancy / total_nthreads # <<<<<<<<<<<<<< * * idle = self._idle */ if (unlikely(__pyx_v_total_nthreads == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 2615, __pyx_L1_error) } __pyx_v_avg = (__pyx_v_total_occupancy / ((double)__pyx_v_total_nthreads)); /* "distributed/scheduler.py":2617 * avg: double = total_occupancy / total_nthreads * * idle = self._idle # <<<<<<<<<<<<<< * saturated: set = self._saturated * if p < nc or occ < nc * avg / 2: */ __pyx_t_2 = __pyx_v_self->_idle; __Pyx_INCREF(__pyx_t_2); __pyx_v_idle = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":2618 * * idle = self._idle * saturated: set = self._saturated # <<<<<<<<<<<<<< * if p < nc or occ < nc * avg / 2: * idle[ws._address] = ws */ __pyx_t_2 = __pyx_v_self->_saturated; __Pyx_INCREF(__pyx_t_2); __pyx_v_saturated = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2619 * idle = self._idle * saturated: set = self._saturated * if p < nc or occ < nc * avg / 2: # <<<<<<<<<<<<<< * idle[ws._address] = ws * saturated.discard(ws) */ __pyx_t_10 = ((__pyx_v_p < __pyx_v_nc) != 0); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L8_bool_binop_done; } __pyx_t_10 = ((__pyx_v_occ < ((__pyx_v_nc * __pyx_v_avg) / 2.0)) != 0); __pyx_t_9 = __pyx_t_10; __pyx_L8_bool_binop_done:; if (__pyx_t_9) { /* "distributed/scheduler.py":2620 * saturated: set = self._saturated * if p < nc or occ < nc * avg / 2: * idle[ws._address] = ws # <<<<<<<<<<<<<< * saturated.discard(ws) * else: */ if (unlikely(PyObject_SetItem(__pyx_v_idle, __pyx_v_ws->_address, ((PyObject *)__pyx_v_ws)) < 0)) __PYX_ERR(0, 2620, __pyx_L1_error) /* "distributed/scheduler.py":2621 * if p < nc or occ < nc * avg / 2: * idle[ws._address] = ws * saturated.discard(ws) # <<<<<<<<<<<<<< * else: * idle.pop(ws._address, None) */ if (unlikely(__pyx_v_saturated == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2621, __pyx_L1_error) } __pyx_t_12 = __Pyx_PySet_Discard(__pyx_v_saturated, ((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2621, __pyx_L1_error) /* "distributed/scheduler.py":2619 * idle = self._idle * saturated: set = self._saturated * if p < nc or occ < nc * avg / 2: # <<<<<<<<<<<<<< * idle[ws._address] = ws * saturated.discard(ws) */ goto __pyx_L7; } /* "distributed/scheduler.py":2623 * saturated.discard(ws) * else: * idle.pop(ws._address, None) # <<<<<<<<<<<<<< * * if p > nc: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idle, __pyx_n_s_pop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_ws->_address, Py_None}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_ws->_address, Py_None}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_ws->_address); __Pyx_GIVEREF(__pyx_v_ws->_address); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_ws->_address); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, Py_None); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2625 * idle.pop(ws._address, None) * * if p > nc: # <<<<<<<<<<<<<< * pending: double = occ * (p - nc) / (p * nc) * if 0.4 < pending > 1.9 * avg: */ __pyx_t_9 = ((__pyx_v_p > __pyx_v_nc) != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":2626 * * if p > nc: * pending: double = occ * (p - nc) / (p * nc) # <<<<<<<<<<<<<< * if 0.4 < pending > 1.9 * avg: * saturated.add(ws) */ __pyx_t_11 = (__pyx_v_occ * (__pyx_v_p - __pyx_v_nc)); __pyx_t_8 = (__pyx_v_p * __pyx_v_nc); if (unlikely(__pyx_t_8 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 2626, __pyx_L1_error) } __pyx_v_pending = (__pyx_t_11 / ((double)__pyx_t_8)); /* "distributed/scheduler.py":2627 * if p > nc: * pending: double = occ * (p - nc) / (p * nc) * if 0.4 < pending > 1.9 * avg: # <<<<<<<<<<<<<< * saturated.add(ws) * return */ __pyx_t_9 = (0.4 < __pyx_v_pending); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_pending > (1.9 * __pyx_v_avg)); } __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":2628 * pending: double = occ * (p - nc) / (p * nc) * if 0.4 < pending > 1.9 * avg: * saturated.add(ws) # <<<<<<<<<<<<<< * return * */ if (unlikely(__pyx_v_saturated == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 2628, __pyx_L1_error) } __pyx_t_12 = PySet_Add(__pyx_v_saturated, ((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2628, __pyx_L1_error) /* "distributed/scheduler.py":2629 * if 0.4 < pending > 1.9 * avg: * saturated.add(ws) * return # <<<<<<<<<<<<<< * * saturated.discard(ws) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":2627 * if p > nc: * pending: double = occ * (p - nc) / (p * nc) * if 0.4 < pending > 1.9 * avg: # <<<<<<<<<<<<<< * saturated.add(ws) * return */ } /* "distributed/scheduler.py":2625 * idle.pop(ws._address, None) * * if p > nc: # <<<<<<<<<<<<<< * pending: double = occ * (p - nc) / (p * nc) * if 0.4 < pending > 1.9 * avg: */ } /* "distributed/scheduler.py":2631 * return * * saturated.discard(ws) # <<<<<<<<<<<<<< * * @ccall */ if (unlikely(__pyx_v_saturated == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 2631, __pyx_L1_error) } __pyx_t_12 = __Pyx_PySet_Discard(__pyx_v_saturated, ((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2631, __pyx_L1_error) } __pyx_L7:; /* "distributed/scheduler.py":2592 * @ccall * @exceptval(check=False) * def check_idle_saturated(self, ws: WorkerState, occ: double = -1.0): # <<<<<<<<<<<<<< * """Update the status of the idle and saturated state * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.check_idle_saturated", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_idle); __Pyx_XDECREF(__pyx_v_saturated); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_37check_idle_saturated(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_14SchedulerState_36check_idle_saturated[] = "Update the status of the idle and saturated state\n\n The scheduler keeps track of workers that are ..\n\n - Saturated: have enough work to stay busy\n - Idle: do not have enough work to stay busy\n\n They are considered saturated if they both have enough tasks to occupy\n all of their threads, and if the expected runtime of those tasks is\n large enough.\n\n This is useful for load balancing and adaptivity.\n "; static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_37check_idle_saturated(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; double __pyx_v_occ; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_idle_saturated (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ws,&__pyx_n_s_occ,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ws)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_occ); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check_idle_saturated") < 0)) __PYX_ERR(0, 2592, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)values[0]); if (values[1]) { __pyx_v_occ = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_occ == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2592, __pyx_L3_error) } else { __pyx_v_occ = __pyx_k__13; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("check_idle_saturated", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2592, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.check_idle_saturated", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState, 1, "ws", 0))) __PYX_ERR(0, 2592, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_36check_idle_saturated(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_ws, __pyx_v_occ); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_36check_idle_saturated(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, double __pyx_v_occ) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_check_idle_saturated __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_idle_saturated", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.occ = __pyx_v_occ; __pyx_t_1 = __pyx_vtabptr_11distributed_9scheduler_SchedulerState->check_idle_saturated(__pyx_v_self, __pyx_v_ws, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.check_idle_saturated", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2634 * * @ccall * def get_comm_cost(self, ts: TaskState, ws: WorkerState) -> double: # <<<<<<<<<<<<<< * """ * Get the estimated communication cost (in s.) to compute the task */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_39get_comm_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static double __pyx_f_11distributed_9scheduler_14SchedulerState_get_comm_cost(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_deps = 0; Py_ssize_t __pyx_v_nbytes; double __pyx_v_bandwidth; double __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; double __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_comm_cost", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_comm_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_39get_comm_cost)) { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_ts)); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_ws)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_7; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2640 * """ * dts: TaskState * deps: set = ts._dependencies - ws._has_what # <<<<<<<<<<<<<< * nbytes: Py_ssize_t = 0 * bandwidth: double = self._bandwidth */ __pyx_t_1 = PyNumber_Subtract(__pyx_v_ts->_dependencies, __pyx_v_ws->_has_what); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 2640, __pyx_L1_error) __pyx_v_deps = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2641 * dts: TaskState * deps: set = ts._dependencies - ws._has_what * nbytes: Py_ssize_t = 0 # <<<<<<<<<<<<<< * bandwidth: double = self._bandwidth * for dts in deps: */ __pyx_v_nbytes = 0; /* "distributed/scheduler.py":2642 * deps: set = ts._dependencies - ws._has_what * nbytes: Py_ssize_t = 0 * bandwidth: double = self._bandwidth # <<<<<<<<<<<<<< * for dts in deps: * nbytes += dts._nbytes */ __pyx_t_7 = __pyx_v_self->_bandwidth; __pyx_v_bandwidth = __pyx_t_7; /* "distributed/scheduler.py":2643 * nbytes: Py_ssize_t = 0 * bandwidth: double = self._bandwidth * for dts in deps: # <<<<<<<<<<<<<< * nbytes += dts._nbytes * return nbytes / bandwidth */ __pyx_t_8 = 0; __pyx_t_2 = __Pyx_set_iterator(__pyx_v_deps, 1, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_8, &__pyx_t_2, __pyx_t_5); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2643, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":2644 * bandwidth: double = self._bandwidth * for dts in deps: * nbytes += dts._nbytes # <<<<<<<<<<<<<< * return nbytes / bandwidth * */ __pyx_v_nbytes = (__pyx_v_nbytes + __pyx_v_dts->_nbytes); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2645 * for dts in deps: * nbytes += dts._nbytes * return nbytes / bandwidth # <<<<<<<<<<<<<< * * @ccall */ if (unlikely(__pyx_v_bandwidth == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 2645, __pyx_L1_error) } __pyx_r = (((double)__pyx_v_nbytes) / __pyx_v_bandwidth); goto __pyx_L0; /* "distributed/scheduler.py":2634 * * @ccall * def get_comm_cost(self, ts: TaskState, ws: WorkerState) -> double: # <<<<<<<<<<<<<< * """ * Get the estimated communication cost (in s.) to compute the task */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.get_comm_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_deps); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_39get_comm_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_14SchedulerState_38get_comm_cost[] = "\n Get the estimated communication cost (in s.) to compute the task\n on the given worker.\n "; static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_39get_comm_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_comm_cost (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_ws,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ws)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_comm_cost", 1, 2, 2, 1); __PYX_ERR(0, 2634, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_comm_cost") < 0)) __PYX_ERR(0, 2634, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[0]); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_comm_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2634, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.get_comm_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 2634, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState, 1, "ws", 0))) __PYX_ERR(0, 2634, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_38get_comm_cost(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_ts, __pyx_v_ws); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_38get_comm_cost(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_comm_cost", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_14SchedulerState_get_comm_cost(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2634, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.get_comm_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2648 * * @ccall * def get_task_duration(self, ts: TaskState, default: double = -1) -> double: # <<<<<<<<<<<<<< * """ * Get the estimated computation cost of the given task */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_41get_task_duration(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static double __pyx_f_11distributed_9scheduler_14SchedulerState_get_task_duration(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, int __pyx_skip_dispatch, struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_get_task_duration *__pyx_optional_args) { double __pyx_v_default = ((double)-1.0); double __pyx_v_duration; PyObject *__pyx_v_s = 0; double __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; double __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_task_duration", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default = __pyx_optional_args->__pyx_default; } } /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_task_duration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_41get_task_duration)) { __pyx_t_3 = PyFloat_FromDouble(__pyx_v_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_ts), __pyx_t_3}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2648, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_ts), __pyx_t_3}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2648, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_8; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2653 * (not including any communication cost). * """ * duration: double = ts._prefix._duration_average # <<<<<<<<<<<<<< * if duration < 0: * s: set = self._unknown_durations[ts._prefix._name] */ __pyx_t_8 = __pyx_v_ts->_prefix->_duration_average; __pyx_v_duration = __pyx_t_8; /* "distributed/scheduler.py":2654 * """ * duration: double = ts._prefix._duration_average * if duration < 0: # <<<<<<<<<<<<<< * s: set = self._unknown_durations[ts._prefix._name] * s.add(ts) */ __pyx_t_9 = ((__pyx_v_duration < 0.0) != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":2655 * duration: double = ts._prefix._duration_average * if duration < 0: * s: set = self._unknown_durations[ts._prefix._name] # <<<<<<<<<<<<<< * s.add(ts) * if default < 0: */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_unknown_durations, __pyx_v_ts->_prefix->_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 2655, __pyx_L1_error) __pyx_v_s = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2656 * if duration < 0: * s: set = self._unknown_durations[ts._prefix._name] * s.add(ts) # <<<<<<<<<<<<<< * if default < 0: * duration = UNKNOWN_TASK_DURATION */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 2656, __pyx_L1_error) } __pyx_t_10 = PySet_Add(__pyx_v_s, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 2656, __pyx_L1_error) /* "distributed/scheduler.py":2657 * s: set = self._unknown_durations[ts._prefix._name] * s.add(ts) * if default < 0: # <<<<<<<<<<<<<< * duration = UNKNOWN_TASK_DURATION * else: */ __pyx_t_9 = ((__pyx_v_default < 0.0) != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":2658 * s.add(ts) * if default < 0: * duration = UNKNOWN_TASK_DURATION # <<<<<<<<<<<<<< * else: * duration = default */ __pyx_v_duration = __pyx_v_11distributed_9scheduler_UNKNOWN_TASK_DURATION; /* "distributed/scheduler.py":2657 * s: set = self._unknown_durations[ts._prefix._name] * s.add(ts) * if default < 0: # <<<<<<<<<<<<<< * duration = UNKNOWN_TASK_DURATION * else: */ goto __pyx_L4; } /* "distributed/scheduler.py":2660 * duration = UNKNOWN_TASK_DURATION * else: * duration = default # <<<<<<<<<<<<<< * * return duration */ /*else*/ { __pyx_v_duration = __pyx_v_default; } __pyx_L4:; /* "distributed/scheduler.py":2654 * """ * duration: double = ts._prefix._duration_average * if duration < 0: # <<<<<<<<<<<<<< * s: set = self._unknown_durations[ts._prefix._name] * s.add(ts) */ } /* "distributed/scheduler.py":2662 * duration = default * * return duration # <<<<<<<<<<<<<< * * @ccall */ __pyx_r = __pyx_v_duration; goto __pyx_L0; /* "distributed/scheduler.py":2648 * * @ccall * def get_task_duration(self, ts: TaskState, default: double = -1) -> double: # <<<<<<<<<<<<<< * """ * Get the estimated computation cost of the given task */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.get_task_duration", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_41get_task_duration(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_14SchedulerState_40get_task_duration[] = "\n Get the estimated computation cost of the given task\n (not including any communication cost).\n "; static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_41get_task_duration(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; double __pyx_v_default; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_task_duration (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_task_duration") < 0)) __PYX_ERR(0, 2648, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[0]); if (values[1]) { __pyx_v_default = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_default == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L3_error) } else { __pyx_v_default = ((double)-1.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_task_duration", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2648, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.get_task_duration", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 2648, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_40get_task_duration(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_ts, __pyx_v_default); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_40get_task_duration(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, double __pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_get_task_duration __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_task_duration", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.__pyx_default = __pyx_v_default; __pyx_t_1 = __pyx_vtabptr_11distributed_9scheduler_SchedulerState->get_task_duration(__pyx_v_self, __pyx_v_ts, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L1_error) __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.get_task_duration", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2666 * @ccall * @exceptval(check=False) * def valid_workers(self, ts: TaskState) -> set: # <<<<<<<<<<<<<< * """Return set of currently valid workers for key * */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_43valid_workers(PyObject *__pyx_v_self, PyObject *__pyx_v_ts); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_valid_workers(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, int __pyx_skip_dispatch) { PyObject *__pyx_v_s = 0; PyObject *__pyx_v_hr = 0; PyObject *__pyx_v_sl = 0; PyObject *__pyx_v_ss = 0; PyObject *__pyx_v_dw = 0; PyObject *__pyx_v_ww = 0; PyObject *__pyx_9genexpr24__pyx_v_w = NULL; PyObject *__pyx_9genexpr25__pyx_v_h = NULL; PyObject *__pyx_9genexpr26__pyx_v_h = NULL; PyObject *__pyx_9genexpr27__pyx_v_resource = NULL; PyObject *__pyx_9genexpr27__pyx_v_required = NULL; PyObject *__pyx_9genexpr28__pyx_v_w = NULL; PyObject *__pyx_9genexpr28__pyx_v_supplied = NULL; PyObject *__pyx_9genexpr29__pyx_v_w = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; Py_ssize_t __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("valid_workers", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_43valid_workers)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PySet_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 2666, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2676 * * resource_restrictions * """ * s: set = None # <<<<<<<<<<<<<< * * if ts._worker_restrictions: */ __Pyx_INCREF(Py_None); __pyx_v_s = ((PyObject*)Py_None); /* "distributed/scheduler.py":2678 * s: set = None * * if ts._worker_restrictions: # <<<<<<<<<<<<<< * s = {w for w in ts._worker_restrictions if w in self._workers_dv} * */ __pyx_t_5 = (__pyx_v_ts->_worker_restrictions != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_worker_restrictions) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2679 * * if ts._worker_restrictions: * s = {w for w in ts._worker_restrictions if w in self._workers_dv} # <<<<<<<<<<<<<< * * if ts._host_restrictions: */ { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2679, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_v_ts->_worker_restrictions, 1, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2679, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_7, &__pyx_t_6, &__pyx_t_3, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2679, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_w, __pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_v_self->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2679, __pyx_L6_error) } __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_9genexpr24__pyx_v_w, __pyx_v_self->_workers_dv, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2679, __pyx_L6_error) __pyx_t_10 = (__pyx_t_5 != 0); if (__pyx_t_10) { if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_9genexpr24__pyx_v_w))) __PYX_ERR(0, 2679, __pyx_L6_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_w); __pyx_9genexpr24__pyx_v_w = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_w); __pyx_9genexpr24__pyx_v_w = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":2678 * s: set = None * * if ts._worker_restrictions: # <<<<<<<<<<<<<< * s = {w for w in ts._worker_restrictions if w in self._workers_dv} * */ } /* "distributed/scheduler.py":2681 * s = {w for w in ts._worker_restrictions if w in self._workers_dv} * * if ts._host_restrictions: # <<<<<<<<<<<<<< * # Resolve the alias here rather than early, for the worker * # may not be connected when host_restrictions is populated */ __pyx_t_10 = (__pyx_v_ts->_host_restrictions != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_host_restrictions) != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":2684 * # Resolve the alias here rather than early, for the worker * # may not be connected when host_restrictions is populated * hr: list = [self.coerce_hostname(h) for h in ts._host_restrictions] # <<<<<<<<<<<<<< * # XXX need HostState? * sl: list = [ */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2684, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_v_ts->_host_restrictions, 1, (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2684, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_7, &__pyx_t_3, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2684, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_h, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_self->__pyx_vtab)->coerce_hostname(__pyx_v_self, __pyx_9genexpr25__pyx_v_h, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2684, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2684, __pyx_L14_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_h); __pyx_9genexpr25__pyx_v_h = 0; goto __pyx_L17_exit_scope; __pyx_L14_error:; __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_h); __pyx_9genexpr25__pyx_v_h = 0; goto __pyx_L1_error; __pyx_L17_exit_scope:; } /* exit inner scope */ __pyx_v_hr = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2686 * hr: list = [self.coerce_hostname(h) for h in ts._host_restrictions] * # XXX need HostState? * sl: list = [ # <<<<<<<<<<<<<< * self._host_info[h]["addresses"] for h in hr if h in self._host_info * ] */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2686, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":2687 * # XXX need HostState? * sl: list = [ * self._host_info[h]["addresses"] for h in hr if h in self._host_info # <<<<<<<<<<<<<< * ] * ss: set = set.union(*sl) if sl else set() */ __pyx_t_2 = __pyx_v_hr; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2687, __pyx_L20_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2687, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_h, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr26__pyx_v_h, __pyx_v_self->_host_info, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2687, __pyx_L20_error) __pyx_t_5 = (__pyx_t_10 != 0); if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->_host_info, __pyx_9genexpr26__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2687, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_addresses); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2687, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2686, __pyx_L20_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_h); __pyx_9genexpr26__pyx_v_h = 0; goto __pyx_L24_exit_scope; __pyx_L20_error:; __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_h); __pyx_9genexpr26__pyx_v_h = 0; goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ __pyx_v_sl = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2689 * self._host_info[h]["addresses"] for h in hr if h in self._host_info * ] * ss: set = set.union(*sl) if sl else set() # <<<<<<<<<<<<<< * if s is None: * s = ss */ __pyx_t_5 = (PyList_GET_SIZE(__pyx_v_sl) != 0); if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PySet_Type)), __pyx_n_s_union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_Tuple(__pyx_v_sl); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PySet_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 2689, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __pyx_v_ss = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2690 * ] * ss: set = set.union(*sl) if sl else set() * if s is None: # <<<<<<<<<<<<<< * s = ss * else: */ __pyx_t_5 = (__pyx_v_s == ((PyObject*)Py_None)); __pyx_t_10 = (__pyx_t_5 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":2691 * ss: set = set.union(*sl) if sl else set() * if s is None: * s = ss # <<<<<<<<<<<<<< * else: * s |= ss */ __Pyx_INCREF(__pyx_v_ss); __Pyx_DECREF_SET(__pyx_v_s, __pyx_v_ss); /* "distributed/scheduler.py":2690 * ] * ss: set = set.union(*sl) if sl else set() * if s is None: # <<<<<<<<<<<<<< * s = ss * else: */ goto __pyx_L25; } /* "distributed/scheduler.py":2693 * s = ss * else: * s |= ss # <<<<<<<<<<<<<< * * if ts._resource_restrictions: */ /*else*/ { __pyx_t_1 = PyNumber_InPlaceOr(__pyx_v_s, __pyx_v_ss); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L25:; /* "distributed/scheduler.py":2681 * s = {w for w in ts._worker_restrictions if w in self._workers_dv} * * if ts._host_restrictions: # <<<<<<<<<<<<<< * # Resolve the alias here rather than early, for the worker * # may not be connected when host_restrictions is populated */ } /* "distributed/scheduler.py":2695 * s |= ss * * if ts._resource_restrictions: # <<<<<<<<<<<<<< * dw: dict = { * resource: { */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_resource_restrictions); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2695, __pyx_L1_error) if (__pyx_t_10) { /* "distributed/scheduler.py":2696 * * if ts._resource_restrictions: * dw: dict = { # <<<<<<<<<<<<<< * resource: { * w */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2696, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":2702 * if supplied >= required * } * for resource, required in ts._resource_restrictions.items() # <<<<<<<<<<<<<< * } * */ __pyx_t_6 = 0; if (unlikely(__pyx_v_ts->_resource_restrictions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 2702, __pyx_L29_error) } __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_ts->_resource_restrictions, 1, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2702, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_7, &__pyx_t_6, &__pyx_t_4, &__pyx_t_2, NULL, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2702, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_resource, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_required, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2697 * if ts._resource_restrictions: * dw: dict = { * resource: { # <<<<<<<<<<<<<< * w * for w, supplied in self._resources[resource].items() */ { /* enter inner scope */ __pyx_t_2 = PySet_New(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2697, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":2699 * resource: { * w * for w, supplied in self._resources[resource].items() # <<<<<<<<<<<<<< * if supplied >= required * } */ __pyx_t_11 = 0; __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_self->_resources, __pyx_9genexpr27__pyx_v_resource); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2699, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_13); if (unlikely(__pyx_t_13 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 2699, __pyx_L34_error) } __pyx_t_14 = __Pyx_dict_iterator(__pyx_t_13, 0, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_9)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2699, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_14; __pyx_t_14 = 0; while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_12, &__pyx_t_11, &__pyx_t_14, &__pyx_t_13, NULL, __pyx_t_9); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 2699, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_w, __pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_supplied, __pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":2700 * w * for w, supplied in self._resources[resource].items() * if supplied >= required # <<<<<<<<<<<<<< * } * for resource, required in ts._resource_restrictions.items() */ __pyx_t_13 = PyObject_RichCompare(__pyx_9genexpr28__pyx_v_supplied, __pyx_9genexpr27__pyx_v_required, Py_GE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2700, __pyx_L34_error) __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2700, __pyx_L34_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_10) { /* "distributed/scheduler.py":2698 * dw: dict = { * resource: { * w # <<<<<<<<<<<<<< * for w, supplied in self._resources[resource].items() * if supplied >= required */ if (unlikely(PySet_Add(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_w))) __PYX_ERR(0, 2698, __pyx_L34_error) /* "distributed/scheduler.py":2700 * w * for w, supplied in self._resources[resource].items() * if supplied >= required # <<<<<<<<<<<<<< * } * for resource, required in ts._resource_restrictions.items() */ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_supplied); __pyx_9genexpr28__pyx_v_supplied = 0; __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_w); __pyx_9genexpr28__pyx_v_w = 0; goto __pyx_L38_exit_scope; __pyx_L34_error:; __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_supplied); __pyx_9genexpr28__pyx_v_supplied = 0; __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_w); __pyx_9genexpr28__pyx_v_w = 0; goto __pyx_L29_error; __pyx_L38_exit_scope:; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr27__pyx_v_resource, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2697, __pyx_L29_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_required); __pyx_9genexpr27__pyx_v_required = 0; __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_resource); __pyx_9genexpr27__pyx_v_resource = 0; goto __pyx_L39_exit_scope; __pyx_L29_error:; __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_required); __pyx_9genexpr27__pyx_v_required = 0; __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_resource); __pyx_9genexpr27__pyx_v_resource = 0; goto __pyx_L1_error; __pyx_L39_exit_scope:; } /* exit inner scope */ __pyx_v_dw = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2705 * } * * ww: set = set.intersection(*dw.values()) # <<<<<<<<<<<<<< * if s is None: * s = ww */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PySet_Type)), __pyx_n_s_intersection); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_Values(__pyx_v_dw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PySet_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 2705, __pyx_L1_error) __pyx_v_ww = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2706 * * ww: set = set.intersection(*dw.values()) * if s is None: # <<<<<<<<<<<<<< * s = ww * else: */ __pyx_t_10 = (__pyx_v_s == ((PyObject*)Py_None)); __pyx_t_5 = (__pyx_t_10 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2707 * ww: set = set.intersection(*dw.values()) * if s is None: * s = ww # <<<<<<<<<<<<<< * else: * s &= ww */ __Pyx_INCREF(__pyx_v_ww); __Pyx_DECREF_SET(__pyx_v_s, __pyx_v_ww); /* "distributed/scheduler.py":2706 * * ww: set = set.intersection(*dw.values()) * if s is None: # <<<<<<<<<<<<<< * s = ww * else: */ goto __pyx_L40; } /* "distributed/scheduler.py":2709 * s = ww * else: * s &= ww # <<<<<<<<<<<<<< * * if s is not None: */ /*else*/ { __pyx_t_3 = PyNumber_InPlaceAnd(__pyx_v_s, __pyx_v_ww); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; } __pyx_L40:; /* "distributed/scheduler.py":2695 * s |= ss * * if ts._resource_restrictions: # <<<<<<<<<<<<<< * dw: dict = { * resource: { */ } /* "distributed/scheduler.py":2711 * s &= ww * * if s is not None: # <<<<<<<<<<<<<< * s = {self._workers_dv[w] for w in s} * */ __pyx_t_5 = (__pyx_v_s != ((PyObject*)Py_None)); __pyx_t_10 = (__pyx_t_5 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":2712 * * if s is not None: * s = {self._workers_dv[w] for w in s} # <<<<<<<<<<<<<< * * return s */ { /* enter inner scope */ __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2712, __pyx_L44_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_set_iterator(__pyx_v_s, 1, (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2712, __pyx_L44_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_7, &__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2712, __pyx_L44_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_w, __pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_self->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2712, __pyx_L44_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_workers_dv, __pyx_9genexpr29__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2712, __pyx_L44_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 2712, __pyx_L44_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_w); __pyx_9genexpr29__pyx_v_w = 0; goto __pyx_L47_exit_scope; __pyx_L44_error:; __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_w); __pyx_9genexpr29__pyx_v_w = 0; goto __pyx_L1_error; __pyx_L47_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":2711 * s &= ww * * if s is not None: # <<<<<<<<<<<<<< * s = {self._workers_dv[w] for w in s} * */ } /* "distributed/scheduler.py":2714 * s = {self._workers_dv[w] for w in s} * * return s # <<<<<<<<<<<<<< * * @ccall */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; /* "distributed/scheduler.py":2666 * @ccall * @exceptval(check=False) * def valid_workers(self, ts: TaskState) -> set: # <<<<<<<<<<<<<< * """Return set of currently valid workers for key * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.valid_workers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_hr); __Pyx_XDECREF(__pyx_v_sl); __Pyx_XDECREF(__pyx_v_ss); __Pyx_XDECREF(__pyx_v_dw); __Pyx_XDECREF(__pyx_v_ww); __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_w); __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_h); __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_h); __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_resource); __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_required); __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_w); __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_supplied); __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_w); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_43valid_workers(PyObject *__pyx_v_self, PyObject *__pyx_v_ts); /*proto*/ static char __pyx_doc_11distributed_9scheduler_14SchedulerState_42valid_workers[] = "Return set of currently valid workers for key\n\n If all workers are valid then this returns ``None``.\n This checks tracks the following state:\n\n * worker_restrictions\n * host_restrictions\n * resource_restrictions\n "; static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_43valid_workers(PyObject *__pyx_v_self, PyObject *__pyx_v_ts) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("valid_workers (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 2666, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_42valid_workers(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_ts)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_42valid_workers(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("valid_workers", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_14SchedulerState_valid_workers(__pyx_v_self, __pyx_v_ts, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.valid_workers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2717 * * @ccall * def consume_resources(self, ts: TaskState, ws: WorkerState): # <<<<<<<<<<<<<< * if ts._resource_restrictions: * for r, required in ts._resource_restrictions.items(): */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_45consume_resources(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_consume_resources(CYTHON_UNUSED struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_required = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("consume_resources", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_consume_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_45consume_resources)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_ts)); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_ws)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2718 * @ccall * def consume_resources(self, ts: TaskState, ws: WorkerState): * if ts._resource_restrictions: # <<<<<<<<<<<<<< * for r, required in ts._resource_restrictions.items(): * ws._used_resources[r] += required */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_resource_restrictions); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2718, __pyx_L1_error) if (__pyx_t_7) { /* "distributed/scheduler.py":2719 * def consume_resources(self, ts: TaskState, ws: WorkerState): * if ts._resource_restrictions: * for r, required in ts._resource_restrictions.items(): # <<<<<<<<<<<<<< * ws._used_resources[r] += required * */ __pyx_t_8 = 0; if (unlikely(__pyx_v_ts->_resource_restrictions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 2719, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_ts->_resource_restrictions, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_8, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_5); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_required, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2720 * if ts._resource_restrictions: * for r, required in ts._resource_restrictions.items(): * ws._used_resources[r] += required # <<<<<<<<<<<<<< * * @ccall */ if (unlikely(__pyx_v_ws->_used_resources == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2720, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_ws->_used_resources); __pyx_t_11 = __pyx_v_ws->_used_resources; __Pyx_INCREF(__pyx_v_r); __pyx_t_3 = __pyx_v_r; if (unlikely(__pyx_t_11 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2720, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_required); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_11 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2720, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_t_11, __pyx_t_3, __pyx_t_6) < 0)) __PYX_ERR(0, 2720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2718 * @ccall * def consume_resources(self, ts: TaskState, ws: WorkerState): * if ts._resource_restrictions: # <<<<<<<<<<<<<< * for r, required in ts._resource_restrictions.items(): * ws._used_resources[r] += required */ } /* "distributed/scheduler.py":2717 * * @ccall * def consume_resources(self, ts: TaskState, ws: WorkerState): # <<<<<<<<<<<<<< * if ts._resource_restrictions: * for r, required in ts._resource_restrictions.items(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.consume_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_required); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_45consume_resources(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_45consume_resources(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("consume_resources (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_ws,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ws)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("consume_resources", 1, 2, 2, 1); __PYX_ERR(0, 2717, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "consume_resources") < 0)) __PYX_ERR(0, 2717, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[0]); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("consume_resources", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2717, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.consume_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 2717, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState, 1, "ws", 0))) __PYX_ERR(0, 2717, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_44consume_resources(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_ts, __pyx_v_ws); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_44consume_resources(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("consume_resources", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_14SchedulerState_consume_resources(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.consume_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2723 * * @ccall * def release_resources(self, ts: TaskState, ws: WorkerState): # <<<<<<<<<<<<<< * if ts._resource_restrictions: * for r, required in ts._resource_restrictions.items(): */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_47release_resources(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_release_resources(CYTHON_UNUSED struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_required = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("release_resources", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_47release_resources)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_ts)); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_ws)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2724 * @ccall * def release_resources(self, ts: TaskState, ws: WorkerState): * if ts._resource_restrictions: # <<<<<<<<<<<<<< * for r, required in ts._resource_restrictions.items(): * ws._used_resources[r] -= required */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_resource_restrictions); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2724, __pyx_L1_error) if (__pyx_t_7) { /* "distributed/scheduler.py":2725 * def release_resources(self, ts: TaskState, ws: WorkerState): * if ts._resource_restrictions: * for r, required in ts._resource_restrictions.items(): # <<<<<<<<<<<<<< * ws._used_resources[r] -= required * */ __pyx_t_8 = 0; if (unlikely(__pyx_v_ts->_resource_restrictions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 2725, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_ts->_resource_restrictions, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_8, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_5); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_required, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2726 * if ts._resource_restrictions: * for r, required in ts._resource_restrictions.items(): * ws._used_resources[r] -= required # <<<<<<<<<<<<<< * * @ccall */ if (unlikely(__pyx_v_ws->_used_resources == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2726, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_ws->_used_resources); __pyx_t_11 = __pyx_v_ws->_used_resources; __Pyx_INCREF(__pyx_v_r); __pyx_t_3 = __pyx_v_r; if (unlikely(__pyx_t_11 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2726, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_required); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_11 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2726, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_t_11, __pyx_t_3, __pyx_t_6) < 0)) __PYX_ERR(0, 2726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2724 * @ccall * def release_resources(self, ts: TaskState, ws: WorkerState): * if ts._resource_restrictions: # <<<<<<<<<<<<<< * for r, required in ts._resource_restrictions.items(): * ws._used_resources[r] -= required */ } /* "distributed/scheduler.py":2723 * * @ccall * def release_resources(self, ts: TaskState, ws: WorkerState): # <<<<<<<<<<<<<< * if ts._resource_restrictions: * for r, required in ts._resource_restrictions.items(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.release_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_required); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_47release_resources(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_47release_resources(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("release_resources (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_ws,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ws)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("release_resources", 1, 2, 2, 1); __PYX_ERR(0, 2723, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "release_resources") < 0)) __PYX_ERR(0, 2723, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[0]); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("release_resources", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2723, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.release_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 2723, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState, 1, "ws", 0))) __PYX_ERR(0, 2723, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_46release_resources(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_ts, __pyx_v_ws); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_46release_resources(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("release_resources", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_14SchedulerState_release_resources(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.release_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2729 * * @ccall * def coerce_hostname(self, host): # <<<<<<<<<<<<<< * """ * Coerce the hostname of a worker. */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_49coerce_hostname(PyObject *__pyx_v_self, PyObject *__pyx_v_host); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_coerce_hostname(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coerce_hostname", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_coerce_hostname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_49coerce_hostname)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_host) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_host); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2733 * Coerce the hostname of a worker. * """ * if host in self._aliases: # <<<<<<<<<<<<<< * return self._workers_dv[self._aliases[host]].host * else: */ if (unlikely(__pyx_v_self->_aliases == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2733, __pyx_L1_error) } __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_host, __pyx_v_self->_aliases, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2733, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":2734 * """ * if host in self._aliases: * return self._workers_dv[self._aliases[host]].host # <<<<<<<<<<<<<< * else: * return host */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_self->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2734, __pyx_L1_error) } if (unlikely(__pyx_v_self->_aliases == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2734, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_aliases, __pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->_workers_dv, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":2733 * Coerce the hostname of a worker. * """ * if host in self._aliases: # <<<<<<<<<<<<<< * return self._workers_dv[self._aliases[host]].host * else: */ } /* "distributed/scheduler.py":2736 * return self._workers_dv[self._aliases[host]].host * else: * return host # <<<<<<<<<<<<<< * * @ccall */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_host); __pyx_r = __pyx_v_host; goto __pyx_L0; } /* "distributed/scheduler.py":2729 * * @ccall * def coerce_hostname(self, host): # <<<<<<<<<<<<<< * """ * Coerce the hostname of a worker. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.coerce_hostname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_49coerce_hostname(PyObject *__pyx_v_self, PyObject *__pyx_v_host); /*proto*/ static char __pyx_doc_11distributed_9scheduler_14SchedulerState_48coerce_hostname[] = "\n Coerce the hostname of a worker.\n "; static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_49coerce_hostname(PyObject *__pyx_v_self, PyObject *__pyx_v_host) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coerce_hostname (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_48coerce_hostname(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v_host)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_48coerce_hostname(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v_host) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coerce_hostname", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_14SchedulerState_coerce_hostname(__pyx_v_self, __pyx_v_host, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.coerce_hostname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2740 * @ccall * @exceptval(check=False) * def worker_objective(self, ts: TaskState, ws: WorkerState) -> tuple: # <<<<<<<<<<<<<< * """ * Objective function to determine which worker should get the task */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_51worker_objective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_11distributed_9scheduler_14SchedulerState_worker_objective(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, int __pyx_skip_dispatch) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; Py_ssize_t __pyx_v_nbytes; Py_ssize_t __pyx_v_comm_bytes; double __pyx_v_bandwidth; double __pyx_v_stack_time; double __pyx_v_start_time; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; Py_ssize_t __pyx_t_12; double __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("worker_objective", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_worker_objective); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_11distributed_9scheduler_14SchedulerState_51worker_objective)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2740, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ts), ((PyObject *)__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2740, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_ts)); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_ws)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 2740, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "distributed/scheduler.py":2748 * dts: TaskState * nbytes: Py_ssize_t * comm_bytes: Py_ssize_t = 0 # <<<<<<<<<<<<<< * for dts in ts._dependencies: * if ws not in dts._who_has: */ __pyx_v_comm_bytes = 0; /* "distributed/scheduler.py":2749 * nbytes: Py_ssize_t * comm_bytes: Py_ssize_t = 0 * for dts in ts._dependencies: # <<<<<<<<<<<<<< * if ws not in dts._who_has: * nbytes = dts.get_nbytes() */ __pyx_t_7 = 0; __pyx_t_2 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, __pyx_t_5); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 2749, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":2750 * comm_bytes: Py_ssize_t = 0 * for dts in ts._dependencies: * if ws not in dts._who_has: # <<<<<<<<<<<<<< * nbytes = dts.get_nbytes() * comm_bytes += nbytes */ if (unlikely(__pyx_v_dts->_who_has == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2750, __pyx_L1_error) } __pyx_t_10 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ws), __pyx_v_dts->_who_has, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2750, __pyx_L1_error) __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { /* "distributed/scheduler.py":2751 * for dts in ts._dependencies: * if ws not in dts._who_has: * nbytes = dts.get_nbytes() # <<<<<<<<<<<<<< * comm_bytes += nbytes * */ __pyx_t_12 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_dts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2751, __pyx_L1_error) __pyx_v_nbytes = __pyx_t_12; /* "distributed/scheduler.py":2752 * if ws not in dts._who_has: * nbytes = dts.get_nbytes() * comm_bytes += nbytes # <<<<<<<<<<<<<< * * bandwidth: double = self._bandwidth */ __pyx_v_comm_bytes = (__pyx_v_comm_bytes + __pyx_v_nbytes); /* "distributed/scheduler.py":2750 * comm_bytes: Py_ssize_t = 0 * for dts in ts._dependencies: * if ws not in dts._who_has: # <<<<<<<<<<<<<< * nbytes = dts.get_nbytes() * comm_bytes += nbytes */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2754 * comm_bytes += nbytes * * bandwidth: double = self._bandwidth # <<<<<<<<<<<<<< * stack_time: double = ws._occupancy / ws._nthreads * start_time: double = stack_time + comm_bytes / bandwidth */ __pyx_t_13 = __pyx_v_self->_bandwidth; __pyx_v_bandwidth = __pyx_t_13; /* "distributed/scheduler.py":2755 * * bandwidth: double = self._bandwidth * stack_time: double = ws._occupancy / ws._nthreads # <<<<<<<<<<<<<< * start_time: double = stack_time + comm_bytes / bandwidth * */ if (unlikely(__pyx_v_ws->_nthreads == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 2755, __pyx_L1_error) } __pyx_v_stack_time = (__pyx_v_ws->_occupancy / ((double)__pyx_v_ws->_nthreads)); /* "distributed/scheduler.py":2756 * bandwidth: double = self._bandwidth * stack_time: double = ws._occupancy / ws._nthreads * start_time: double = stack_time + comm_bytes / bandwidth # <<<<<<<<<<<<<< * * if ts._actor: */ if (unlikely(__pyx_v_bandwidth == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 2756, __pyx_L1_error) } __pyx_v_start_time = (__pyx_v_stack_time + (((double)__pyx_v_comm_bytes) / __pyx_v_bandwidth)); /* "distributed/scheduler.py":2758 * start_time: double = stack_time + comm_bytes / bandwidth * * if ts._actor: # <<<<<<<<<<<<<< * return (len(ws._actors), start_time, ws._nbytes) * else: */ __pyx_t_11 = (__pyx_v_ts->_actor != 0); if (__pyx_t_11) { /* "distributed/scheduler.py":2759 * * if ts._actor: * return (len(ws._actors), start_time, ws._nbytes) # <<<<<<<<<<<<<< * else: * return (start_time, ws._nbytes) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_ws->_actors; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 2759, __pyx_L1_error) } __pyx_t_8 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2759, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_start_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_ws->_nbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; /* "distributed/scheduler.py":2758 * start_time: double = stack_time + comm_bytes / bandwidth * * if ts._actor: # <<<<<<<<<<<<<< * return (len(ws._actors), start_time, ws._nbytes) * else: */ } /* "distributed/scheduler.py":2761 * return (len(ws._actors), start_time, ws._nbytes) * else: * return (start_time, ws._nbytes) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_start_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_ws->_nbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":2740 * @ccall * @exceptval(check=False) * def worker_objective(self, ts: TaskState, ws: WorkerState) -> tuple: # <<<<<<<<<<<<<< * """ * Objective function to determine which worker should get the task */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.worker_objective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_51worker_objective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_14SchedulerState_50worker_objective[] = "\n Objective function to determine which worker should get the task\n\n Minimize expected start time. If a tie then break with data storage.\n "; static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_51worker_objective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("worker_objective (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_ws,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ws)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("worker_objective", 1, 2, 2, 1); __PYX_ERR(0, 2740, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "worker_objective") < 0)) __PYX_ERR(0, 2740, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[0]); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("worker_objective", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2740, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.SchedulerState.worker_objective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 2740, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState, 1, "ws", 0))) __PYX_ERR(0, 2740, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_50worker_objective(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), __pyx_v_ts, __pyx_v_ws); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_50worker_objective(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("worker_objective", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11distributed_9scheduler_14SchedulerState_worker_objective(__pyx_v_self, __pyx_v_ts, __pyx_v_ws, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.worker_objective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_53__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_53__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_52__reduce_cython__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_52__reduce_cython__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._aliases, self._bandwidth, self._clients, self._extensions, self._host_info, self._idle, self._idle_dv, self._n_tasks, self._resources, self._saturated, self._task_groups, self._task_metadata, self._task_prefixes, self._tasks, self._total_nthreads, self._total_occupancy, self._unknown_durations, self._unrunnable, self._validate, self._workers, self._workers_dv) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_bandwidth); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_n_tasks); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->_total_nthreads); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->_total_occupancy); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->_validate); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(21); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_self->_aliases); __Pyx_GIVEREF(__pyx_v_self->_aliases); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->_aliases); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->_clients); __Pyx_GIVEREF(__pyx_v_self->_clients); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_self->_clients); __Pyx_INCREF(__pyx_v_self->_extensions); __Pyx_GIVEREF(__pyx_v_self->_extensions); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_self->_extensions); __Pyx_INCREF(__pyx_v_self->_host_info); __Pyx_GIVEREF(__pyx_v_self->_host_info); PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_self->_host_info); __Pyx_INCREF(__pyx_v_self->_idle); __Pyx_GIVEREF(__pyx_v_self->_idle); PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_v_self->_idle); __Pyx_INCREF(__pyx_v_self->_idle_dv); __Pyx_GIVEREF(__pyx_v_self->_idle_dv); PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_v_self->_idle_dv); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_t_2); __Pyx_INCREF(__pyx_v_self->_resources); __Pyx_GIVEREF(__pyx_v_self->_resources); PyTuple_SET_ITEM(__pyx_t_6, 8, __pyx_v_self->_resources); __Pyx_INCREF(__pyx_v_self->_saturated); __Pyx_GIVEREF(__pyx_v_self->_saturated); PyTuple_SET_ITEM(__pyx_t_6, 9, __pyx_v_self->_saturated); __Pyx_INCREF(__pyx_v_self->_task_groups); __Pyx_GIVEREF(__pyx_v_self->_task_groups); PyTuple_SET_ITEM(__pyx_t_6, 10, __pyx_v_self->_task_groups); __Pyx_INCREF(__pyx_v_self->_task_metadata); __Pyx_GIVEREF(__pyx_v_self->_task_metadata); PyTuple_SET_ITEM(__pyx_t_6, 11, __pyx_v_self->_task_metadata); __Pyx_INCREF(__pyx_v_self->_task_prefixes); __Pyx_GIVEREF(__pyx_v_self->_task_prefixes); PyTuple_SET_ITEM(__pyx_t_6, 12, __pyx_v_self->_task_prefixes); __Pyx_INCREF(__pyx_v_self->_tasks); __Pyx_GIVEREF(__pyx_v_self->_tasks); PyTuple_SET_ITEM(__pyx_t_6, 13, __pyx_v_self->_tasks); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 14, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 15, __pyx_t_4); __Pyx_INCREF(__pyx_v_self->_unknown_durations); __Pyx_GIVEREF(__pyx_v_self->_unknown_durations); PyTuple_SET_ITEM(__pyx_t_6, 16, __pyx_v_self->_unknown_durations); __Pyx_INCREF(__pyx_v_self->_unrunnable); __Pyx_GIVEREF(__pyx_v_self->_unrunnable); PyTuple_SET_ITEM(__pyx_t_6, 17, __pyx_v_self->_unrunnable); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 18, __pyx_t_5); __Pyx_INCREF(__pyx_v_self->_workers); __Pyx_GIVEREF(__pyx_v_self->_workers); PyTuple_SET_ITEM(__pyx_t_6, 19, __pyx_v_self->_workers); __Pyx_INCREF(__pyx_v_self->_workers_dv); __Pyx_GIVEREF(__pyx_v_self->_workers_dv); PyTuple_SET_ITEM(__pyx_t_6, 20, __pyx_v_self->_workers_dv); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_v_state = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._aliases, self._bandwidth, self._clients, self._extensions, self._host_info, self._idle, self._idle_dv, self._n_tasks, self._resources, self._saturated, self._task_groups, self._task_metadata, self._task_prefixes, self._tasks, self._total_nthreads, self._total_occupancy, self._unknown_durations, self._unrunnable, self._validate, self._workers, self._workers_dv) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_6 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v__dict = __pyx_t_6; __pyx_t_6 = 0; /* "(tree fragment)":7 * state = (self._aliases, self._bandwidth, self._clients, self._extensions, self._host_info, self._idle, self._idle_dv, self._n_tasks, self._resources, self._saturated, self._task_groups, self._task_metadata, self._task_prefixes, self._tasks, self._total_nthreads, self._total_occupancy, self._unknown_durations, self._unrunnable, self._validate, self._workers, self._workers_dv) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_7 = (__pyx_v__dict != Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v__dict); __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._aliases is not None or self._clients is not None or self._extensions is not None or self._host_info is not None or self._idle is not None or self._idle_dv is not None or self._resources is not None or self._saturated is not None or self._task_groups is not None or self._task_metadata is not None or self._task_prefixes is not None or self._tasks is not None or self._unknown_durations is not None or self._unrunnable is not None or self._workers is not None or self._workers_dv is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._aliases, self._bandwidth, self._clients, self._extensions, self._host_info, self._idle, self._idle_dv, self._n_tasks, self._resources, self._saturated, self._task_groups, self._task_metadata, self._task_prefixes, self._tasks, self._total_nthreads, self._total_occupancy, self._unknown_durations, self._unrunnable, self._validate, self._workers, self._workers_dv) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._aliases is not None or self._clients is not None or self._extensions is not None or self._host_info is not None or self._idle is not None or self._idle_dv is not None or self._resources is not None or self._saturated is not None or self._task_groups is not None or self._task_metadata is not None or self._task_prefixes is not None or self._tasks is not None or self._unknown_durations is not None or self._unrunnable is not None or self._workers is not None or self._workers_dv is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, None), state */ /*else*/ { __pyx_t_7 = (__pyx_v_self->_aliases != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_7 != 0); if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_clients != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_9 != 0); if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_extensions != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_7 != 0); if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_host_info != Py_None); __pyx_t_7 = (__pyx_t_9 != 0); if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_idle != Py_None); __pyx_t_9 = (__pyx_t_7 != 0); if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_idle_dv != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_9 != 0); if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_resources != Py_None); __pyx_t_9 = (__pyx_t_7 != 0); if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_saturated != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_9 != 0); if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_task_groups != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_7 != 0); if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_task_metadata != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_9 != 0); if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_task_prefixes != ((PyObject*)Py_None)); __pyx_t_9 = (__pyx_t_7 != 0); if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_tasks != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_9 != 0); if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_unknown_durations != Py_None); __pyx_t_9 = (__pyx_t_7 != 0); if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_unrunnable != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_9 != 0); if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->_workers != Py_None); __pyx_t_9 = (__pyx_t_7 != 0); if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_self->_workers_dv != ((PyObject*)Py_None)); __pyx_t_7 = (__pyx_t_9 != 0); __pyx_t_8 = __pyx_t_7; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_8; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._aliases is not None or self._clients is not None or self._extensions is not None or self._host_info is not None or self._idle is not None or self._idle_dv is not None or self._resources is not None or self._saturated is not None or self._task_groups is not None or self._task_metadata is not None or self._task_prefixes is not None or self._tasks is not None or self._unknown_durations is not None or self._unrunnable is not None or self._workers is not None or self._workers_dv is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, None), state * else: */ __pyx_t_8 = (__pyx_v_use_setstate != 0); if (__pyx_t_8) { /* "(tree fragment)":13 * use_setstate = self._aliases is not None or self._clients is not None or self._extensions is not None or self._host_info is not None or self._idle is not None or self._idle_dv is not None or self._resources is not None or self._saturated is not None or self._task_groups is not None or self._task_metadata is not None or self._task_prefixes is not None or self._tasks is not None or self._unknown_durations is not None or self._unrunnable is not None or self._workers is not None or self._workers_dv is not None * if use_setstate: * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_SchedulerState); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_247120481); __Pyx_GIVEREF(__pyx_int_247120481); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_247120481); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._aliases is not None or self._clients is not None or self._extensions is not None or self._host_info is not None or self._idle is not None or self._idle_dv is not None or self._resources is not None or self._saturated is not None or self._task_groups is not None or self._task_metadata is not None or self._task_prefixes is not None or self._tasks is not None or self._unknown_durations is not None or self._unrunnable is not None or self._workers is not None or self._workers_dv is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, None), state * else: * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_SchedulerState__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_SchedulerState); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_247120481); __Pyx_GIVEREF(__pyx_int_247120481); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_247120481); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_SchedulerState__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_55__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_11distributed_9scheduler_14SchedulerState_55__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_14SchedulerState_54__setstate_cython__(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_14SchedulerState_54__setstate_cython__(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_SchedulerState__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11distributed_9scheduler___pyx_unpickle_SchedulerState__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_SchedulerState, (type(self), 0xebac261, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_SchedulerState__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.SchedulerState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2837 * _instances = weakref.WeakSet() * * def __init__( # <<<<<<<<<<<<<< * self, * loop=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_loop = 0; PyObject *__pyx_v_delete_interval = 0; PyObject *__pyx_v_synchronize_worker_interval = 0; PyObject *__pyx_v_services = 0; PyObject *__pyx_v_service_kwargs = 0; PyObject *__pyx_v_allowed_failures = 0; PyObject *__pyx_v_extensions = 0; PyObject *__pyx_v_validate = 0; PyObject *__pyx_v_scheduler_file = 0; PyObject *__pyx_v_security = 0; PyObject *__pyx_v_worker_ttl = 0; PyObject *__pyx_v_idle_timeout = 0; PyObject *__pyx_v_interface = 0; PyObject *__pyx_v_host = 0; PyObject *__pyx_v_port = 0; PyObject *__pyx_v_protocol = 0; PyObject *__pyx_v_dashboard_address = 0; PyObject *__pyx_v_dashboard = 0; PyObject *__pyx_v_http_prefix = 0; PyObject *__pyx_v_preload = 0; PyObject *__pyx_v_preload_argv = 0; PyObject *__pyx_v_plugins = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_loop,&__pyx_n_s_delete_interval,&__pyx_n_s_synchronize_worker_interval,&__pyx_n_s_services,&__pyx_n_s_service_kwargs,&__pyx_n_s_allowed_failures,&__pyx_n_s_extensions,&__pyx_n_s_validate,&__pyx_n_s_scheduler_file,&__pyx_n_s_security,&__pyx_n_s_worker_ttl,&__pyx_n_s_idle_timeout,&__pyx_n_s_interface,&__pyx_n_s_host,&__pyx_n_s_port,&__pyx_n_s_protocol,&__pyx_n_s_dashboard_address,&__pyx_n_s_dashboard,&__pyx_n_s_http_prefix,&__pyx_n_s_preload,&__pyx_n_s_preload_argv,&__pyx_n_s_plugins,0}; PyObject* values[23] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":2839 * def __init__( * self, * loop=None, # <<<<<<<<<<<<<< * delete_interval="500ms", * synchronize_worker_interval="60s", */ values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject*)__pyx_kp_u_500ms)); values[3] = ((PyObject *)((PyObject*)__pyx_kp_u_60s)); /* "distributed/scheduler.py":2842 * delete_interval="500ms", * synchronize_worker_interval="60s", * services=None, # <<<<<<<<<<<<<< * service_kwargs=None, * allowed_failures=None, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2843 * synchronize_worker_interval="60s", * services=None, * service_kwargs=None, # <<<<<<<<<<<<<< * allowed_failures=None, * extensions=None, */ values[5] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2844 * services=None, * service_kwargs=None, * allowed_failures=None, # <<<<<<<<<<<<<< * extensions=None, * validate=None, */ values[6] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2845 * service_kwargs=None, * allowed_failures=None, * extensions=None, # <<<<<<<<<<<<<< * validate=None, * scheduler_file=None, */ values[7] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2846 * allowed_failures=None, * extensions=None, * validate=None, # <<<<<<<<<<<<<< * scheduler_file=None, * security=None, */ values[8] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2847 * extensions=None, * validate=None, * scheduler_file=None, # <<<<<<<<<<<<<< * security=None, * worker_ttl=None, */ values[9] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2848 * validate=None, * scheduler_file=None, * security=None, # <<<<<<<<<<<<<< * worker_ttl=None, * idle_timeout=None, */ values[10] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2849 * scheduler_file=None, * security=None, * worker_ttl=None, # <<<<<<<<<<<<<< * idle_timeout=None, * interface=None, */ values[11] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2850 * security=None, * worker_ttl=None, * idle_timeout=None, # <<<<<<<<<<<<<< * interface=None, * host=None, */ values[12] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2851 * worker_ttl=None, * idle_timeout=None, * interface=None, # <<<<<<<<<<<<<< * host=None, * port=0, */ values[13] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2852 * idle_timeout=None, * interface=None, * host=None, # <<<<<<<<<<<<<< * port=0, * protocol=None, */ values[14] = ((PyObject *)((PyObject *)Py_None)); values[15] = ((PyObject *)((PyObject *)__pyx_int_0)); /* "distributed/scheduler.py":2854 * host=None, * port=0, * protocol=None, # <<<<<<<<<<<<<< * dashboard_address=None, * dashboard=None, */ values[16] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2855 * port=0, * protocol=None, * dashboard_address=None, # <<<<<<<<<<<<<< * dashboard=None, * http_prefix="/", */ values[17] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2856 * protocol=None, * dashboard_address=None, * dashboard=None, # <<<<<<<<<<<<<< * http_prefix="/", * preload=None, */ values[18] = ((PyObject *)((PyObject *)Py_None)); values[19] = ((PyObject *)((PyObject*)__pyx_kp_u__14)); /* "distributed/scheduler.py":2858 * dashboard=None, * http_prefix="/", * preload=None, # <<<<<<<<<<<<<< * preload_argv=(), * plugins=(), */ values[20] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":2859 * http_prefix="/", * preload=None, * preload_argv=(), # <<<<<<<<<<<<<< * plugins=(), * **kwargs, */ values[21] = ((PyObject *)((PyObject*)__pyx_empty_tuple)); /* "distributed/scheduler.py":2860 * preload=None, * preload_argv=(), * plugins=(), # <<<<<<<<<<<<<< * **kwargs, * ): */ values[22] = ((PyObject *)((PyObject*)__pyx_empty_tuple)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); CYTHON_FALLTHROUGH; case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21); CYTHON_FALLTHROUGH; case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); CYTHON_FALLTHROUGH; case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19); CYTHON_FALLTHROUGH; case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); CYTHON_FALLTHROUGH; case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); CYTHON_FALLTHROUGH; case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); CYTHON_FALLTHROUGH; case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); CYTHON_FALLTHROUGH; case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delete_interval); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_synchronize_worker_interval); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_services); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_service_kwargs); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allowed_failures); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extensions); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_validate); if (value) { values[8] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scheduler_file); if (value) { values[9] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_security); if (value) { values[10] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker_ttl); if (value) { values[11] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idle_timeout); if (value) { values[12] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interface); if (value) { values[13] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host); if (value) { values[14] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 15: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port); if (value) { values[15] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 16: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_protocol); if (value) { values[16] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 17: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dashboard_address); if (value) { values[17] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 18: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dashboard); if (value) { values[18] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 19: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_http_prefix); if (value) { values[19] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 20: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preload); if (value) { values[20] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 21: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preload_argv); if (value) { values[21] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 22: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_plugins); if (value) { values[22] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2837, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); CYTHON_FALLTHROUGH; case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21); CYTHON_FALLTHROUGH; case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); CYTHON_FALLTHROUGH; case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19); CYTHON_FALLTHROUGH; case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); CYTHON_FALLTHROUGH; case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); CYTHON_FALLTHROUGH; case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); CYTHON_FALLTHROUGH; case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); CYTHON_FALLTHROUGH; case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_loop = values[1]; __pyx_v_delete_interval = values[2]; __pyx_v_synchronize_worker_interval = values[3]; __pyx_v_services = values[4]; __pyx_v_service_kwargs = values[5]; __pyx_v_allowed_failures = values[6]; __pyx_v_extensions = values[7]; __pyx_v_validate = values[8]; __pyx_v_scheduler_file = values[9]; __pyx_v_security = values[10]; __pyx_v_worker_ttl = values[11]; __pyx_v_idle_timeout = values[12]; __pyx_v_interface = values[13]; __pyx_v_host = values[14]; __pyx_v_port = values[15]; __pyx_v_protocol = values[16]; __pyx_v_dashboard_address = values[17]; __pyx_v_dashboard = values[18]; __pyx_v_http_prefix = values[19]; __pyx_v_preload = values[20]; __pyx_v_preload_argv = values[21]; __pyx_v_plugins = values[22]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 23, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2837, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler___init__(__pyx_self, __pyx_v_self, __pyx_v_loop, __pyx_v_delete_interval, __pyx_v_synchronize_worker_interval, __pyx_v_services, __pyx_v_service_kwargs, __pyx_v_allowed_failures, __pyx_v_extensions, __pyx_v_validate, __pyx_v_scheduler_file, __pyx_v_security, __pyx_v_worker_ttl, __pyx_v_idle_timeout, __pyx_v_interface, __pyx_v_host, __pyx_v_port, __pyx_v_protocol, __pyx_v_dashboard_address, __pyx_v_dashboard, __pyx_v_http_prefix, __pyx_v_preload, __pyx_v_preload_argv, __pyx_v_plugins, __pyx_v_kwargs); /* "distributed/scheduler.py":2837 * _instances = weakref.WeakSet() * * def __init__( # <<<<<<<<<<<<<< * self, * loop=None, */ /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3043 * maxlen=dask.config.get("distributed.scheduler.transition-log-length") * ) * self.events = defaultdict(lambda: deque(maxlen=100000)) # <<<<<<<<<<<<<< * self.event_counts = defaultdict(int) * self.worker_plugins = [] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_8__init___lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_8__init___lambda4 = {"lambda4", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_8__init___lambda4, METH_NOARGS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_8__init___lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda4", 0); __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_deque); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxlen, __pyx_int_100000) < 0) __PYX_ERR(0, 3043, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.__init__.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3056 * "long-running": self.handle_long_running, * "reschedule": self.reschedule, * "keep-alive": lambda *args, **kwargs: None, # <<<<<<<<<<<<<< * "log-event": self.log_worker_event, * } */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_8__init___1lambda5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_8__init___1lambda5 = {"lambda5", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_8__init___1lambda5, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_8__init___1lambda5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_args = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lambda5", 1))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda5", 0); __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":2837 * _instances = weakref.WeakSet() * * def __init__( # <<<<<<<<<<<<<< * self, * loop=None, */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_delete_interval, PyObject *__pyx_v_synchronize_worker_interval, PyObject *__pyx_v_services, PyObject *__pyx_v_service_kwargs, PyObject *__pyx_v_allowed_failures, PyObject *__pyx_v_extensions, PyObject *__pyx_v_validate, PyObject *__pyx_v_scheduler_file, PyObject *__pyx_v_security, PyObject *__pyx_v_worker_ttl, PyObject *__pyx_v_idle_timeout, PyObject *__pyx_v_interface, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_protocol, PyObject *__pyx_v_dashboard_address, PyObject *__pyx_v_dashboard, PyObject *__pyx_v_http_prefix, PyObject *__pyx_v_preload, PyObject *__pyx_v_preload_argv, PyObject *__pyx_v_plugins, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_http_server_modules = NULL; PyObject *__pyx_v_show_dashboard = NULL; int __pyx_v_missing_bokeh; PyObject *__pyx_v_distributed = NULL; PyObject *__pyx_v_routes = NULL; PyObject *__pyx_v_tasks = NULL; PyObject *__pyx_v_old_attr = NULL; PyObject *__pyx_v_new_attr = NULL; PyObject *__pyx_v_wrap = NULL; PyObject *__pyx_v_func = NULL; PyObject *__pyx_v_unrunnable = NULL; PyObject *__pyx_v_clients = NULL; PyObject *__pyx_v_workers = NULL; PyObject *__pyx_v_host_info = NULL; PyObject *__pyx_v_resources = NULL; PyObject *__pyx_v_aliases = NULL; PyObject *__pyx_v_worker_handlers = NULL; PyObject *__pyx_v_client_handlers = NULL; PyObject *__pyx_v_connection_limit = NULL; PyObject *__pyx_v_pc = NULL; PyObject *__pyx_v_ext = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *(*__pyx_t_16)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_allowed_failures); __Pyx_INCREF(__pyx_v_extensions); __Pyx_INCREF(__pyx_v_validate); __Pyx_INCREF(__pyx_v_security); __Pyx_INCREF(__pyx_v_worker_ttl); __Pyx_INCREF(__pyx_v_idle_timeout); __Pyx_INCREF(__pyx_v_preload); __Pyx_INCREF(__pyx_v_preload_argv); /* "distributed/scheduler.py":2863 * **kwargs, * ): * self._setup_logging(logger) # <<<<<<<<<<<<<< * * # Attributes */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_setup_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2866 * * # Attributes * if allowed_failures is None: # <<<<<<<<<<<<<< * allowed_failures = dask.config.get("distributed.scheduler.allowed-failures") * self.allowed_failures = allowed_failures */ __pyx_t_5 = (__pyx_v_allowed_failures == Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":2867 * # Attributes * if allowed_failures is None: * allowed_failures = dask.config.get("distributed.scheduler.allowed-failures") # <<<<<<<<<<<<<< * self.allowed_failures = allowed_failures * if validate is None: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_distributed_scheduler_allowed_fa) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_allowed_fa); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_allowed_failures, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2866 * * # Attributes * if allowed_failures is None: # <<<<<<<<<<<<<< * allowed_failures = dask.config.get("distributed.scheduler.allowed-failures") * self.allowed_failures = allowed_failures */ } /* "distributed/scheduler.py":2868 * if allowed_failures is None: * allowed_failures = dask.config.get("distributed.scheduler.allowed-failures") * self.allowed_failures = allowed_failures # <<<<<<<<<<<<<< * if validate is None: * validate = dask.config.get("distributed.scheduler.validate") */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_allowed_failures, __pyx_v_allowed_failures) < 0) __PYX_ERR(0, 2868, __pyx_L1_error) /* "distributed/scheduler.py":2869 * allowed_failures = dask.config.get("distributed.scheduler.allowed-failures") * self.allowed_failures = allowed_failures * if validate is None: # <<<<<<<<<<<<<< * validate = dask.config.get("distributed.scheduler.validate") * self.proc = psutil.Process() */ __pyx_t_6 = (__pyx_v_validate == Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2870 * self.allowed_failures = allowed_failures * if validate is None: * validate = dask.config.get("distributed.scheduler.validate") # <<<<<<<<<<<<<< * self.proc = psutil.Process() * self.delete_interval = parse_timedelta(delete_interval, default="ms") */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_distributed_scheduler_validate) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_validate); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_validate, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2869 * allowed_failures = dask.config.get("distributed.scheduler.allowed-failures") * self.allowed_failures = allowed_failures * if validate is None: # <<<<<<<<<<<<<< * validate = dask.config.get("distributed.scheduler.validate") * self.proc = psutil.Process() */ } /* "distributed/scheduler.py":2871 * if validate is None: * validate = dask.config.get("distributed.scheduler.validate") * self.proc = psutil.Process() # <<<<<<<<<<<<<< * self.delete_interval = parse_timedelta(delete_interval, default="ms") * self.synchronize_worker_interval = parse_timedelta( */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_psutil); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_proc, __pyx_t_1) < 0) __PYX_ERR(0, 2871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2872 * validate = dask.config.get("distributed.scheduler.validate") * self.proc = psutil.Process() * self.delete_interval = parse_timedelta(delete_interval, default="ms") # <<<<<<<<<<<<<< * self.synchronize_worker_interval = parse_timedelta( * synchronize_worker_interval, default="ms" */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_delete_interval); __Pyx_GIVEREF(__pyx_v_delete_interval); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_delete_interval); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_n_u_ms) < 0) __PYX_ERR(0, 2872, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_delete_interval, __pyx_t_4) < 0) __PYX_ERR(0, 2872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2873 * self.proc = psutil.Process() * self.delete_interval = parse_timedelta(delete_interval, default="ms") * self.synchronize_worker_interval = parse_timedelta( # <<<<<<<<<<<<<< * synchronize_worker_interval, default="ms" * ) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":2874 * self.delete_interval = parse_timedelta(delete_interval, default="ms") * self.synchronize_worker_interval = parse_timedelta( * synchronize_worker_interval, default="ms" # <<<<<<<<<<<<<< * ) * self.digests = None */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_synchronize_worker_interval); __Pyx_GIVEREF(__pyx_v_synchronize_worker_interval); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_synchronize_worker_interval); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_default, __pyx_n_u_ms) < 0) __PYX_ERR(0, 2874, __pyx_L1_error) /* "distributed/scheduler.py":2873 * self.proc = psutil.Process() * self.delete_interval = parse_timedelta(delete_interval, default="ms") * self.synchronize_worker_interval = parse_timedelta( # <<<<<<<<<<<<<< * synchronize_worker_interval, default="ms" * ) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_synchronize_worker_interval, __pyx_t_1) < 0) __PYX_ERR(0, 2873, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2876 * synchronize_worker_interval, default="ms" * ) * self.digests = None # <<<<<<<<<<<<<< * self.service_specs = services or {} * self.service_kwargs = service_kwargs or {} */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_digests, Py_None) < 0) __PYX_ERR(0, 2876, __pyx_L1_error) /* "distributed/scheduler.py":2877 * ) * self.digests = None * self.service_specs = services or {} # <<<<<<<<<<<<<< * self.service_kwargs = service_kwargs or {} * self.services = {} */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_services); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2877, __pyx_L1_error) if (!__pyx_t_5) { } else { __Pyx_INCREF(__pyx_v_services); __pyx_t_1 = __pyx_v_services; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L5_bool_binop_done:; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_service_specs, __pyx_t_1) < 0) __PYX_ERR(0, 2877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2878 * self.digests = None * self.service_specs = services or {} * self.service_kwargs = service_kwargs or {} # <<<<<<<<<<<<<< * self.services = {} * self.scheduler_file = scheduler_file */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_service_kwargs); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2878, __pyx_L1_error) if (!__pyx_t_5) { } else { __Pyx_INCREF(__pyx_v_service_kwargs); __pyx_t_1 = __pyx_v_service_kwargs; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L7_bool_binop_done:; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_service_kwargs, __pyx_t_1) < 0) __PYX_ERR(0, 2878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2879 * self.service_specs = services or {} * self.service_kwargs = service_kwargs or {} * self.services = {} # <<<<<<<<<<<<<< * self.scheduler_file = scheduler_file * worker_ttl = worker_ttl or dask.config.get("distributed.scheduler.worker-ttl") */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_services, __pyx_t_1) < 0) __PYX_ERR(0, 2879, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2880 * self.service_kwargs = service_kwargs or {} * self.services = {} * self.scheduler_file = scheduler_file # <<<<<<<<<<<<<< * worker_ttl = worker_ttl or dask.config.get("distributed.scheduler.worker-ttl") * self.worker_ttl = parse_timedelta(worker_ttl) if worker_ttl else None */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheduler_file, __pyx_v_scheduler_file) < 0) __PYX_ERR(0, 2880, __pyx_L1_error) /* "distributed/scheduler.py":2881 * self.services = {} * self.scheduler_file = scheduler_file * worker_ttl = worker_ttl or dask.config.get("distributed.scheduler.worker-ttl") # <<<<<<<<<<<<<< * self.worker_ttl = parse_timedelta(worker_ttl) if worker_ttl else None * idle_timeout = idle_timeout or dask.config.get( */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_worker_ttl); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2881, __pyx_L1_error) if (!__pyx_t_5) { } else { __Pyx_INCREF(__pyx_v_worker_ttl); __pyx_t_1 = __pyx_v_worker_ttl; goto __pyx_L9_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_distributed_scheduler_worker_ttl) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_worker_ttl); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L9_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_worker_ttl, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2882 * self.scheduler_file = scheduler_file * worker_ttl = worker_ttl or dask.config.get("distributed.scheduler.worker-ttl") * self.worker_ttl = parse_timedelta(worker_ttl) if worker_ttl else None # <<<<<<<<<<<<<< * idle_timeout = idle_timeout or dask.config.get( * "distributed.scheduler.idle-timeout" */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_worker_ttl); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2882, __pyx_L1_error) if (__pyx_t_5) { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_worker_ttl) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_worker_ttl); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_worker_ttl, __pyx_t_1) < 0) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2883 * worker_ttl = worker_ttl or dask.config.get("distributed.scheduler.worker-ttl") * self.worker_ttl = parse_timedelta(worker_ttl) if worker_ttl else None * idle_timeout = idle_timeout or dask.config.get( # <<<<<<<<<<<<<< * "distributed.scheduler.idle-timeout" * ) */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_idle_timeout); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2883, __pyx_L1_error) if (!__pyx_t_5) { } else { __Pyx_INCREF(__pyx_v_idle_timeout); __pyx_t_1 = __pyx_v_idle_timeout; goto __pyx_L11_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_distributed_scheduler_idle_timeo) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_idle_timeo); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L11_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_idle_timeout, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2886 * "distributed.scheduler.idle-timeout" * ) * if idle_timeout: # <<<<<<<<<<<<<< * self.idle_timeout = parse_timedelta(idle_timeout) * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_idle_timeout); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2886, __pyx_L1_error) if (__pyx_t_5) { /* "distributed/scheduler.py":2887 * ) * if idle_timeout: * self.idle_timeout = parse_timedelta(idle_timeout) # <<<<<<<<<<<<<< * else: * self.idle_timeout = None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_idle_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_idle_timeout); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_idle_timeout, __pyx_t_1) < 0) __PYX_ERR(0, 2887, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2886 * "distributed.scheduler.idle-timeout" * ) * if idle_timeout: # <<<<<<<<<<<<<< * self.idle_timeout = parse_timedelta(idle_timeout) * else: */ goto __pyx_L13; } /* "distributed/scheduler.py":2889 * self.idle_timeout = parse_timedelta(idle_timeout) * else: * self.idle_timeout = None # <<<<<<<<<<<<<< * self.idle_since = time() * self.time_started = self.idle_since # compatibility for dask-gateway */ /*else*/ { if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_idle_timeout, Py_None) < 0) __PYX_ERR(0, 2889, __pyx_L1_error) } __pyx_L13:; /* "distributed/scheduler.py":2890 * else: * self.idle_timeout = None * self.idle_since = time() # <<<<<<<<<<<<<< * self.time_started = self.idle_since # compatibility for dask-gateway * self._lock = asyncio.Lock() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_idle_since, __pyx_t_1) < 0) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2891 * self.idle_timeout = None * self.idle_since = time() * self.time_started = self.idle_since # compatibility for dask-gateway # <<<<<<<<<<<<<< * self._lock = asyncio.Lock() * self.bandwidth_workers = defaultdict(float) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_idle_since); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_time_started, __pyx_t_1) < 0) __PYX_ERR(0, 2891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2892 * self.idle_since = time() * self.time_started = self.idle_since # compatibility for dask-gateway * self._lock = asyncio.Lock() # <<<<<<<<<<<<<< * self.bandwidth_workers = defaultdict(float) * self.bandwidth_types = defaultdict(float) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lock, __pyx_t_1) < 0) __PYX_ERR(0, 2892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2893 * self.time_started = self.idle_since # compatibility for dask-gateway * self._lock = asyncio.Lock() * self.bandwidth_workers = defaultdict(float) # <<<<<<<<<<<<<< * self.bandwidth_types = defaultdict(float) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)(&PyFloat_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)(&PyFloat_Type))); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_workers, __pyx_t_1) < 0) __PYX_ERR(0, 2893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2894 * self._lock = asyncio.Lock() * self.bandwidth_workers = defaultdict(float) * self.bandwidth_types = defaultdict(float) # <<<<<<<<<<<<<< * * if not preload: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)(&PyFloat_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)(&PyFloat_Type))); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_types, __pyx_t_1) < 0) __PYX_ERR(0, 2894, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2896 * self.bandwidth_types = defaultdict(float) * * if not preload: # <<<<<<<<<<<<<< * preload = dask.config.get("distributed.scheduler.preload") * if not preload_argv: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_preload); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2896, __pyx_L1_error) __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":2897 * * if not preload: * preload = dask.config.get("distributed.scheduler.preload") # <<<<<<<<<<<<<< * if not preload_argv: * preload_argv = dask.config.get("distributed.scheduler.preload-argv") */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_distributed_scheduler_preload) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_preload); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_preload, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2896 * self.bandwidth_types = defaultdict(float) * * if not preload: # <<<<<<<<<<<<<< * preload = dask.config.get("distributed.scheduler.preload") * if not preload_argv: */ } /* "distributed/scheduler.py":2898 * if not preload: * preload = dask.config.get("distributed.scheduler.preload") * if not preload_argv: # <<<<<<<<<<<<<< * preload_argv = dask.config.get("distributed.scheduler.preload-argv") * self.preloads = preloading.process_preloads(self, preload, preload_argv) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_preload_argv); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2898, __pyx_L1_error) __pyx_t_5 = ((!__pyx_t_6) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2899 * preload = dask.config.get("distributed.scheduler.preload") * if not preload_argv: * preload_argv = dask.config.get("distributed.scheduler.preload-argv") # <<<<<<<<<<<<<< * self.preloads = preloading.process_preloads(self, preload, preload_argv) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_distributed_scheduler_preload_ar) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_preload_ar); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_preload_argv, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2898 * if not preload: * preload = dask.config.get("distributed.scheduler.preload") * if not preload_argv: # <<<<<<<<<<<<<< * preload_argv = dask.config.get("distributed.scheduler.preload-argv") * self.preloads = preloading.process_preloads(self, preload, preload_argv) */ } /* "distributed/scheduler.py":2900 * if not preload_argv: * preload_argv = dask.config.get("distributed.scheduler.preload-argv") * self.preloads = preloading.process_preloads(self, preload, preload_argv) # <<<<<<<<<<<<<< * * if isinstance(security, dict): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_preloading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_process_preloads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_self, __pyx_v_preload, __pyx_v_preload_argv}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_self, __pyx_v_preload, __pyx_v_preload_argv}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_self); __Pyx_INCREF(__pyx_v_preload); __Pyx_GIVEREF(__pyx_v_preload); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_preload); __Pyx_INCREF(__pyx_v_preload_argv); __Pyx_GIVEREF(__pyx_v_preload_argv); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_preload_argv); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_preloads, __pyx_t_1) < 0) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2902 * self.preloads = preloading.process_preloads(self, preload, preload_argv) * * if isinstance(security, dict): # <<<<<<<<<<<<<< * security = Security(**security) * self.security = security or Security() */ __pyx_t_5 = PyDict_Check(__pyx_v_security); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":2903 * * if isinstance(security, dict): * security = Security(**security) # <<<<<<<<<<<<<< * self.security = security or Security() * assert isinstance(self.security, Security) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Security); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_security == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(0, 2903, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_security))) { __pyx_t_3 = PyDict_Copy(__pyx_v_security); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_security, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_security, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2902 * self.preloads = preloading.process_preloads(self, preload, preload_argv) * * if isinstance(security, dict): # <<<<<<<<<<<<<< * security = Security(**security) * self.security = security or Security() */ } /* "distributed/scheduler.py":2904 * if isinstance(security, dict): * security = Security(**security) * self.security = security or Security() # <<<<<<<<<<<<<< * assert isinstance(self.security, Security) * self.connection_args = self.security.get_connection_args("scheduler") */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_security); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2904, __pyx_L1_error) if (!__pyx_t_6) { } else { __Pyx_INCREF(__pyx_v_security); __pyx_t_4 = __pyx_v_security; goto __pyx_L17_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Security); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L17_bool_binop_done:; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_security, __pyx_t_4) < 0) __PYX_ERR(0, 2904, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2905 * security = Security(**security) * self.security = security or Security() * assert isinstance(self.security, Security) # <<<<<<<<<<<<<< * self.connection_args = self.security.get_connection_args("scheduler") * self.connection_args["handshake_overrides"] = { # common denominator */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_security); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Security); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyObject_IsInstance(__pyx_t_4, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 2905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!(__pyx_t_6 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2905, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":2906 * self.security = security or Security() * assert isinstance(self.security, Security) * self.connection_args = self.security.get_connection_args("scheduler") # <<<<<<<<<<<<<< * self.connection_args["handshake_overrides"] = { # common denominator * "pickle-protocol": 4 */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_security); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_connection_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_n_u_scheduler) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_scheduler); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_connection_args, __pyx_t_3) < 0) __PYX_ERR(0, 2906, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2908 * self.connection_args = self.security.get_connection_args("scheduler") * self.connection_args["handshake_overrides"] = { # common denominator * "pickle-protocol": 4 # <<<<<<<<<<<<<< * } * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_pickle_protocol, __pyx_int_4) < 0) __PYX_ERR(0, 2908, __pyx_L1_error) /* "distributed/scheduler.py":2907 * assert isinstance(self.security, Security) * self.connection_args = self.security.get_connection_args("scheduler") * self.connection_args["handshake_overrides"] = { # common denominator # <<<<<<<<<<<<<< * "pickle-protocol": 4 * } */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connection_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_handshake_overrides, __pyx_t_3) < 0)) __PYX_ERR(0, 2907, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2911 * } * * self._start_address = addresses_from_user_args( # <<<<<<<<<<<<<< * host=host, * port=port, */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_addresses_from_user_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":2912 * * self._start_address = addresses_from_user_args( * host=host, # <<<<<<<<<<<<<< * port=port, * interface=interface, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_host, __pyx_v_host) < 0) __PYX_ERR(0, 2912, __pyx_L1_error) /* "distributed/scheduler.py":2913 * self._start_address = addresses_from_user_args( * host=host, * port=port, # <<<<<<<<<<<<<< * interface=interface, * protocol=protocol, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_port, __pyx_v_port) < 0) __PYX_ERR(0, 2912, __pyx_L1_error) /* "distributed/scheduler.py":2914 * host=host, * port=port, * interface=interface, # <<<<<<<<<<<<<< * protocol=protocol, * security=security, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interface, __pyx_v_interface) < 0) __PYX_ERR(0, 2912, __pyx_L1_error) /* "distributed/scheduler.py":2915 * port=port, * interface=interface, * protocol=protocol, # <<<<<<<<<<<<<< * security=security, * default_port=self.default_port, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_protocol, __pyx_v_protocol) < 0) __PYX_ERR(0, 2912, __pyx_L1_error) /* "distributed/scheduler.py":2916 * interface=interface, * protocol=protocol, * security=security, # <<<<<<<<<<<<<< * default_port=self.default_port, * ) */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_security, __pyx_v_security) < 0) __PYX_ERR(0, 2912, __pyx_L1_error) /* "distributed/scheduler.py":2917 * protocol=protocol, * security=security, * default_port=self.default_port, # <<<<<<<<<<<<<< * ) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_default_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default_port, __pyx_t_4) < 0) __PYX_ERR(0, 2912, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2911 * } * * self._start_address = addresses_from_user_args( # <<<<<<<<<<<<<< * host=host, * port=port, */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_start_address, __pyx_t_4) < 0) __PYX_ERR(0, 2911, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2920 * ) * * http_server_modules = dask.config.get("distributed.scheduler.http.routes") # <<<<<<<<<<<<<< * show_dashboard = dashboard or (dashboard is None and dashboard_address) * missing_bokeh = False */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_kp_u_distributed_scheduler_http_route) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_distributed_scheduler_http_route); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_http_server_modules = __pyx_t_4; __pyx_t_4 = 0; /* "distributed/scheduler.py":2921 * * http_server_modules = dask.config.get("distributed.scheduler.http.routes") * show_dashboard = dashboard or (dashboard is None and dashboard_address) # <<<<<<<<<<<<<< * missing_bokeh = False * # install vanilla route if show_dashboard but bokeh is not installed */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_dashboard); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2921, __pyx_L1_error) if (!__pyx_t_6) { } else { __Pyx_INCREF(__pyx_v_dashboard); __pyx_t_4 = __pyx_v_dashboard; goto __pyx_L19_bool_binop_done; } __pyx_t_6 = (__pyx_v_dashboard == Py_None); if (__pyx_t_6) { } else { __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L19_bool_binop_done; } __Pyx_INCREF(__pyx_v_dashboard_address); __pyx_t_4 = __pyx_v_dashboard_address; __pyx_L19_bool_binop_done:; __pyx_v_show_dashboard = __pyx_t_4; __pyx_t_4 = 0; /* "distributed/scheduler.py":2922 * http_server_modules = dask.config.get("distributed.scheduler.http.routes") * show_dashboard = dashboard or (dashboard is None and dashboard_address) * missing_bokeh = False # <<<<<<<<<<<<<< * # install vanilla route if show_dashboard but bokeh is not installed * if show_dashboard: */ __pyx_v_missing_bokeh = 0; /* "distributed/scheduler.py":2924 * missing_bokeh = False * # install vanilla route if show_dashboard but bokeh is not installed * if show_dashboard: # <<<<<<<<<<<<<< * try: * import distributed.dashboard.scheduler */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_show_dashboard); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2924, __pyx_L1_error) if (__pyx_t_6) { /* "distributed/scheduler.py":2925 * # install vanilla route if show_dashboard but bokeh is not installed * if show_dashboard: * try: # <<<<<<<<<<<<<< * import distributed.dashboard.scheduler * except ImportError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "distributed/scheduler.py":2926 * if show_dashboard: * try: * import distributed.dashboard.scheduler # <<<<<<<<<<<<<< * except ImportError: * missing_bokeh = True */ __pyx_t_4 = __Pyx_Import(__pyx_n_s_distributed_dashboard_scheduler, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2926, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_distributed = __pyx_t_4; __pyx_t_4 = 0; /* "distributed/scheduler.py":2925 * # install vanilla route if show_dashboard but bokeh is not installed * if show_dashboard: * try: # <<<<<<<<<<<<<< * import distributed.dashboard.scheduler * except ImportError: */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L28_try_end; __pyx_L23_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2927 * try: * import distributed.dashboard.scheduler * except ImportError: # <<<<<<<<<<<<<< * missing_bokeh = True * http_server_modules.append("distributed.http.scheduler.missing_bokeh") */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_7) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 2927, __pyx_L25_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":2928 * import distributed.dashboard.scheduler * except ImportError: * missing_bokeh = True # <<<<<<<<<<<<<< * http_server_modules.append("distributed.http.scheduler.missing_bokeh") * routes = get_handlers( */ __pyx_v_missing_bokeh = 1; /* "distributed/scheduler.py":2929 * except ImportError: * missing_bokeh = True * http_server_modules.append("distributed.http.scheduler.missing_bokeh") # <<<<<<<<<<<<<< * routes = get_handlers( * server=self, modules=http_server_modules, prefix=http_prefix */ __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_http_server_modules, __pyx_kp_u_distributed_http_scheduler_missi); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2929, __pyx_L25_except_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L24_exception_handled; } goto __pyx_L25_except_error; __pyx_L25_except_error:; /* "distributed/scheduler.py":2925 * # install vanilla route if show_dashboard but bokeh is not installed * if show_dashboard: * try: # <<<<<<<<<<<<<< * import distributed.dashboard.scheduler * except ImportError: */ __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L24_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L28_try_end:; } /* "distributed/scheduler.py":2924 * missing_bokeh = False * # install vanilla route if show_dashboard but bokeh is not installed * if show_dashboard: # <<<<<<<<<<<<<< * try: * import distributed.dashboard.scheduler */ } /* "distributed/scheduler.py":2930 * missing_bokeh = True * http_server_modules.append("distributed.http.scheduler.missing_bokeh") * routes = get_handlers( # <<<<<<<<<<<<<< * server=self, modules=http_server_modules, prefix=http_prefix * ) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_handlers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":2931 * http_server_modules.append("distributed.http.scheduler.missing_bokeh") * routes = get_handlers( * server=self, modules=http_server_modules, prefix=http_prefix # <<<<<<<<<<<<<< * ) * self.start_http_server(routes, dashboard_address, default_port=8787) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_server, __pyx_v_self) < 0) __PYX_ERR(0, 2931, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_modules, __pyx_v_http_server_modules) < 0) __PYX_ERR(0, 2931, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prefix, __pyx_v_http_prefix) < 0) __PYX_ERR(0, 2931, __pyx_L1_error) /* "distributed/scheduler.py":2930 * missing_bokeh = True * http_server_modules.append("distributed.http.scheduler.missing_bokeh") * routes = get_handlers( # <<<<<<<<<<<<<< * server=self, modules=http_server_modules, prefix=http_prefix * ) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_routes = __pyx_t_4; __pyx_t_4 = 0; /* "distributed/scheduler.py":2933 * server=self, modules=http_server_modules, prefix=http_prefix * ) * self.start_http_server(routes, dashboard_address, default_port=8787) # <<<<<<<<<<<<<< * if show_dashboard and not missing_bokeh: * distributed.dashboard.scheduler.connect( */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_start_http_server); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_routes); __Pyx_GIVEREF(__pyx_v_routes); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_routes); __Pyx_INCREF(__pyx_v_dashboard_address); __Pyx_GIVEREF(__pyx_v_dashboard_address); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dashboard_address); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_default_port, __pyx_int_8787) < 0) __PYX_ERR(0, 2933, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2934 * ) * self.start_http_server(routes, dashboard_address, default_port=8787) * if show_dashboard and not missing_bokeh: # <<<<<<<<<<<<<< * distributed.dashboard.scheduler.connect( * self.http_application, self.http_server, self, prefix=http_prefix */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_show_dashboard); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2934, __pyx_L1_error) if (__pyx_t_5) { } else { __pyx_t_6 = __pyx_t_5; goto __pyx_L32_bool_binop_done; } __pyx_t_5 = ((!(__pyx_v_missing_bokeh != 0)) != 0); __pyx_t_6 = __pyx_t_5; __pyx_L32_bool_binop_done:; if (__pyx_t_6) { /* "distributed/scheduler.py":2935 * self.start_http_server(routes, dashboard_address, default_port=8787) * if show_dashboard and not missing_bokeh: * distributed.dashboard.scheduler.connect( # <<<<<<<<<<<<<< * self.http_application, self.http_server, self, prefix=http_prefix * ) */ if (unlikely(!__pyx_v_distributed)) { __Pyx_RaiseUnboundLocalError("distributed"); __PYX_ERR(0, 2935, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_distributed, __pyx_n_s_dashboard); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scheduler); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2936 * if show_dashboard and not missing_bokeh: * distributed.dashboard.scheduler.connect( * self.http_application, self.http_server, self, prefix=http_prefix # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_http_application); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_http_server); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":2935 * self.start_http_server(routes, dashboard_address, default_port=8787) * if show_dashboard and not missing_bokeh: * distributed.dashboard.scheduler.connect( # <<<<<<<<<<<<<< * self.http_application, self.http_server, self, prefix=http_prefix * ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self); __pyx_t_3 = 0; __pyx_t_1 = 0; /* "distributed/scheduler.py":2936 * if show_dashboard and not missing_bokeh: * distributed.dashboard.scheduler.connect( * self.http_application, self.http_server, self, prefix=http_prefix # <<<<<<<<<<<<<< * ) * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prefix, __pyx_v_http_prefix) < 0) __PYX_ERR(0, 2936, __pyx_L1_error) /* "distributed/scheduler.py":2935 * self.start_http_server(routes, dashboard_address, default_port=8787) * if show_dashboard and not missing_bokeh: * distributed.dashboard.scheduler.connect( # <<<<<<<<<<<<<< * self.http_application, self.http_server, self, prefix=http_prefix * ) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2934 * ) * self.start_http_server(routes, dashboard_address, default_port=8787) * if show_dashboard and not missing_bokeh: # <<<<<<<<<<<<<< * distributed.dashboard.scheduler.connect( * self.http_application, self.http_server, self, prefix=http_prefix */ } /* "distributed/scheduler.py":2940 * * # Communication state * self.loop = loop or IOLoop.current() # <<<<<<<<<<<<<< * self.client_comms = dict() * self.stream_comms = dict() */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_loop); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2940, __pyx_L1_error) if (!__pyx_t_6) { } else { __Pyx_INCREF(__pyx_v_loop); __pyx_t_3 = __pyx_v_loop; goto __pyx_L34_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_IOLoop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_current); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_L34_bool_binop_done:; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_loop, __pyx_t_3) < 0) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2941 * # Communication state * self.loop = loop or IOLoop.current() * self.client_comms = dict() # <<<<<<<<<<<<<< * self.stream_comms = dict() * self._worker_coroutines = [] */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_client_comms, __pyx_t_3) < 0) __PYX_ERR(0, 2941, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2942 * self.loop = loop or IOLoop.current() * self.client_comms = dict() * self.stream_comms = dict() # <<<<<<<<<<<<<< * self._worker_coroutines = [] * self._ipython_kernel = None */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_stream_comms, __pyx_t_3) < 0) __PYX_ERR(0, 2942, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2943 * self.client_comms = dict() * self.stream_comms = dict() * self._worker_coroutines = [] # <<<<<<<<<<<<<< * self._ipython_kernel = None * */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_worker_coroutines, __pyx_t_3) < 0) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2944 * self.stream_comms = dict() * self._worker_coroutines = [] * self._ipython_kernel = None # <<<<<<<<<<<<<< * * # Task state */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ipython_kernel, Py_None) < 0) __PYX_ERR(0, 2944, __pyx_L1_error) /* "distributed/scheduler.py":2947 * * # Task state * tasks = dict() # <<<<<<<<<<<<<< * for old_attr, new_attr, wrap in [ * ("priority", "priority", None), */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tasks = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2950 * for old_attr, new_attr, wrap in [ * ("priority", "priority", None), * ("dependencies", "dependencies", _legacy_task_key_set), # <<<<<<<<<<<<<< * ("dependents", "dependents", _legacy_task_key_set), * ("retries", "retries", None), */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_legacy_task_key_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_u_dependencies); __Pyx_GIVEREF(__pyx_n_u_dependencies); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_dependencies); __Pyx_INCREF(__pyx_n_u_dependencies); __Pyx_GIVEREF(__pyx_n_u_dependencies); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_dependencies); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2951 * ("priority", "priority", None), * ("dependencies", "dependencies", _legacy_task_key_set), * ("dependents", "dependents", _legacy_task_key_set), # <<<<<<<<<<<<<< * ("retries", "retries", None), * ]: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_legacy_task_key_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_u_dependents); __Pyx_GIVEREF(__pyx_n_u_dependents); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_dependents); __Pyx_INCREF(__pyx_n_u_dependents); __Pyx_GIVEREF(__pyx_n_u_dependents); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_dependents); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2948 * # Task state * tasks = dict() * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("priority", "priority", None), * ("dependencies", "dependencies", _legacy_task_key_set), */ __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_tuple__15); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __Pyx_INCREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_tuple__16); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (__pyx_t_12 >= 4) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2948, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 2948, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2948, __pyx_L1_error) } __Pyx_XDECREF_SET(__pyx_v_old_attr, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_new_attr, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_wrap, __pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":2954 * ("retries", "retries", None), * ]: * func = operator.attrgetter(new_attr) # <<<<<<<<<<<<<< * if wrap is not None: * func = compose(wrap, func) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_operator); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_13, __pyx_v_new_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_new_attr); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2955 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(tasks, func)) */ __pyx_t_6 = (__pyx_v_wrap != Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2956 * func = operator.attrgetter(new_attr) * if wrap is not None: * func = compose(wrap, func) # <<<<<<<<<<<<<< * setattr(self, old_attr, _StateLegacyMapping(tasks, func)) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_compose); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_wrap, __pyx_v_func}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2956, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_wrap, __pyx_v_func}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2956, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_INCREF(__pyx_v_wrap); __Pyx_GIVEREF(__pyx_v_wrap); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_wrap); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_func); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2955 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(tasks, func)) */ } /* "distributed/scheduler.py":2957 * if wrap is not None: * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(tasks, func)) # <<<<<<<<<<<<<< * * for old_attr, new_attr, wrap in [ */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_StateLegacyMapping); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_tasks, __pyx_v_func}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2957, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_tasks, __pyx_v_func}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2957, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_tasks); __Pyx_GIVEREF(__pyx_v_tasks); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_v_tasks); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_func); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_old_attr, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2957, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":2948 * # Task state * tasks = dict() * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("priority", "priority", None), * ("dependencies", "dependencies", _legacy_task_key_set), */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2961 * for old_attr, new_attr, wrap in [ * ("nbytes", "nbytes", None), * ("who_wants", "who_wants", _legacy_client_key_set), # <<<<<<<<<<<<<< * ("who_has", "who_has", _legacy_worker_key_set), * ("waiting", "waiting_on", _legacy_task_key_set), */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_legacy_client_key_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_u_who_wants); __Pyx_GIVEREF(__pyx_n_u_who_wants); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_who_wants); __Pyx_INCREF(__pyx_n_u_who_wants); __Pyx_GIVEREF(__pyx_n_u_who_wants); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_who_wants); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2962 * ("nbytes", "nbytes", None), * ("who_wants", "who_wants", _legacy_client_key_set), * ("who_has", "who_has", _legacy_worker_key_set), # <<<<<<<<<<<<<< * ("waiting", "waiting_on", _legacy_task_key_set), * ("waiting_data", "waiters", _legacy_task_key_set), */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_legacy_worker_key_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_u_who_has); __Pyx_GIVEREF(__pyx_n_u_who_has); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_who_has); __Pyx_INCREF(__pyx_n_u_who_has); __Pyx_GIVEREF(__pyx_n_u_who_has); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_who_has); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2963 * ("who_wants", "who_wants", _legacy_client_key_set), * ("who_has", "who_has", _legacy_worker_key_set), * ("waiting", "waiting_on", _legacy_task_key_set), # <<<<<<<<<<<<<< * ("waiting_data", "waiters", _legacy_task_key_set), * ("rprocessing", "processing_on", None), */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_legacy_task_key_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_n_u_waiting); __Pyx_GIVEREF(__pyx_n_u_waiting); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_n_u_waiting); __Pyx_INCREF(__pyx_n_u_waiting_on); __Pyx_GIVEREF(__pyx_n_u_waiting_on); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_u_waiting_on); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2964 * ("who_has", "who_has", _legacy_worker_key_set), * ("waiting", "waiting_on", _legacy_task_key_set), * ("waiting_data", "waiters", _legacy_task_key_set), # <<<<<<<<<<<<<< * ("rprocessing", "processing_on", None), * ("host_restrictions", "host_restrictions", None), */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_legacy_task_key_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_u_waiting_data); __Pyx_GIVEREF(__pyx_n_u_waiting_data); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_waiting_data); __Pyx_INCREF(__pyx_n_u_waiters); __Pyx_GIVEREF(__pyx_n_u_waiters); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_waiters); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2972 * ("exceptions", "exception", None), * ("tracebacks", "traceback", None), * ("exceptions_blame", "exception_blame", _task_key_or_none), # <<<<<<<<<<<<<< * ]: * func = operator.attrgetter(new_attr) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_task_key_or_none); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_n_u_exceptions_blame); __Pyx_GIVEREF(__pyx_n_u_exceptions_blame); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_n_u_exceptions_blame); __Pyx_INCREF(__pyx_n_u_exception_blame); __Pyx_GIVEREF(__pyx_n_u_exception_blame); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_u_exception_blame); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2959 * setattr(self, old_attr, _StateLegacyMapping(tasks, func)) * * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("nbytes", "nbytes", None), * ("who_wants", "who_wants", _legacy_client_key_set), */ __pyx_t_2 = PyTuple_New(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__17); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_1); __Pyx_INCREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_tuple__18); __Pyx_INCREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_tuple__19); __Pyx_INCREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_tuple__20); __Pyx_INCREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_tuple__21); __Pyx_INCREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_tuple__22); __Pyx_INCREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_tuple__23); __Pyx_INCREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); PyTuple_SET_ITEM(__pyx_t_2, 11, __pyx_tuple__24); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_2, 12, __pyx_t_14); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_13 = 0; __pyx_t_1 = 0; __pyx_t_14 = 0; __pyx_t_14 = __pyx_t_2; __Pyx_INCREF(__pyx_t_14); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (__pyx_t_12 >= 13) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2959, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 2959, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2959, __pyx_L1_error) } __Pyx_XDECREF_SET(__pyx_v_old_attr, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_new_attr, __pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_wrap, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":2974 * ("exceptions_blame", "exception_blame", _task_key_or_none), * ]: * func = operator.attrgetter(new_attr) # <<<<<<<<<<<<<< * if wrap is not None: * func = compose(wrap, func) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_operator); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_new_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_new_attr); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2975 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _OptionalStateLegacyMapping(tasks, func)) */ __pyx_t_5 = (__pyx_v_wrap != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":2976 * func = operator.attrgetter(new_attr) * if wrap is not None: * func = compose(wrap, func) # <<<<<<<<<<<<<< * setattr(self, old_attr, _OptionalStateLegacyMapping(tasks, func)) * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_compose); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_wrap, __pyx_v_func}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2976, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_wrap, __pyx_v_func}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2976, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_wrap); __Pyx_GIVEREF(__pyx_v_wrap); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_wrap); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_func); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2975 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _OptionalStateLegacyMapping(tasks, func)) */ } /* "distributed/scheduler.py":2977 * if wrap is not None: * func = compose(wrap, func) * setattr(self, old_attr, _OptionalStateLegacyMapping(tasks, func)) # <<<<<<<<<<<<<< * * for old_attr, new_attr, wrap in [ */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_OptionalStateLegacyMapping); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_tasks, __pyx_v_func}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_tasks, __pyx_v_func}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_tasks); __Pyx_GIVEREF(__pyx_v_tasks); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_tasks); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_func); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_old_attr, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2959 * setattr(self, old_attr, _StateLegacyMapping(tasks, func)) * * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("nbytes", "nbytes", None), * ("who_wants", "who_wants", _legacy_client_key_set), */ } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":2979 * setattr(self, old_attr, _OptionalStateLegacyMapping(tasks, func)) * * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("loose_restrictions", "loose_restrictions", None) * ]: */ __pyx_t_14 = __pyx_tuple__26; __Pyx_INCREF(__pyx_t_14); __pyx_t_12 = 0; for (;;) { if (__pyx_t_12 >= 1) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2979, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 2979, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2979, __pyx_L1_error) } __Pyx_XDECREF_SET(__pyx_v_old_attr, __pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_new_attr, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_wrap, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2982 * ("loose_restrictions", "loose_restrictions", None) * ]: * func = operator.attrgetter(new_attr) # <<<<<<<<<<<<<< * if wrap is not None: * func = compose(wrap, func) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_new_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_new_attr); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2983 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacySet(tasks, func)) */ __pyx_t_6 = (__pyx_v_wrap != Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":2984 * func = operator.attrgetter(new_attr) * if wrap is not None: * func = compose(wrap, func) # <<<<<<<<<<<<<< * setattr(self, old_attr, _StateLegacySet(tasks, func)) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_compose); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_wrap, __pyx_v_func}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_wrap, __pyx_v_func}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_wrap); __Pyx_GIVEREF(__pyx_v_wrap); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_v_wrap); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_func); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2983 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacySet(tasks, func)) */ } /* "distributed/scheduler.py":2985 * if wrap is not None: * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacySet(tasks, func)) # <<<<<<<<<<<<<< * * self.generation = 0 */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_StateLegacySet); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_tasks, __pyx_v_func}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2985, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_tasks, __pyx_v_func}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2985, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_INCREF(__pyx_v_tasks); __Pyx_GIVEREF(__pyx_v_tasks); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_tasks); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_func); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_old_attr, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2985, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":2979 * setattr(self, old_attr, _OptionalStateLegacyMapping(tasks, func)) * * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("loose_restrictions", "loose_restrictions", None) * ]: */ } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":2987 * setattr(self, old_attr, _StateLegacySet(tasks, func)) * * self.generation = 0 # <<<<<<<<<<<<<< * self._last_client = None * self._last_time = 0 */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_generation, __pyx_int_0) < 0) __PYX_ERR(0, 2987, __pyx_L1_error) /* "distributed/scheduler.py":2988 * * self.generation = 0 * self._last_client = None # <<<<<<<<<<<<<< * self._last_time = 0 * unrunnable = set() */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_client, Py_None) < 0) __PYX_ERR(0, 2988, __pyx_L1_error) /* "distributed/scheduler.py":2989 * self.generation = 0 * self._last_client = None * self._last_time = 0 # <<<<<<<<<<<<<< * unrunnable = set() * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_time, __pyx_int_0) < 0) __PYX_ERR(0, 2989, __pyx_L1_error) /* "distributed/scheduler.py":2990 * self._last_client = None * self._last_time = 0 * unrunnable = set() # <<<<<<<<<<<<<< * * self.datasets = dict() */ __pyx_t_14 = PySet_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_v_unrunnable = ((PyObject*)__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":2992 * unrunnable = set() * * self.datasets = dict() # <<<<<<<<<<<<<< * * # Prefix-keyed containers */ __pyx_t_14 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_datasets, __pyx_t_14) < 0) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":2997 * * # Client state * clients = dict() # <<<<<<<<<<<<<< * for old_attr, new_attr, wrap in [ * ("wants_what", "wants_what", _legacy_task_key_set) */ __pyx_t_14 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_v_clients = ((PyObject*)__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":2999 * clients = dict() * for old_attr, new_attr, wrap in [ * ("wants_what", "wants_what", _legacy_task_key_set) # <<<<<<<<<<<<<< * ]: * func = operator.attrgetter(new_attr) */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_legacy_task_key_set); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_u_wants_what); __Pyx_GIVEREF(__pyx_n_u_wants_what); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_wants_what); __Pyx_INCREF(__pyx_n_u_wants_what); __Pyx_GIVEREF(__pyx_n_u_wants_what); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_wants_what); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":2998 * # Client state * clients = dict() * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("wants_what", "wants_what", _legacy_task_key_set) * ]: */ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_14; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; for (;;) { if (__pyx_t_12 >= 1) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2998, __pyx_L1_error) #else __pyx_t_14 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); #endif if (likely(__pyx_t_14 != Py_None)) { PyObject* sequence = __pyx_t_14; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 2998, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2998, __pyx_L1_error) } __Pyx_XDECREF_SET(__pyx_v_old_attr, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_new_attr, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_wrap, __pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3001 * ("wants_what", "wants_what", _legacy_task_key_set) * ]: * func = operator.attrgetter(new_attr) # <<<<<<<<<<<<<< * if wrap is not None: * func = compose(wrap, func) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_operator); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_13, __pyx_v_new_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_new_attr); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3002 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(clients, func)) */ __pyx_t_5 = (__pyx_v_wrap != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":3003 * func = operator.attrgetter(new_attr) * if wrap is not None: * func = compose(wrap, func) # <<<<<<<<<<<<<< * setattr(self, old_attr, _StateLegacyMapping(clients, func)) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_compose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_wrap, __pyx_v_func}; __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3003, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_14); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_wrap, __pyx_v_func}; __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3003, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_14); } else #endif { __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_INCREF(__pyx_v_wrap); __Pyx_GIVEREF(__pyx_v_wrap); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_wrap); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_func); __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3002 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(clients, func)) */ } /* "distributed/scheduler.py":3004 * if wrap is not None: * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(clients, func)) # <<<<<<<<<<<<<< * * # Worker state */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_StateLegacyMapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_clients, __pyx_v_func}; __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3004, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_14); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_clients, __pyx_v_func}; __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3004, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_14); } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_clients); __Pyx_GIVEREF(__pyx_v_clients); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_v_clients); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_func); __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_old_attr, __pyx_t_14); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 3004, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":2998 * # Client state * clients = dict() * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("wants_what", "wants_what", _legacy_task_key_set) * ]: */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3007 * * # Worker state * workers = sortedcontainers.SortedDict() # <<<<<<<<<<<<<< * for old_attr, new_attr, wrap in [ * ("nthreads", "nthreads", None), */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sortedcontainers); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_SortedDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_workers = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":3015 * ("occupancy", "occupancy", None), * ("worker_info", "metrics", None), * ("processing", "processing", _legacy_task_key_dict), # <<<<<<<<<<<<<< * ("has_what", "has_what", _legacy_task_key_set), * ]: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_legacy_task_key_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_u_processing_2); __Pyx_GIVEREF(__pyx_n_u_processing_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_processing_2); __Pyx_INCREF(__pyx_n_u_processing_2); __Pyx_GIVEREF(__pyx_n_u_processing_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_processing_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3016 * ("worker_info", "metrics", None), * ("processing", "processing", _legacy_task_key_dict), * ("has_what", "has_what", _legacy_task_key_set), # <<<<<<<<<<<<<< * ]: * func = operator.attrgetter(new_attr) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_legacy_task_key_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_n_u_has_what); __Pyx_GIVEREF(__pyx_n_u_has_what); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_n_u_has_what); __Pyx_INCREF(__pyx_n_u_has_what); __Pyx_GIVEREF(__pyx_n_u_has_what); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_u_has_what); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3008 * # Worker state * workers = sortedcontainers.SortedDict() * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("nthreads", "nthreads", None), * ("worker_bytes", "nbytes", None), */ __pyx_t_2 = PyTuple_New(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__27); __Pyx_INCREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_tuple__28); __Pyx_INCREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_tuple__29); __Pyx_INCREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_tuple__30); __Pyx_INCREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_tuple__31); __Pyx_INCREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_tuple__32); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_14); __pyx_t_1 = 0; __pyx_t_14 = 0; __pyx_t_14 = __pyx_t_2; __Pyx_INCREF(__pyx_t_14); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (__pyx_t_12 >= 8) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3008, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 3008, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 3008, __pyx_L1_error) } __Pyx_XDECREF_SET(__pyx_v_old_attr, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_new_attr, __pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_wrap, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3018 * ("has_what", "has_what", _legacy_task_key_set), * ]: * func = operator.attrgetter(new_attr) # <<<<<<<<<<<<<< * if wrap is not None: * func = compose(wrap, func) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_operator); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_new_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_new_attr); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3019 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(workers, func)) */ __pyx_t_6 = (__pyx_v_wrap != Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3020 * func = operator.attrgetter(new_attr) * if wrap is not None: * func = compose(wrap, func) # <<<<<<<<<<<<<< * setattr(self, old_attr, _StateLegacyMapping(workers, func)) * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_compose); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_wrap, __pyx_v_func}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_wrap, __pyx_v_func}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_wrap); __Pyx_GIVEREF(__pyx_v_wrap); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_wrap); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_func); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3019 * ]: * func = operator.attrgetter(new_attr) * if wrap is not None: # <<<<<<<<<<<<<< * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(workers, func)) */ } /* "distributed/scheduler.py":3021 * if wrap is not None: * func = compose(wrap, func) * setattr(self, old_attr, _StateLegacyMapping(workers, func)) # <<<<<<<<<<<<<< * * host_info = defaultdict(dict) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_StateLegacyMapping); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_workers, __pyx_v_func}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3021, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_workers, __pyx_v_func}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3021, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_workers); __Pyx_GIVEREF(__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_workers); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_func); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_old_attr, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 3021, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3008 * # Worker state * workers = sortedcontainers.SortedDict() * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("nthreads", "nthreads", None), * ("worker_bytes", "nbytes", None), */ } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3023 * setattr(self, old_attr, _StateLegacyMapping(workers, func)) * * host_info = defaultdict(dict) # <<<<<<<<<<<<<< * resources = defaultdict(dict) * aliases = dict() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, ((PyObject *)(&PyDict_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)(&PyDict_Type))); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_host_info = __pyx_t_14; __pyx_t_14 = 0; /* "distributed/scheduler.py":3024 * * host_info = defaultdict(dict) * resources = defaultdict(dict) # <<<<<<<<<<<<<< * aliases = dict() * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, ((PyObject *)(&PyDict_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)(&PyDict_Type))); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_resources = __pyx_t_14; __pyx_t_14 = 0; /* "distributed/scheduler.py":3025 * host_info = defaultdict(dict) * resources = defaultdict(dict) * aliases = dict() # <<<<<<<<<<<<<< * * self._task_state_collections = [unrunnable] */ __pyx_t_14 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_v_aliases = ((PyObject*)__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3027 * aliases = dict() * * self._task_state_collections = [unrunnable] # <<<<<<<<<<<<<< * * self._worker_collections = [ */ __pyx_t_14 = PyList_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_unrunnable); __Pyx_GIVEREF(__pyx_v_unrunnable); PyList_SET_ITEM(__pyx_t_14, 0, __pyx_v_unrunnable); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_task_state_collections, __pyx_t_14) < 0) __PYX_ERR(0, 3027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3029 * self._task_state_collections = [unrunnable] * * self._worker_collections = [ # <<<<<<<<<<<<<< * workers, * host_info, */ __pyx_t_14 = PyList_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_workers); __Pyx_GIVEREF(__pyx_v_workers); PyList_SET_ITEM(__pyx_t_14, 0, __pyx_v_workers); __Pyx_INCREF(__pyx_v_host_info); __Pyx_GIVEREF(__pyx_v_host_info); PyList_SET_ITEM(__pyx_t_14, 1, __pyx_v_host_info); __Pyx_INCREF(__pyx_v_resources); __Pyx_GIVEREF(__pyx_v_resources); PyList_SET_ITEM(__pyx_t_14, 2, __pyx_v_resources); __Pyx_INCREF(__pyx_v_aliases); __Pyx_GIVEREF(__pyx_v_aliases); PyList_SET_ITEM(__pyx_t_14, 3, __pyx_v_aliases); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_worker_collections, __pyx_t_14) < 0) __PYX_ERR(0, 3029, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3036 * ] * * self.plugins = list(plugins) # <<<<<<<<<<<<<< * self.transition_log = deque( * maxlen=dask.config.get("distributed.scheduler.transition-log-length") */ __pyx_t_14 = PySequence_List(__pyx_v_plugins); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_plugins, __pyx_t_14) < 0) __PYX_ERR(0, 3036, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3037 * * self.plugins = list(plugins) * self.transition_log = deque( # <<<<<<<<<<<<<< * maxlen=dask.config.get("distributed.scheduler.transition-log-length") * ) */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_deque); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "distributed/scheduler.py":3038 * self.plugins = list(plugins) * self.transition_log = deque( * maxlen=dask.config.get("distributed.scheduler.transition-log-length") # <<<<<<<<<<<<<< * ) * self.log = deque( */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_dask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_13 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_kp_u_distributed_scheduler_transition) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_distributed_scheduler_transition); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxlen, __pyx_t_13) < 0) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3037 * * self.plugins = list(plugins) * self.transition_log = deque( # <<<<<<<<<<<<<< * maxlen=dask.config.get("distributed.scheduler.transition-log-length") * ) */ __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_transition_log, __pyx_t_13) < 0) __PYX_ERR(0, 3037, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3040 * maxlen=dask.config.get("distributed.scheduler.transition-log-length") * ) * self.log = deque( # <<<<<<<<<<<<<< * maxlen=dask.config.get("distributed.scheduler.transition-log-length") * ) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_deque); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "distributed/scheduler.py":3041 * ) * self.log = deque( * maxlen=dask.config.get("distributed.scheduler.transition-log-length") # <<<<<<<<<<<<<< * ) * self.events = defaultdict(lambda: deque(maxlen=100000)) */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_dask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_14 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_kp_u_distributed_scheduler_transition) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_distributed_scheduler_transition); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxlen, __pyx_t_14) < 0) __PYX_ERR(0, 3041, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3040 * maxlen=dask.config.get("distributed.scheduler.transition-log-length") * ) * self.log = deque( # <<<<<<<<<<<<<< * maxlen=dask.config.get("distributed.scheduler.transition-log-length") * ) */ __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_log, __pyx_t_14) < 0) __PYX_ERR(0, 3040, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3043 * maxlen=dask.config.get("distributed.scheduler.transition-log-length") * ) * self.events = defaultdict(lambda: deque(maxlen=100000)) # <<<<<<<<<<<<<< * self.event_counts = defaultdict(int) * self.worker_plugins = [] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_8__init___lambda4, 0, __pyx_n_s_Scheduler___init___locals_lambda, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_14 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_13); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_events, __pyx_t_14) < 0) __PYX_ERR(0, 3043, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3044 * ) * self.events = defaultdict(lambda: deque(maxlen=100000)) * self.event_counts = defaultdict(int) # <<<<<<<<<<<<<< * self.worker_plugins = [] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, ((PyObject *)(&PyInt_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)(&PyInt_Type))); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_event_counts, __pyx_t_14) < 0) __PYX_ERR(0, 3044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3045 * self.events = defaultdict(lambda: deque(maxlen=100000)) * self.event_counts = defaultdict(int) * self.worker_plugins = [] # <<<<<<<<<<<<<< * * worker_handlers = { */ __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_worker_plugins, __pyx_t_14) < 0) __PYX_ERR(0, 3045, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3048 * * worker_handlers = { * "task-finished": self.handle_task_finished, # <<<<<<<<<<<<<< * "task-erred": self.handle_task_erred, * "release": self.handle_release_data, */ __pyx_t_14 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handle_task_finished); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_task_finished, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3049 * worker_handlers = { * "task-finished": self.handle_task_finished, * "task-erred": self.handle_task_erred, # <<<<<<<<<<<<<< * "release": self.handle_release_data, * "release-worker-data": self.release_worker_data, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handle_task_erred); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_task_erred, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3050 * "task-finished": self.handle_task_finished, * "task-erred": self.handle_task_erred, * "release": self.handle_release_data, # <<<<<<<<<<<<<< * "release-worker-data": self.release_worker_data, * "add-keys": self.add_keys, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handle_release_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_release, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3051 * "task-erred": self.handle_task_erred, * "release": self.handle_release_data, * "release-worker-data": self.release_worker_data, # <<<<<<<<<<<<<< * "add-keys": self.add_keys, * "missing-data": self.handle_missing_data, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_release_worker_data_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_release_worker_data, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3052 * "release": self.handle_release_data, * "release-worker-data": self.release_worker_data, * "add-keys": self.add_keys, # <<<<<<<<<<<<<< * "missing-data": self.handle_missing_data, * "long-running": self.handle_long_running, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_keys_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_add_keys, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3053 * "release-worker-data": self.release_worker_data, * "add-keys": self.add_keys, * "missing-data": self.handle_missing_data, # <<<<<<<<<<<<<< * "long-running": self.handle_long_running, * "reschedule": self.reschedule, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handle_missing_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_missing_data, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3054 * "add-keys": self.add_keys, * "missing-data": self.handle_missing_data, * "long-running": self.handle_long_running, # <<<<<<<<<<<<<< * "reschedule": self.reschedule, * "keep-alive": lambda *args, **kwargs: None, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handle_long_running); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_long_running, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3055 * "missing-data": self.handle_missing_data, * "long-running": self.handle_long_running, * "reschedule": self.reschedule, # <<<<<<<<<<<<<< * "keep-alive": lambda *args, **kwargs: None, * "log-event": self.log_worker_event, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reschedule); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_reschedule, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3056 * "long-running": self.handle_long_running, * "reschedule": self.reschedule, * "keep-alive": lambda *args, **kwargs: None, # <<<<<<<<<<<<<< * "log-event": self.log_worker_event, * } */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_8__init___1lambda5, 0, __pyx_n_s_Scheduler___init___locals_lambda, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_keep_alive, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3057 * "reschedule": self.reschedule, * "keep-alive": lambda *args, **kwargs: None, * "log-event": self.log_worker_event, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log_worker_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_log_event, __pyx_t_2) < 0) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_worker_handlers = ((PyObject*)__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3061 * * client_handlers = { * "update-graph": self.update_graph, # <<<<<<<<<<<<<< * "update-graph-hlg": self.update_graph_hlg, * "client-desires-keys": self.client_desires_keys, */ __pyx_t_14 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_graph_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_update_graph, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3062 * client_handlers = { * "update-graph": self.update_graph, * "update-graph-hlg": self.update_graph_hlg, # <<<<<<<<<<<<<< * "client-desires-keys": self.client_desires_keys, * "update-data": self.update_data, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_graph_hlg_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_update_graph_hlg, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3063 * "update-graph": self.update_graph, * "update-graph-hlg": self.update_graph_hlg, * "client-desires-keys": self.client_desires_keys, # <<<<<<<<<<<<<< * "update-data": self.update_data, * "report-key": self.report_on_key, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_desires_keys_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_client_desires_keys, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3064 * "update-graph-hlg": self.update_graph_hlg, * "client-desires-keys": self.client_desires_keys, * "update-data": self.update_data, # <<<<<<<<<<<<<< * "report-key": self.report_on_key, * "client-releases-keys": self.client_releases_keys, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_data_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_update_data, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3065 * "client-desires-keys": self.client_desires_keys, * "update-data": self.update_data, * "report-key": self.report_on_key, # <<<<<<<<<<<<<< * "client-releases-keys": self.client_releases_keys, * "heartbeat-client": self.client_heartbeat, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_report_on_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_report_key, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3066 * "update-data": self.update_data, * "report-key": self.report_on_key, * "client-releases-keys": self.client_releases_keys, # <<<<<<<<<<<<<< * "heartbeat-client": self.client_heartbeat, * "close-client": self.remove_client, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_releases_keys_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_client_releases_keys, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3067 * "report-key": self.report_on_key, * "client-releases-keys": self.client_releases_keys, * "heartbeat-client": self.client_heartbeat, # <<<<<<<<<<<<<< * "close-client": self.remove_client, * "restart": self.restart, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_heartbeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_heartbeat_client, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3068 * "client-releases-keys": self.client_releases_keys, * "heartbeat-client": self.client_heartbeat, * "close-client": self.remove_client, # <<<<<<<<<<<<<< * "restart": self.restart, * } */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_close_client, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3069 * "heartbeat-client": self.client_heartbeat, * "close-client": self.remove_client, * "restart": self.restart, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_restart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_restart, __pyx_t_2) < 0) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_client_handlers = ((PyObject*)__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3073 * * self.handlers = { * "register-client": self.add_client, # <<<<<<<<<<<<<< * "scatter": self.scatter, * "register-worker": self.add_worker, */ __pyx_t_14 = __Pyx_PyDict_NewPresized(44); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_register_client, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3074 * self.handlers = { * "register-client": self.add_client, * "scatter": self.scatter, # <<<<<<<<<<<<<< * "register-worker": self.add_worker, * "unregister": self.remove_worker, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scatter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_scatter, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3075 * "register-client": self.add_client, * "scatter": self.scatter, * "register-worker": self.add_worker, # <<<<<<<<<<<<<< * "unregister": self.remove_worker, * "gather": self.gather, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_kp_u_register_worker, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3076 * "scatter": self.scatter, * "register-worker": self.add_worker, * "unregister": self.remove_worker, # <<<<<<<<<<<<<< * "gather": self.gather, * "cancel": self.stimulus_cancel, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_unregister, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3077 * "register-worker": self.add_worker, * "unregister": self.remove_worker, * "gather": self.gather, # <<<<<<<<<<<<<< * "cancel": self.stimulus_cancel, * "retry": self.stimulus_retry, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_gather); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_gather, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3078 * "unregister": self.remove_worker, * "gather": self.gather, * "cancel": self.stimulus_cancel, # <<<<<<<<<<<<<< * "retry": self.stimulus_retry, * "feed": self.feed, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stimulus_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_cancel, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3079 * "gather": self.gather, * "cancel": self.stimulus_cancel, * "retry": self.stimulus_retry, # <<<<<<<<<<<<<< * "feed": self.feed, * "terminate": self.close, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stimulus_retry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_retry, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3080 * "cancel": self.stimulus_cancel, * "retry": self.stimulus_retry, * "feed": self.feed, # <<<<<<<<<<<<<< * "terminate": self.close, * "broadcast": self.broadcast, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_feed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_feed, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3081 * "retry": self.stimulus_retry, * "feed": self.feed, * "terminate": self.close, # <<<<<<<<<<<<<< * "broadcast": self.broadcast, * "proxy": self.proxy, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_terminate, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3082 * "feed": self.feed, * "terminate": self.close, * "broadcast": self.broadcast, # <<<<<<<<<<<<<< * "proxy": self.proxy, * "ncores": self.get_ncores, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_broadcast, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3083 * "terminate": self.close, * "broadcast": self.broadcast, * "proxy": self.proxy, # <<<<<<<<<<<<<< * "ncores": self.get_ncores, * "has_what": self.get_has_what, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_proxy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_proxy, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3084 * "broadcast": self.broadcast, * "proxy": self.proxy, * "ncores": self.get_ncores, # <<<<<<<<<<<<<< * "has_what": self.get_has_what, * "who_has": self.get_who_has, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_ncores); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_ncores, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3085 * "proxy": self.proxy, * "ncores": self.get_ncores, * "has_what": self.get_has_what, # <<<<<<<<<<<<<< * "who_has": self.get_who_has, * "processing": self.get_processing, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_has_what); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_has_what, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3086 * "ncores": self.get_ncores, * "has_what": self.get_has_what, * "who_has": self.get_who_has, # <<<<<<<<<<<<<< * "processing": self.get_processing, * "call_stack": self.get_call_stack, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_who_has); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_who_has, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3087 * "has_what": self.get_has_what, * "who_has": self.get_who_has, * "processing": self.get_processing, # <<<<<<<<<<<<<< * "call_stack": self.get_call_stack, * "profile": self.get_profile, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_processing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_processing_2, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3088 * "who_has": self.get_who_has, * "processing": self.get_processing, * "call_stack": self.get_call_stack, # <<<<<<<<<<<<<< * "profile": self.get_profile, * "performance_report": self.performance_report, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_call_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_call_stack, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3089 * "processing": self.get_processing, * "call_stack": self.get_call_stack, * "profile": self.get_profile, # <<<<<<<<<<<<<< * "performance_report": self.performance_report, * "get_logs": self.get_logs, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_profile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_profile, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3090 * "call_stack": self.get_call_stack, * "profile": self.get_profile, * "performance_report": self.performance_report, # <<<<<<<<<<<<<< * "get_logs": self.get_logs, * "logs": self.get_logs, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_performance_report); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_performance_report, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3091 * "profile": self.get_profile, * "performance_report": self.performance_report, * "get_logs": self.get_logs, # <<<<<<<<<<<<<< * "logs": self.get_logs, * "worker_logs": self.get_worker_logs, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_logs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_get_logs, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3092 * "performance_report": self.performance_report, * "get_logs": self.get_logs, * "logs": self.get_logs, # <<<<<<<<<<<<<< * "worker_logs": self.get_worker_logs, * "log_event": self.log_worker_event, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_logs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_logs, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3093 * "get_logs": self.get_logs, * "logs": self.get_logs, * "worker_logs": self.get_worker_logs, # <<<<<<<<<<<<<< * "log_event": self.log_worker_event, * "events": self.get_events, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_worker_logs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_worker_logs, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3094 * "logs": self.get_logs, * "worker_logs": self.get_worker_logs, * "log_event": self.log_worker_event, # <<<<<<<<<<<<<< * "events": self.get_events, * "nbytes": self.get_nbytes, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log_worker_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_log_event_2, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3095 * "worker_logs": self.get_worker_logs, * "log_event": self.log_worker_event, * "events": self.get_events, # <<<<<<<<<<<<<< * "nbytes": self.get_nbytes, * "versions": self.versions, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_events, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3096 * "log_event": self.log_worker_event, * "events": self.get_events, * "nbytes": self.get_nbytes, # <<<<<<<<<<<<<< * "versions": self.versions, * "add_keys": self.add_keys, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_nbytes, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3097 * "events": self.get_events, * "nbytes": self.get_nbytes, * "versions": self.versions, # <<<<<<<<<<<<<< * "add_keys": self.add_keys, * "rebalance": self.rebalance, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_versions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_versions, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3098 * "nbytes": self.get_nbytes, * "versions": self.versions, * "add_keys": self.add_keys, # <<<<<<<<<<<<<< * "rebalance": self.rebalance, * "replicate": self.replicate, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_keys_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_add_keys_2, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3099 * "versions": self.versions, * "add_keys": self.add_keys, * "rebalance": self.rebalance, # <<<<<<<<<<<<<< * "replicate": self.replicate, * "start_ipython": self.start_ipython, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rebalance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_rebalance, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3100 * "add_keys": self.add_keys, * "rebalance": self.rebalance, * "replicate": self.replicate, # <<<<<<<<<<<<<< * "start_ipython": self.start_ipython, * "run_function": self.run_function, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_replicate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_replicate, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3101 * "rebalance": self.rebalance, * "replicate": self.replicate, * "start_ipython": self.start_ipython, # <<<<<<<<<<<<<< * "run_function": self.run_function, * "update_data": self.update_data, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_start_ipython); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_start_ipython, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3102 * "replicate": self.replicate, * "start_ipython": self.start_ipython, * "run_function": self.run_function, # <<<<<<<<<<<<<< * "update_data": self.update_data, * "set_resources": self.add_resources, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_run_function); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_run_function, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3103 * "start_ipython": self.start_ipython, * "run_function": self.run_function, * "update_data": self.update_data, # <<<<<<<<<<<<<< * "set_resources": self.add_resources, * "retire_workers": self.retire_workers, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_data_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_update_data_2, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3104 * "run_function": self.run_function, * "update_data": self.update_data, * "set_resources": self.add_resources, # <<<<<<<<<<<<<< * "retire_workers": self.retire_workers, * "get_metadata": self.get_metadata, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_resources); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_set_resources, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3105 * "update_data": self.update_data, * "set_resources": self.add_resources, * "retire_workers": self.retire_workers, # <<<<<<<<<<<<<< * "get_metadata": self.get_metadata, * "set_metadata": self.set_metadata, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_retire_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_retire_workers, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3106 * "set_resources": self.add_resources, * "retire_workers": self.retire_workers, * "get_metadata": self.get_metadata, # <<<<<<<<<<<<<< * "set_metadata": self.set_metadata, * "heartbeat_worker": self.heartbeat_worker, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_get_metadata, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3107 * "retire_workers": self.retire_workers, * "get_metadata": self.get_metadata, * "set_metadata": self.set_metadata, # <<<<<<<<<<<<<< * "heartbeat_worker": self.heartbeat_worker, * "get_task_status": self.get_task_status, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_set_metadata, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3108 * "get_metadata": self.get_metadata, * "set_metadata": self.set_metadata, * "heartbeat_worker": self.heartbeat_worker, # <<<<<<<<<<<<<< * "get_task_status": self.get_task_status, * "get_task_stream": self.get_task_stream, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_heartbeat_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_heartbeat_worker, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3109 * "set_metadata": self.set_metadata, * "heartbeat_worker": self.heartbeat_worker, * "get_task_status": self.get_task_status, # <<<<<<<<<<<<<< * "get_task_stream": self.get_task_stream, * "register_worker_plugin": self.register_worker_plugin, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_task_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_get_task_status, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3110 * "heartbeat_worker": self.heartbeat_worker, * "get_task_status": self.get_task_status, * "get_task_stream": self.get_task_stream, # <<<<<<<<<<<<<< * "register_worker_plugin": self.register_worker_plugin, * "adaptive_target": self.adaptive_target, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_task_stream); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_get_task_stream, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3111 * "get_task_status": self.get_task_status, * "get_task_stream": self.get_task_stream, * "register_worker_plugin": self.register_worker_plugin, # <<<<<<<<<<<<<< * "adaptive_target": self.adaptive_target, * "workers_to_close": self.workers_to_close, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_register_worker_plugin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_register_worker_plugin, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3112 * "get_task_stream": self.get_task_stream, * "register_worker_plugin": self.register_worker_plugin, * "adaptive_target": self.adaptive_target, # <<<<<<<<<<<<<< * "workers_to_close": self.workers_to_close, * "subscribe_worker_status": self.subscribe_worker_status, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_adaptive_target); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_adaptive_target, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3113 * "register_worker_plugin": self.register_worker_plugin, * "adaptive_target": self.adaptive_target, * "workers_to_close": self.workers_to_close, # <<<<<<<<<<<<<< * "subscribe_worker_status": self.subscribe_worker_status, * "start_task_metadata": self.start_task_metadata, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workers_to_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_workers_to_close, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3114 * "adaptive_target": self.adaptive_target, * "workers_to_close": self.workers_to_close, * "subscribe_worker_status": self.subscribe_worker_status, # <<<<<<<<<<<<<< * "start_task_metadata": self.start_task_metadata, * "stop_task_metadata": self.stop_task_metadata, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_subscribe_worker_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_subscribe_worker_status, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3115 * "workers_to_close": self.workers_to_close, * "subscribe_worker_status": self.subscribe_worker_status, * "start_task_metadata": self.start_task_metadata, # <<<<<<<<<<<<<< * "stop_task_metadata": self.stop_task_metadata, * } */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_start_task_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_start_task_metadata, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3116 * "subscribe_worker_status": self.subscribe_worker_status, * "start_task_metadata": self.start_task_metadata, * "stop_task_metadata": self.stop_task_metadata, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stop_task_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_n_u_stop_task_metadata, __pyx_t_2) < 0) __PYX_ERR(0, 3073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3072 * } * * self.handlers = { # <<<<<<<<<<<<<< * "register-client": self.add_client, * "scatter": self.scatter, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_handlers, __pyx_t_14) < 0) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3120 * * self._transitions = { * ("released", "waiting"): self.transition_released_waiting, # <<<<<<<<<<<<<< * ("waiting", "released"): self.transition_waiting_released, * ("waiting", "processing"): self.transition_waiting_processing, */ __pyx_t_14 = __Pyx_PyDict_NewPresized(15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_released_waiting); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__33, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3121 * self._transitions = { * ("released", "waiting"): self.transition_released_waiting, * ("waiting", "released"): self.transition_waiting_released, # <<<<<<<<<<<<<< * ("waiting", "processing"): self.transition_waiting_processing, * ("waiting", "memory"): self.transition_waiting_memory, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_waiting_released); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__34, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3122 * ("released", "waiting"): self.transition_released_waiting, * ("waiting", "released"): self.transition_waiting_released, * ("waiting", "processing"): self.transition_waiting_processing, # <<<<<<<<<<<<<< * ("waiting", "memory"): self.transition_waiting_memory, * ("processing", "released"): self.transition_processing_released, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_waiting_processing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__35, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3123 * ("waiting", "released"): self.transition_waiting_released, * ("waiting", "processing"): self.transition_waiting_processing, * ("waiting", "memory"): self.transition_waiting_memory, # <<<<<<<<<<<<<< * ("processing", "released"): self.transition_processing_released, * ("processing", "memory"): self.transition_processing_memory, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_waiting_memory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__36, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3124 * ("waiting", "processing"): self.transition_waiting_processing, * ("waiting", "memory"): self.transition_waiting_memory, * ("processing", "released"): self.transition_processing_released, # <<<<<<<<<<<<<< * ("processing", "memory"): self.transition_processing_memory, * ("processing", "erred"): self.transition_processing_erred, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_processing_released); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__37, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3125 * ("waiting", "memory"): self.transition_waiting_memory, * ("processing", "released"): self.transition_processing_released, * ("processing", "memory"): self.transition_processing_memory, # <<<<<<<<<<<<<< * ("processing", "erred"): self.transition_processing_erred, * ("no-worker", "released"): self.transition_no_worker_released, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_processing_memory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__38, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3126 * ("processing", "released"): self.transition_processing_released, * ("processing", "memory"): self.transition_processing_memory, * ("processing", "erred"): self.transition_processing_erred, # <<<<<<<<<<<<<< * ("no-worker", "released"): self.transition_no_worker_released, * ("no-worker", "waiting"): self.transition_no_worker_waiting, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_processing_erred); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__39, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3127 * ("processing", "memory"): self.transition_processing_memory, * ("processing", "erred"): self.transition_processing_erred, * ("no-worker", "released"): self.transition_no_worker_released, # <<<<<<<<<<<<<< * ("no-worker", "waiting"): self.transition_no_worker_waiting, * ("released", "forgotten"): self.transition_released_forgotten, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_no_worker_released); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__40, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3128 * ("processing", "erred"): self.transition_processing_erred, * ("no-worker", "released"): self.transition_no_worker_released, * ("no-worker", "waiting"): self.transition_no_worker_waiting, # <<<<<<<<<<<<<< * ("released", "forgotten"): self.transition_released_forgotten, * ("memory", "forgotten"): self.transition_memory_forgotten, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_no_worker_waiting); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__41, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3129 * ("no-worker", "released"): self.transition_no_worker_released, * ("no-worker", "waiting"): self.transition_no_worker_waiting, * ("released", "forgotten"): self.transition_released_forgotten, # <<<<<<<<<<<<<< * ("memory", "forgotten"): self.transition_memory_forgotten, * ("erred", "forgotten"): self.transition_released_forgotten, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_released_forgotten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__42, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3130 * ("no-worker", "waiting"): self.transition_no_worker_waiting, * ("released", "forgotten"): self.transition_released_forgotten, * ("memory", "forgotten"): self.transition_memory_forgotten, # <<<<<<<<<<<<<< * ("erred", "forgotten"): self.transition_released_forgotten, * ("erred", "released"): self.transition_erred_released, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_memory_forgotten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__43, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3131 * ("released", "forgotten"): self.transition_released_forgotten, * ("memory", "forgotten"): self.transition_memory_forgotten, * ("erred", "forgotten"): self.transition_released_forgotten, # <<<<<<<<<<<<<< * ("erred", "released"): self.transition_erred_released, * ("memory", "released"): self.transition_memory_released, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_released_forgotten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__44, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3132 * ("memory", "forgotten"): self.transition_memory_forgotten, * ("erred", "forgotten"): self.transition_released_forgotten, * ("erred", "released"): self.transition_erred_released, # <<<<<<<<<<<<<< * ("memory", "released"): self.transition_memory_released, * ("released", "erred"): self.transition_released_erred, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_erred_released); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__45, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3133 * ("erred", "forgotten"): self.transition_released_forgotten, * ("erred", "released"): self.transition_erred_released, * ("memory", "released"): self.transition_memory_released, # <<<<<<<<<<<<<< * ("released", "erred"): self.transition_released_erred, * } */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_memory_released); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__46, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3134 * ("erred", "released"): self.transition_erred_released, * ("memory", "released"): self.transition_memory_released, * ("released", "erred"): self.transition_released_erred, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_released_erred); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_14, __pyx_tuple__47, __pyx_t_2) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3119 * } * * self._transitions = { # <<<<<<<<<<<<<< * ("released", "waiting"): self.transition_released_waiting, * ("waiting", "released"): self.transition_waiting_released, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_transitions, __pyx_t_14) < 0) __PYX_ERR(0, 3119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3137 * } * * connection_limit = get_fileno_limit() / 2 # <<<<<<<<<<<<<< * * super().__init__( */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_fileno_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_14, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_connection_limit = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":3139 * connection_limit = get_fileno_limit() / 2 * * super().__init__( # <<<<<<<<<<<<<< * aliases=aliases, * handlers=self.handlers, */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 3139, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_self); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3140 * * super().__init__( * aliases=aliases, # <<<<<<<<<<<<<< * handlers=self.handlers, * stream_handlers=merge(worker_handlers, client_handlers), */ __pyx_t_13 = __Pyx_PyDict_NewPresized(14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_aliases, __pyx_v_aliases) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3141 * super().__init__( * aliases=aliases, * handlers=self.handlers, # <<<<<<<<<<<<<< * stream_handlers=merge(worker_handlers, client_handlers), * io_loop=self.loop, */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handlers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_handlers, __pyx_t_4) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3142 * aliases=aliases, * handlers=self.handlers, * stream_handlers=merge(worker_handlers, client_handlers), # <<<<<<<<<<<<<< * io_loop=self.loop, * connection_limit=connection_limit, */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_merge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_worker_handlers, __pyx_v_client_handlers}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3142, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_worker_handlers, __pyx_v_client_handlers}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3142, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_worker_handlers); __Pyx_GIVEREF(__pyx_v_worker_handlers); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_7, __pyx_v_worker_handlers); __Pyx_INCREF(__pyx_v_client_handlers); __Pyx_GIVEREF(__pyx_v_client_handlers); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_7, __pyx_v_client_handlers); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_stream_handlers, __pyx_t_4) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3143 * handlers=self.handlers, * stream_handlers=merge(worker_handlers, client_handlers), * io_loop=self.loop, # <<<<<<<<<<<<<< * connection_limit=connection_limit, * deserialize=False, */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_io_loop, __pyx_t_4) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3144 * stream_handlers=merge(worker_handlers, client_handlers), * io_loop=self.loop, * connection_limit=connection_limit, # <<<<<<<<<<<<<< * deserialize=False, * connection_args=self.connection_args, */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_connection_limit, __pyx_v_connection_limit) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3145 * io_loop=self.loop, * connection_limit=connection_limit, * deserialize=False, # <<<<<<<<<<<<<< * connection_args=self.connection_args, * clients=clients, */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_deserialize, Py_False) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3146 * connection_limit=connection_limit, * deserialize=False, * connection_args=self.connection_args, # <<<<<<<<<<<<<< * clients=clients, * workers=workers, */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connection_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_connection_args, __pyx_t_4) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3147 * deserialize=False, * connection_args=self.connection_args, * clients=clients, # <<<<<<<<<<<<<< * workers=workers, * host_info=host_info, */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_clients, __pyx_v_clients) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3148 * connection_args=self.connection_args, * clients=clients, * workers=workers, # <<<<<<<<<<<<<< * host_info=host_info, * resources=resources, */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_workers, __pyx_v_workers) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3149 * clients=clients, * workers=workers, * host_info=host_info, # <<<<<<<<<<<<<< * resources=resources, * tasks=tasks, */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_host_info, __pyx_v_host_info) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3150 * workers=workers, * host_info=host_info, * resources=resources, # <<<<<<<<<<<<<< * tasks=tasks, * unrunnable=unrunnable, */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_resources, __pyx_v_resources) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3151 * host_info=host_info, * resources=resources, * tasks=tasks, # <<<<<<<<<<<<<< * unrunnable=unrunnable, * validate=validate, */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_tasks, __pyx_v_tasks) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3152 * resources=resources, * tasks=tasks, * unrunnable=unrunnable, # <<<<<<<<<<<<<< * validate=validate, * **kwargs, */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_unrunnable, __pyx_v_unrunnable) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) /* "distributed/scheduler.py":3153 * tasks=tasks, * unrunnable=unrunnable, * validate=validate, # <<<<<<<<<<<<<< * **kwargs, * ) */ if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_validate, __pyx_v_validate) < 0) __PYX_ERR(0, 3140, __pyx_L1_error) __pyx_t_2 = __pyx_t_13; __pyx_t_13 = 0; /* "distributed/scheduler.py":3154 * unrunnable=unrunnable, * validate=validate, * **kwargs, # <<<<<<<<<<<<<< * ) * */ if (__Pyx_MergeKeywords(__pyx_t_2, __pyx_v_kwargs) < 0) __PYX_ERR(0, 3154, __pyx_L1_error) /* "distributed/scheduler.py":3139 * connection_limit = get_fileno_limit() / 2 * * super().__init__( # <<<<<<<<<<<<<< * aliases=aliases, * handlers=self.handlers, */ __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3157 * ) * * if self.worker_ttl: # <<<<<<<<<<<<<< * pc = PeriodicCallback(self.check_worker_ttl, self.worker_ttl) * self.periodic_callbacks["worker-ttl"] = pc */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_worker_ttl); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":3158 * * if self.worker_ttl: * pc = PeriodicCallback(self.check_worker_ttl, self.worker_ttl) # <<<<<<<<<<<<<< * self.periodic_callbacks["worker-ttl"] = pc * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PeriodicCallback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_worker_ttl); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_worker_ttl); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_14, __pyx_t_4}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_14, __pyx_t_4}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_7, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_7, __pyx_t_4); __pyx_t_14 = 0; __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_pc = __pyx_t_13; __pyx_t_13 = 0; /* "distributed/scheduler.py":3159 * if self.worker_ttl: * pc = PeriodicCallback(self.check_worker_ttl, self.worker_ttl) * self.periodic_callbacks["worker-ttl"] = pc # <<<<<<<<<<<<<< * * if self.idle_timeout: */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_periodic_callbacks); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (unlikely(PyObject_SetItem(__pyx_t_13, __pyx_kp_u_worker_ttl_2, __pyx_v_pc) < 0)) __PYX_ERR(0, 3159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3157 * ) * * if self.worker_ttl: # <<<<<<<<<<<<<< * pc = PeriodicCallback(self.check_worker_ttl, self.worker_ttl) * self.periodic_callbacks["worker-ttl"] = pc */ } /* "distributed/scheduler.py":3161 * self.periodic_callbacks["worker-ttl"] = pc * * if self.idle_timeout: # <<<<<<<<<<<<<< * pc = PeriodicCallback(self.check_idle, self.idle_timeout / 4) * self.periodic_callbacks["idle-timeout"] = pc */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_idle_timeout); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":3162 * * if self.idle_timeout: * pc = PeriodicCallback(self.check_idle, self.idle_timeout / 4) # <<<<<<<<<<<<<< * self.periodic_callbacks["idle-timeout"] = pc * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PeriodicCallback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_idle); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_idle_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_14 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_4, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_15, __pyx_t_14}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3162, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_15, __pyx_t_14}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3162, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_t_14); __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_pc, __pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3163 * if self.idle_timeout: * pc = PeriodicCallback(self.check_idle, self.idle_timeout / 4) * self.periodic_callbacks["idle-timeout"] = pc # <<<<<<<<<<<<<< * * if extensions is None: */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_periodic_callbacks); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (unlikely(PyObject_SetItem(__pyx_t_13, __pyx_kp_u_idle_timeout_2, __pyx_v_pc) < 0)) __PYX_ERR(0, 3163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3161 * self.periodic_callbacks["worker-ttl"] = pc * * if self.idle_timeout: # <<<<<<<<<<<<<< * pc = PeriodicCallback(self.check_idle, self.idle_timeout / 4) * self.periodic_callbacks["idle-timeout"] = pc */ } /* "distributed/scheduler.py":3165 * self.periodic_callbacks["idle-timeout"] = pc * * if extensions is None: # <<<<<<<<<<<<<< * extensions = list(DEFAULT_EXTENSIONS) * if dask.config.get("distributed.scheduler.work-stealing"): */ __pyx_t_5 = (__pyx_v_extensions == Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":3166 * * if extensions is None: * extensions = list(DEFAULT_EXTENSIONS) # <<<<<<<<<<<<<< * if dask.config.get("distributed.scheduler.work-stealing"): * extensions.append(WorkStealing) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DEFAULT_EXTENSIONS); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_2 = PySequence_List(__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF_SET(__pyx_v_extensions, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3167 * if extensions is None: * extensions = list(DEFAULT_EXTENSIONS) * if dask.config.get("distributed.scheduler.work-stealing"): # <<<<<<<<<<<<<< * extensions.append(WorkStealing) * for ext in extensions: */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_dask); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_1, __pyx_kp_u_distributed_scheduler_work_steal) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_u_distributed_scheduler_work_steal); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { /* "distributed/scheduler.py":3168 * extensions = list(DEFAULT_EXTENSIONS) * if dask.config.get("distributed.scheduler.work-stealing"): * extensions.append(WorkStealing) # <<<<<<<<<<<<<< * for ext in extensions: * ext(self) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WorkStealing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_extensions, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 3168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3167 * if extensions is None: * extensions = list(DEFAULT_EXTENSIONS) * if dask.config.get("distributed.scheduler.work-stealing"): # <<<<<<<<<<<<<< * extensions.append(WorkStealing) * for ext in extensions: */ } /* "distributed/scheduler.py":3165 * self.periodic_callbacks["idle-timeout"] = pc * * if extensions is None: # <<<<<<<<<<<<<< * extensions = list(DEFAULT_EXTENSIONS) * if dask.config.get("distributed.scheduler.work-stealing"): */ } /* "distributed/scheduler.py":3169 * if dask.config.get("distributed.scheduler.work-stealing"): * extensions.append(WorkStealing) * for ext in extensions: # <<<<<<<<<<<<<< * ext(self) * */ if (likely(PyList_CheckExact(__pyx_v_extensions)) || PyTuple_CheckExact(__pyx_v_extensions)) { __pyx_t_2 = __pyx_v_extensions; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0; __pyx_t_16 = NULL; } else { __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_extensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_16 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3169, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_16)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_13); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3169, __pyx_L1_error) #else __pyx_t_13 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_13); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3169, __pyx_L1_error) #else __pyx_t_13 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif } } else { __pyx_t_13 = __pyx_t_16(__pyx_t_2); if (unlikely(!__pyx_t_13)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3169, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_13); } __Pyx_XDECREF_SET(__pyx_v_ext, __pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3170 * extensions.append(WorkStealing) * for ext in extensions: * ext(self) # <<<<<<<<<<<<<< * * setproctitle("dask-scheduler [not started]") */ __Pyx_INCREF(__pyx_v_ext); __pyx_t_1 = __pyx_v_ext; __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_14, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_self); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":3169 * if dask.config.get("distributed.scheduler.work-stealing"): * extensions.append(WorkStealing) * for ext in extensions: # <<<<<<<<<<<<<< * ext(self) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3172 * ext(self) * * setproctitle("dask-scheduler [not started]") # <<<<<<<<<<<<<< * Scheduler._instances.add(self) * self.rpc.allow_offload = False */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_setproctitle); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_1, __pyx_kp_u_dask_scheduler_not_started) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_u_dask_scheduler_not_started); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3173 * * setproctitle("dask-scheduler [not started]") * Scheduler._instances.add(self) # <<<<<<<<<<<<<< * self.rpc.allow_offload = False * self.status = Status.undefined */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_Scheduler); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_instances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_add); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_1, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_self); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3174 * setproctitle("dask-scheduler [not started]") * Scheduler._instances.add(self) * self.rpc.allow_offload = False # <<<<<<<<<<<<<< * self.status = Status.undefined * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_allow_offload, Py_False) < 0) __PYX_ERR(0, 3174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3175 * Scheduler._instances.add(self) * self.rpc.allow_offload = False * self.status = Status.undefined # <<<<<<<<<<<<<< * * ################## */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_undefined); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_status, __pyx_t_13) < 0) __PYX_ERR(0, 3175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":2837 * _instances = weakref.WeakSet() * * def __init__( # <<<<<<<<<<<<<< * self, * loop=None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("distributed.scheduler.Scheduler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_http_server_modules); __Pyx_XDECREF(__pyx_v_show_dashboard); __Pyx_XDECREF(__pyx_v_distributed); __Pyx_XDECREF(__pyx_v_routes); __Pyx_XDECREF(__pyx_v_tasks); __Pyx_XDECREF(__pyx_v_old_attr); __Pyx_XDECREF(__pyx_v_new_attr); __Pyx_XDECREF(__pyx_v_wrap); __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_unrunnable); __Pyx_XDECREF(__pyx_v_clients); __Pyx_XDECREF(__pyx_v_workers); __Pyx_XDECREF(__pyx_v_host_info); __Pyx_XDECREF(__pyx_v_resources); __Pyx_XDECREF(__pyx_v_aliases); __Pyx_XDECREF(__pyx_v_worker_handlers); __Pyx_XDECREF(__pyx_v_client_handlers); __Pyx_XDECREF(__pyx_v_connection_limit); __Pyx_XDECREF(__pyx_v_pc); __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_allowed_failures); __Pyx_XDECREF(__pyx_v_extensions); __Pyx_XDECREF(__pyx_v_validate); __Pyx_XDECREF(__pyx_v_security); __Pyx_XDECREF(__pyx_v_worker_ttl); __Pyx_XDECREF(__pyx_v_idle_timeout); __Pyx_XDECREF(__pyx_v_preload); __Pyx_XDECREF(__pyx_v_preload_argv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3181 * ################## * * def __repr__(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * return '' % ( */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_3__repr__, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_UCS4 __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "distributed/scheduler.py":3182 * * def __repr__(self): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * return '' % ( * self.address, */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3183 * def __repr__(self): * parent: SchedulerState = cast(SchedulerState, self) * return '' % ( # <<<<<<<<<<<<<< * self.address, * len(parent._workers), */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; __Pyx_INCREF(__pyx_kp_u_Scheduler_2); __pyx_t_2 += 13; __Pyx_GIVEREF(__pyx_kp_u_Scheduler_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Scheduler_2); /* "distributed/scheduler.py":3184 * parent: SchedulerState = cast(SchedulerState, self) * return '' % ( * self.address, # <<<<<<<<<<<<<< * len(parent._workers), * parent._total_nthreads, */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_kp_u_processes); __pyx_t_2 += 13; __Pyx_GIVEREF(__pyx_kp_u_processes); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_processes); /* "distributed/scheduler.py":3185 * return '' % ( * self.address, * len(parent._workers), # <<<<<<<<<<<<<< * parent._total_nthreads, * ) */ __pyx_t_5 = __pyx_v_parent->_workers; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_kp_u_cores); __pyx_t_2 += 8; __Pyx_GIVEREF(__pyx_kp_u_cores); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_cores); /* "distributed/scheduler.py":3186 * self.address, * len(parent._workers), * parent._total_nthreads, # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_parent->_total_nthreads, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_kp_u__3); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__3); PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__3); /* "distributed/scheduler.py":3183 * def __repr__(self): * parent: SchedulerState = cast(SchedulerState, self) * return '' % ( # <<<<<<<<<<<<<< * self.address, * len(parent._workers), */ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "distributed/scheduler.py":3181 * ################## * * def __repr__(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * return '' % ( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3189 * ) * * def identity(self, comm=None): # <<<<<<<<<<<<<< * """ Basic information about ourselves and our cluster """ * parent: SchedulerState = cast(SchedulerState, self) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_5identity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_4identity[] = " Basic information about ourselves and our cluster "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_5identity = {"identity", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_5identity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_4identity}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_5identity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("identity (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "identity") < 0)) __PYX_ERR(0, 3189, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("identity", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3189, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.identity", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_4identity(__pyx_self, __pyx_v_self, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_4identity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_d = NULL; PyObject *__pyx_9genexpr30__pyx_v_key = NULL; PyObject *__pyx_9genexpr30__pyx_v_v = NULL; PyObject *__pyx_9genexpr31__pyx_v_worker = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("identity", 0); /* "distributed/scheduler.py":3191 * def identity(self, comm=None): * """ Basic information about ourselves and our cluster """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * d = { * "type": type(self).__name__, */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3193 * parent: SchedulerState = cast(SchedulerState, self) * d = { * "type": type(self).__name__, # <<<<<<<<<<<<<< * "id": str(self.id), * "address": self.address, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_name_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_type, __pyx_t_2) < 0) __PYX_ERR(0, 3193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3194 * d = { * "type": type(self).__name__, * "id": str(self.id), # <<<<<<<<<<<<<< * "address": self.address, * "services": {key: v.port for (key, v) in self.services.items()}, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_id, __pyx_t_3) < 0) __PYX_ERR(0, 3193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3195 * "type": type(self).__name__, * "id": str(self.id), * "address": self.address, # <<<<<<<<<<<<<< * "services": {key: v.port for (key, v) in self.services.items()}, * "started": self.time_started, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_address, __pyx_t_3) < 0) __PYX_ERR(0, 3193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ /* "distributed/scheduler.py":3196 * "id": str(self.id), * "address": self.address, * "services": {key: v.port for (key, v) in self.services.items()}, # <<<<<<<<<<<<<< * "started": self.time_started, * "workers": { */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3196, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_services); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3196, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_t_7 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3196, __pyx_L5_error) } __pyx_t_8 = __Pyx_dict_iterator(__pyx_t_7, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3196, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 3196, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_key, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_v, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr30__pyx_v_v, __pyx_n_s_port); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3196, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr30__pyx_v_key, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3196, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_key); __pyx_9genexpr30__pyx_v_key = 0; __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_v); __pyx_9genexpr30__pyx_v_v = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_key); __pyx_9genexpr30__pyx_v_key = 0; __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_v); __pyx_9genexpr30__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_services, __pyx_t_3) < 0) __PYX_ERR(0, 3193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3197 * "address": self.address, * "services": {key: v.port for (key, v) in self.services.items()}, * "started": self.time_started, # <<<<<<<<<<<<<< * "workers": { * worker.address: worker.identity() for worker in parent._workers.values() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_time_started); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_started, __pyx_t_3) < 0) __PYX_ERR(0, 3193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ /* "distributed/scheduler.py":3198 * "services": {key: v.port for (key, v) in self.services.items()}, * "started": self.time_started, * "workers": { # <<<<<<<<<<<<<< * worker.address: worker.identity() for worker in parent._workers.values() * }, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3198, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":3199 * "started": self.time_started, * "workers": { * worker.address: worker.identity() for worker in parent._workers.values() # <<<<<<<<<<<<<< * }, * } */ __pyx_t_5 = 0; if (unlikely(__pyx_v_parent->_workers == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 3199, __pyx_L11_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_parent->_workers, 0, __pyx_n_s_values, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3199, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_5, NULL, &__pyx_t_7, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 3199, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_worker, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr31__pyx_v_worker, __pyx_n_s_address); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3199, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr31__pyx_v_worker, __pyx_n_s_identity); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3199, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3199, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 3199, __pyx_L11_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_worker); __pyx_9genexpr31__pyx_v_worker = 0; goto __pyx_L14_exit_scope; __pyx_L11_error:; __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_worker); __pyx_9genexpr31__pyx_v_worker = 0; goto __pyx_L1_error; __pyx_L14_exit_scope:; } /* exit inner scope */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_workers, __pyx_t_3) < 0) __PYX_ERR(0, 3193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3202 * }, * } * return d # <<<<<<<<<<<<<< * * def get_worker_service_addr(self, worker, service_name, protocol=False): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_d); __pyx_r = __pyx_v_d; goto __pyx_L0; /* "distributed/scheduler.py":3189 * ) * * def identity(self, comm=None): # <<<<<<<<<<<<<< * """ Basic information about ourselves and our cluster """ * parent: SchedulerState = cast(SchedulerState, self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.Scheduler.identity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_key); __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_v); __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_worker); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3204 * return d * * def get_worker_service_addr(self, worker, service_name, protocol=False): # <<<<<<<<<<<<<< * """ * Get the (host, port) address of the named service on the *worker*. */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_7get_worker_service_addr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_6get_worker_service_addr[] = "\n Get the (host, port) address of the named service on the *worker*.\n Returns None if the service doesn't exist.\n\n Parameters\n ----------\n worker : address\n service_name : str\n Common services include 'bokeh' and 'nanny'\n protocol : boolean\n Whether or not to include a full address with protocol (True)\n or just a (host, port) pair\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_7get_worker_service_addr = {"get_worker_service_addr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_7get_worker_service_addr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_6get_worker_service_addr}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_7get_worker_service_addr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_service_name = 0; PyObject *__pyx_v_protocol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_worker_service_addr (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker,&__pyx_n_s_service_name,&__pyx_n_s_protocol,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)((PyObject *)Py_False)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_worker_service_addr", 0, 3, 4, 1); __PYX_ERR(0, 3204, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_service_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_worker_service_addr", 0, 3, 4, 2); __PYX_ERR(0, 3204, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_protocol); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_worker_service_addr") < 0)) __PYX_ERR(0, 3204, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_worker = values[1]; __pyx_v_service_name = values[2]; __pyx_v_protocol = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_worker_service_addr", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3204, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_worker_service_addr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_6get_worker_service_addr(__pyx_self, __pyx_v_self, __pyx_v_worker, __pyx_v_service_name, __pyx_v_protocol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_6get_worker_service_addr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, PyObject *__pyx_v_service_name, PyObject *__pyx_v_protocol) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_port = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_worker_service_addr", 0); /* "distributed/scheduler.py":3218 * or just a (host, port) pair * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers[worker] * port = ws._services.get(service_name) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3219 * """ * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers[worker] # <<<<<<<<<<<<<< * port = ws._services.get(service_name) * if port is None: */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_parent->_workers, __pyx_v_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 3219, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3220 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers[worker] * port = ws._services.get(service_name) # <<<<<<<<<<<<<< * if port is None: * return None */ if (unlikely(__pyx_v_ws->_services == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3220, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_ws->_services, __pyx_v_service_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_port = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":3221 * ws: WorkerState = parent._workers[worker] * port = ws._services.get(service_name) * if port is None: # <<<<<<<<<<<<<< * return None * elif protocol: */ __pyx_t_2 = (__pyx_v_port == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":3222 * port = ws._services.get(service_name) * if port is None: * return None # <<<<<<<<<<<<<< * elif protocol: * return "%(protocol)s://%(host)s:%(port)d" % { */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":3221 * ws: WorkerState = parent._workers[worker] * port = ws._services.get(service_name) * if port is None: # <<<<<<<<<<<<<< * return None * elif protocol: */ } /* "distributed/scheduler.py":3223 * if port is None: * return None * elif protocol: # <<<<<<<<<<<<<< * return "%(protocol)s://%(host)s:%(port)d" % { * "protocol": ws._address.split("://")[0], */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_protocol); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3223, __pyx_L1_error) if (__pyx_t_3) { /* "distributed/scheduler.py":3224 * return None * elif protocol: * return "%(protocol)s://%(host)s:%(port)d" % { # <<<<<<<<<<<<<< * "protocol": ws._address.split("://")[0], * "host": ws.host, */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":3225 * elif protocol: * return "%(protocol)s://%(host)s:%(port)d" % { * "protocol": ws._address.split("://")[0], # <<<<<<<<<<<<<< * "host": ws.host, * "port": port, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_ws->_address == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split"); __PYX_ERR(0, 3225, __pyx_L1_error) } __pyx_t_4 = PyUnicode_Split(__pyx_v_ws->_address, __pyx_kp_u__48, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_protocol, __pyx_t_5) < 0) __PYX_ERR(0, 3225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3226 * return "%(protocol)s://%(host)s:%(port)d" % { * "protocol": ws._address.split("://")[0], * "host": ws.host, # <<<<<<<<<<<<<< * "port": port, * } */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ws), __pyx_n_s_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_host, __pyx_t_5) < 0) __PYX_ERR(0, 3225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3227 * "protocol": ws._address.split("://")[0], * "host": ws.host, * "port": port, # <<<<<<<<<<<<<< * } * else: */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_port, __pyx_v_port) < 0) __PYX_ERR(0, 3225, __pyx_L1_error) /* "distributed/scheduler.py":3224 * return None * elif protocol: * return "%(protocol)s://%(host)s:%(port)d" % { # <<<<<<<<<<<<<< * "protocol": ws._address.split("://")[0], * "host": ws.host, */ __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_protocol_s_host_s_port_d, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "distributed/scheduler.py":3223 * if port is None: * return None * elif protocol: # <<<<<<<<<<<<<< * return "%(protocol)s://%(host)s:%(port)d" % { * "protocol": ws._address.split("://")[0], */ } /* "distributed/scheduler.py":3230 * } * else: * return ws.host, port # <<<<<<<<<<<<<< * * async def start(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ws), __pyx_n_s_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_INCREF(__pyx_v_port); __Pyx_GIVEREF(__pyx_v_port); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_port); __pyx_t_5 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":3204 * return d * * def get_worker_service_addr(self, worker, service_name, protocol=False): # <<<<<<<<<<<<<< * """ * Get the (host, port) address of the named service on the *worker*. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_worker_service_addr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_port); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_10generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":3232 * return ws.host, port * * async def start(self): # <<<<<<<<<<<<<< * """ Clear out old state and restart all running coroutines """ * await super().start() */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_9start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_8start[] = " Clear out old state and restart all running coroutines "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_9start = {"start", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_9start, METH_O, __pyx_doc_11distributed_9scheduler_9Scheduler_8start}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_9start(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_8start(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_8start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_9_start(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_9_start, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 3232, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_10generator1, __pyx_codeobj__49, (PyObject *) __pyx_cur_scope, __pyx_n_s_start, __pyx_n_s_Scheduler_start, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 3232, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); gen->classobj = __Pyx_CyFunction_GetClassObj(__pyx_self); __Pyx_INCREF(gen->classobj); __Pyx_GIVEREF(gen->classobj); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.start", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3277 * fn = self.scheduler_file # remove file when we close the process * * def del_scheduler_file(): # <<<<<<<<<<<<<< * if os.path.exists(fn): * os.remove(fn) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_5start_1del_scheduler_file(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_5start_1del_scheduler_file = {"del_scheduler_file", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_5start_1del_scheduler_file, METH_NOARGS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_5start_1del_scheduler_file(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("del_scheduler_file (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_5start_del_scheduler_file(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_5start_del_scheduler_file(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("del_scheduler_file", 0); __pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "distributed/scheduler.py":3278 * * def del_scheduler_file(): * if os.path.exists(fn): # <<<<<<<<<<<<<< * os.remove(fn) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_cur_scope->__pyx_v_fn)) { __Pyx_RaiseClosureNameError("fn"); __PYX_ERR(0, 3278, __pyx_L1_error) } __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_fn) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_fn); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "distributed/scheduler.py":3279 * def del_scheduler_file(): * if os.path.exists(fn): * os.remove(fn) # <<<<<<<<<<<<<< * * weakref.finalize(self, del_scheduler_file) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_v_fn)) { __Pyx_RaiseClosureNameError("fn"); __PYX_ERR(0, 3279, __pyx_L1_error) } __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_fn) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_fn); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3278 * * def del_scheduler_file(): * if os.path.exists(fn): # <<<<<<<<<<<<<< * os.remove(fn) * */ } /* "distributed/scheduler.py":3277 * fn = self.scheduler_file # remove file when we close the process * * def del_scheduler_file(): # <<<<<<<<<<<<<< * if os.path.exists(fn): * os.remove(fn) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.start.del_scheduler_file", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3232 * return ws.host, port * * async def start(self): # <<<<<<<<<<<<<< * """ Clear out old state and restart all running coroutines """ * await super().start() */ static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_10generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_t_17; Py_ssize_t __pyx_t_18; int __pyx_t_19; Py_ssize_t __pyx_t_20; Py_UCS4 __pyx_t_21; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L4_resume_from_await; case 2: goto __pyx_L23_resume_from_await; case 3: goto __pyx_L47_resume_from_await; case 4: goto __pyx_L50_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3232, __pyx_L1_error) /* "distributed/scheduler.py":3234 * async def start(self): * """ Clear out old state and restart all running coroutines """ * await super().start() # <<<<<<<<<<<<<< * assert self.status != Status.running * */ __pyx_t_2 = __pyx_generator->classobj; if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 3234, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_self); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3234, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3234, __pyx_L1_error) } } /* "distributed/scheduler.py":3235 * """ Clear out old state and restart all running coroutines """ * await super().start() * assert self.status != Status.running # <<<<<<<<<<<<<< * * enable_gc_diagnosis() */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_running); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 3235, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":3237 * assert self.status != Status.running * * enable_gc_diagnosis() # <<<<<<<<<<<<<< * * self.clear_task_state() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enable_gc_diagnosis); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3239 * enable_gc_diagnosis() * * self.clear_task_state() # <<<<<<<<<<<<<< * * with suppress(AttributeError): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_clear_task_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3241 * self.clear_task_state() * * with suppress(AttributeError): # <<<<<<<<<<<<<< * for c in self._worker_coroutines: * c.cancel() */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_suppress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_builtin_AttributeError) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_builtin_AttributeError); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3241, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3241, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "distributed/scheduler.py":3242 * * with suppress(AttributeError): * for c in self._worker_coroutines: # <<<<<<<<<<<<<< * c.cancel() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_worker_coroutines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3242, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3242, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3242, __pyx_L9_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 3242, __pyx_L9_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3242, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 3242, __pyx_L9_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3242, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3242, __pyx_L9_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3243 * with suppress(AttributeError): * for c in self._worker_coroutines: * c.cancel() # <<<<<<<<<<<<<< * * for addr in self._start_address: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_c, __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3243, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3243, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3242 * * with suppress(AttributeError): * for c in self._worker_coroutines: # <<<<<<<<<<<<<< * c.cancel() * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3241 * self.clear_task_state() * * with suppress(AttributeError): # <<<<<<<<<<<<<< * for c in self._worker_coroutines: * c.cancel() */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L14_try_end; __pyx_L9_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.start", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 3241, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3241, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3241, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_4 < 0) __PYX_ERR(0, 3241, __pyx_L11_except_error) __pyx_t_13 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; __PYX_ERR(0, 3241, __pyx_L11_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L10_exception_handled; } __pyx_L11_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L10_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L8; } __pyx_L8:; } goto __pyx_L20; __pyx_L5_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L20:; } /* "distributed/scheduler.py":3245 * c.cancel() * * for addr in self._start_address: # <<<<<<<<<<<<<< * await self.listen( * addr, */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_start_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3245, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 3245, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 3245, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3245, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_addr); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_addr, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3246 * * for addr in self._start_address: * await self.listen( # <<<<<<<<<<<<<< * addr, * allow_offload=False, */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_listen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":3247 * for addr in self._start_address: * await self.listen( * addr, # <<<<<<<<<<<<<< * allow_offload=False, * handshake_overrides={"pickle-protocol": 4, "compression": None}, */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_addr); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_addr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_addr); /* "distributed/scheduler.py":3248 * await self.listen( * addr, * allow_offload=False, # <<<<<<<<<<<<<< * handshake_overrides={"pickle-protocol": 4, "compression": None}, * **self.security.get_listen_args("scheduler"), */ __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_allow_offload, Py_False) < 0) __PYX_ERR(0, 3248, __pyx_L1_error) /* "distributed/scheduler.py":3249 * addr, * allow_offload=False, * handshake_overrides={"pickle-protocol": 4, "compression": None}, # <<<<<<<<<<<<<< * **self.security.get_listen_args("scheduler"), * ) */ __pyx_t_15 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_pickle_protocol, __pyx_int_4) < 0) __PYX_ERR(0, 3249, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_15, __pyx_n_u_compression, Py_None) < 0) __PYX_ERR(0, 3249, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_handshake_overrides, __pyx_t_15) < 0) __PYX_ERR(0, 3248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_6 = __pyx_t_14; __pyx_t_14 = 0; /* "distributed/scheduler.py":3250 * allow_offload=False, * handshake_overrides={"pickle-protocol": 4, "compression": None}, * **self.security.get_listen_args("scheduler"), # <<<<<<<<<<<<<< * ) * self.ip = get_address_host(self.listen_address) */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_security); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_get_listen_args); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_15, __pyx_n_u_scheduler) : __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_n_u_scheduler); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(__pyx_t_14 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(0, 3250, __pyx_L1_error) } if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_t_14) < 0) __PYX_ERR(0, 3250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3246 * * for addr in self._start_address: * await self.listen( # <<<<<<<<<<<<<< * addr, * allow_offload=False, */ __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __pyx_cur_scope->__pyx_t_1 = __pyx_t_10; __pyx_cur_scope->__pyx_t_2 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L23_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_10 = __pyx_cur_scope->__pyx_t_1; __pyx_t_11 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3246, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3246, __pyx_L1_error) } } /* "distributed/scheduler.py":3252 * **self.security.get_listen_args("scheduler"), * ) * self.ip = get_address_host(self.listen_address) # <<<<<<<<<<<<<< * listen_ip = self.ip * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_address_host); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_listen_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_14 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_ip, __pyx_t_14) < 0) __PYX_ERR(0, 3252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3253 * ) * self.ip = get_address_host(self.listen_address) * listen_ip = self.ip # <<<<<<<<<<<<<< * * if listen_ip == "0.0.0.0": */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_ip); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_listen_ip); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_listen_ip, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3255 * listen_ip = self.ip * * if listen_ip == "0.0.0.0": # <<<<<<<<<<<<<< * listen_ip = "" * */ __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_listen_ip, __pyx_kp_u_0_0_0_0, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 3255, __pyx_L1_error) if (__pyx_t_13) { /* "distributed/scheduler.py":3256 * * if listen_ip == "0.0.0.0": * listen_ip = "" # <<<<<<<<<<<<<< * * if self.address.startswith("inproc://"): */ __Pyx_INCREF(__pyx_kp_u__50); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_listen_ip); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_listen_ip, __pyx_kp_u__50); __Pyx_GIVEREF(__pyx_kp_u__50); /* "distributed/scheduler.py":3255 * listen_ip = self.ip * * if listen_ip == "0.0.0.0": # <<<<<<<<<<<<<< * listen_ip = "" * */ } /* "distributed/scheduler.py":3245 * c.cancel() * * for addr in self._start_address: # <<<<<<<<<<<<<< * await self.listen( * addr, */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3258 * listen_ip = "" * * if self.address.startswith("inproc://"): # <<<<<<<<<<<<<< * listen_ip = "localhost" * */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_startswith); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_3 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_kp_u_inproc) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_inproc); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 3258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_13) { /* "distributed/scheduler.py":3259 * * if self.address.startswith("inproc://"): * listen_ip = "localhost" # <<<<<<<<<<<<<< * * # Services listen on all addresses */ __Pyx_INCREF(__pyx_n_u_localhost); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_listen_ip); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_listen_ip, __pyx_n_u_localhost); __Pyx_GIVEREF(__pyx_n_u_localhost); /* "distributed/scheduler.py":3258 * listen_ip = "" * * if self.address.startswith("inproc://"): # <<<<<<<<<<<<<< * listen_ip = "localhost" * */ } /* "distributed/scheduler.py":3262 * * # Services listen on all addresses * self.start_services(listen_ip) # <<<<<<<<<<<<<< * * for listener in self.listeners: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_start_services); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(!__pyx_cur_scope->__pyx_v_listen_ip)) { __Pyx_RaiseUnboundLocalError("listen_ip"); __PYX_ERR(0, 3262, __pyx_L1_error) } __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_3 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_cur_scope->__pyx_v_listen_ip) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_listen_ip); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3264 * self.start_services(listen_ip) * * for listener in self.listeners: # <<<<<<<<<<<<<< * logger.info(" Scheduler at: %25s", listener.contact_address) * for k, v in self.services.items(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_listeners); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3264, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 3264, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 3264, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3264, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_listener); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_listener, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3265 * * for listener in self.listeners: * logger.info(" Scheduler at: %25s", listener.contact_address) # <<<<<<<<<<<<<< * for k, v in self.services.items(): * logger.info("%11s at: %25s", k, "%s:%d" % (listen_ip, v.port)) */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_listener, __pyx_n_s_contact_address); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = NULL; __pyx_t_17 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_17 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Scheduler_at_25s, __pyx_t_14}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3265, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Scheduler_at_25s, __pyx_t_14}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3265, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Scheduler_at_25s); __Pyx_GIVEREF(__pyx_kp_u_Scheduler_at_25s); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_17, __pyx_kp_u_Scheduler_at_25s); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_17, __pyx_t_14); __pyx_t_14 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3264 * self.start_services(listen_ip) * * for listener in self.listeners: # <<<<<<<<<<<<<< * logger.info(" Scheduler at: %25s", listener.contact_address) * for k, v in self.services.items(): */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3266 * for listener in self.listeners: * logger.info(" Scheduler at: %25s", listener.contact_address) * for k, v in self.services.items(): # <<<<<<<<<<<<<< * logger.info("%11s at: %25s", k, "%s:%d" % (listen_ip, v.port)) * */ __pyx_t_10 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_services); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_t_3 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3266, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_n_s_items, (&__pyx_t_18), (&__pyx_t_17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_19 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_18, &__pyx_t_10, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_17); if (unlikely(__pyx_t_19 == 0)) break; if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 3266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3267 * logger.info(" Scheduler at: %25s", listener.contact_address) * for k, v in self.services.items(): * logger.info("%11s at: %25s", k, "%s:%d" % (listen_ip, v.port)) # <<<<<<<<<<<<<< * * self.loop.add_callback(self.reevaluate_occupancy) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_20 = 0; __pyx_t_21 = 127; if (unlikely(!__pyx_cur_scope->__pyx_v_listen_ip)) { __Pyx_RaiseUnboundLocalError("listen_ip"); __PYX_ERR(0, 3267, __pyx_L1_error) } __pyx_t_14 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_v_listen_ip), __pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_21 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) > __pyx_t_21) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) : __pyx_t_21; __pyx_t_20 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_14); __pyx_t_14 = 0; __Pyx_INCREF(__pyx_kp_u__51); __pyx_t_20 += 1; __Pyx_GIVEREF(__pyx_kp_u__51); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__51); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_v, __pyx_n_s_port); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_14), __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_21 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_21) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_21; __pyx_t_20 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_20, __pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_19 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_19 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_11s_at_25s, __pyx_cur_scope->__pyx_v_k, __pyx_t_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_19, 3+__pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_11s_at_25s, __pyx_cur_scope->__pyx_v_k, __pyx_t_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_19, 3+__pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_14 = PyTuple_New(3+__pyx_t_19); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_11s_at_25s); __Pyx_GIVEREF(__pyx_kp_u_11s_at_25s); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_19, __pyx_kp_u_11s_at_25s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_k); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_19, __pyx_cur_scope->__pyx_v_k); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_19, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3269 * logger.info("%11s at: %25s", k, "%s:%d" % (listen_ip, v.port)) * * self.loop.add_callback(self.reevaluate_occupancy) # <<<<<<<<<<<<<< * * if self.scheduler_file: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add_callback); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_reevaluate_occupancy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_6 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_14, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_3); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3271 * self.loop.add_callback(self.reevaluate_occupancy) * * if self.scheduler_file: # <<<<<<<<<<<<<< * with open(self.scheduler_file, "w") as f: * json.dump(self.identity(), f, indent=2) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_scheduler_file); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 3271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_13) { /* "distributed/scheduler.py":3272 * * if self.scheduler_file: * with open(self.scheduler_file, "w") as f: # <<<<<<<<<<<<<< * json.dump(self.identity(), f, indent=2) * */ /*with:*/ { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_scheduler_file); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_6); __Pyx_INCREF(__pyx_n_u_w); __Pyx_GIVEREF(__pyx_n_u_w); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_u_w); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3272, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_16 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3272, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_16; __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_f = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":3273 * if self.scheduler_file: * with open(self.scheduler_file, "w") as f: * json.dump(self.identity(), f, indent=2) # <<<<<<<<<<<<<< * * fn = self.scheduler_file # remove file when we close the process */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_json); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3273, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dump); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3273, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_identity); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3273, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_3 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_16); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3273, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3273, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_f); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3273, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_indent, __pyx_int_2) < 0) __PYX_ERR(0, 3273, __pyx_L35_error) __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3273, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3272 * * if self.scheduler_file: * with open(self.scheduler_file, "w") as f: # <<<<<<<<<<<<<< * json.dump(self.identity(), f, indent=2) * */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L40_try_end; __pyx_L35_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.start", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_3, &__pyx_t_16) < 0) __PYX_ERR(0, 3272, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_16); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3272, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3272, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_13 < 0) __PYX_ERR(0, 3272, __pyx_L37_except_error) __pyx_t_4 = ((!(__pyx_t_13 != 0)) != 0); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_3, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_3 = 0; __pyx_t_16 = 0; __PYX_ERR(0, 3272, __pyx_L37_except_error) } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L36_exception_handled; } __pyx_L37_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); goto __pyx_L1_error; __pyx_L36_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); __pyx_L40_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } goto __pyx_L34; } __pyx_L34:; } goto __pyx_L44; __pyx_L31_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L44:; } /* "distributed/scheduler.py":3275 * json.dump(self.identity(), f, indent=2) * * fn = self.scheduler_file # remove file when we close the process # <<<<<<<<<<<<<< * * def del_scheduler_file(): */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_scheduler_file); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_v_fn = __pyx_t_16; __pyx_t_16 = 0; /* "distributed/scheduler.py":3277 * fn = self.scheduler_file # remove file when we close the process * * def del_scheduler_file(): # <<<<<<<<<<<<<< * if os.path.exists(fn): * os.remove(fn) */ __pyx_t_16 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_5start_1del_scheduler_file, 0, __pyx_n_s_Scheduler_start_locals_del_sched, ((PyObject*)__pyx_cur_scope), __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_v_del_scheduler_file = __pyx_t_16; __pyx_t_16 = 0; /* "distributed/scheduler.py":3281 * os.remove(fn) * * weakref.finalize(self, del_scheduler_file) # <<<<<<<<<<<<<< * * for preload in self.preloads: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_weakref); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_finalize); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_17 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_17 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_del_scheduler_file}; __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3281, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_16); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_del_scheduler_file}; __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3281, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_16); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_17, __pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_del_scheduler_file); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_del_scheduler_file); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_17, __pyx_cur_scope->__pyx_v_del_scheduler_file); __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_6, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":3271 * self.loop.add_callback(self.reevaluate_occupancy) * * if self.scheduler_file: # <<<<<<<<<<<<<< * with open(self.scheduler_file, "w") as f: * json.dump(self.identity(), f, indent=2) */ } /* "distributed/scheduler.py":3283 * weakref.finalize(self, del_scheduler_file) * * for preload in self.preloads: # <<<<<<<<<<<<<< * await preload.start() * */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_preloads); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (likely(PyList_CheckExact(__pyx_t_16)) || PyTuple_CheckExact(__pyx_t_16)) { __pyx_t_14 = __pyx_t_16; __Pyx_INCREF(__pyx_t_14); __pyx_t_18 = 0; __pyx_t_11 = NULL; } else { __pyx_t_18 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_16); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_11 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3283, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_14))) { if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_14)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_16 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_18); __Pyx_INCREF(__pyx_t_16); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 3283, __pyx_L1_error) #else __pyx_t_16 = PySequence_ITEM(__pyx_t_14, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); #endif } else { if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_14)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_18); __Pyx_INCREF(__pyx_t_16); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 3283, __pyx_L1_error) #else __pyx_t_16 = PySequence_ITEM(__pyx_t_14, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); #endif } } else { __pyx_t_16 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_16)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3283, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_16); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_preload); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_preload, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":3284 * * for preload in self.preloads: * await preload.start() # <<<<<<<<<<<<<< * * await asyncio.gather(*[plugin.start(self) for plugin in self.plugins]) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_preload, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_16 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_16); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __pyx_cur_scope->__pyx_t_2 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_14); __pyx_cur_scope->__pyx_t_0 = __pyx_t_14; __pyx_cur_scope->__pyx_t_1 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L47_resume_from_await:; __pyx_t_11 = __pyx_cur_scope->__pyx_t_2; __pyx_t_14 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_14); __pyx_t_18 = __pyx_cur_scope->__pyx_t_1; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3284, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3284, __pyx_L1_error) } } /* "distributed/scheduler.py":3283 * weakref.finalize(self, del_scheduler_file) * * for preload in self.preloads: # <<<<<<<<<<<<<< * await preload.start() * */ } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3286 * await preload.start() * * await asyncio.gather(*[plugin.start(self) for plugin in self.plugins]) # <<<<<<<<<<<<<< * * self.start_periodic_callbacks() */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_gather); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; { /* enter inner scope */ __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = 0; __pyx_t_11 = NULL; } else { __pyx_t_18 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3286, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 3286, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 3286, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3286, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr32__pyx_v_plugin); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr32__pyx_v_plugin, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr32__pyx_v_plugin, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_self); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_14, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __pyx_t_3 = PySequence_Tuple(__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L50_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3286, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3286, __pyx_L1_error) } } /* "distributed/scheduler.py":3288 * await asyncio.gather(*[plugin.start(self) for plugin in self.plugins]) * * self.start_periodic_callbacks() # <<<<<<<<<<<<<< * * setproctitle("dask-scheduler [%s]" % (self.address,)) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_start_periodic_callbacks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_14 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3290 * self.start_periodic_callbacks() * * setproctitle("dask-scheduler [%s]" % (self.address,)) # <<<<<<<<<<<<<< * return self * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_setproctitle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_18 = 0; __pyx_t_21 = 127; __Pyx_INCREF(__pyx_kp_u_dask_scheduler); __pyx_t_18 += 16; __Pyx_GIVEREF(__pyx_kp_u_dask_scheduler); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_kp_u_dask_scheduler); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_21 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_21) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_21; __pyx_t_18 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_kp_u__53); __pyx_t_18 += 1; __Pyx_GIVEREF(__pyx_kp_u__53); PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_kp_u__53); __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_16, 3, __pyx_t_18, __pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_14 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_16, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":3291 * * setproctitle("dask-scheduler [%s]" % (self.address,)) * return self # <<<<<<<<<<<<<< * * async def close(self, comm=None, fast=False, close_workers=False): */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_self); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":3232 * return ws.host, port * * async def start(self): # <<<<<<<<<<<<<< * """ Clear out old state and restart all running coroutines """ * await super().start() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("start", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_13generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":3293 * return self * * async def close(self, comm=None, fast=False, close_workers=False): # <<<<<<<<<<<<<< * """Send cleanup signal to all coroutines then wait until finished * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_12close(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_11close[] = "Send cleanup signal to all coroutines then wait until finished\n\n See Also\n --------\n Scheduler.cleanup\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_12close = {"close", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_12close, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_11close}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_12close(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_comm = 0; CYTHON_UNUSED PyObject *__pyx_v_fast = 0; PyObject *__pyx_v_close_workers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_fast,&__pyx_n_s_close_workers,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_False)); values[3] = ((PyObject *)((PyObject *)Py_False)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_workers); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "close") < 0)) __PYX_ERR(0, 3293, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_fast = values[2]; __pyx_v_close_workers = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("close", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3293, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.close", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_11close(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_fast, __pyx_v_close_workers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_11close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, CYTHON_UNUSED PyObject *__pyx_v_fast, PyObject *__pyx_v_close_workers) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_10_close(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_10_close, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 3293, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_fast = __pyx_v_fast; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fast); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fast); __pyx_cur_scope->__pyx_v_close_workers = __pyx_v_close_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_close_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_close_workers); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_13generator2, __pyx_codeobj__54, (PyObject *) __pyx_cur_scope, __pyx_n_s_close, __pyx_n_s_Scheduler_close, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); gen->classobj = __Pyx_CyFunction_GetClassObj(__pyx_self); __Pyx_INCREF(gen->classobj); __Pyx_GIVEREF(gen->classobj); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_13generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; long __pyx_t_12; Py_ssize_t __pyx_t_13; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *(*__pyx_t_20)(PyObject *); int __pyx_t_21; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L8_resume_from_await; case 2: goto __pyx_L11_resume_from_await; case 3: goto __pyx_L13_resume_from_await; case 4: goto __pyx_L19_resume_from_await; case 5: goto __pyx_L22_resume_from_await; case 6: goto __pyx_L70_resume_from_await; case 7: goto __pyx_L73_resume_from_await; case 8: goto __pyx_L74_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3293, __pyx_L1_error) /* "distributed/scheduler.py":3300 * Scheduler.cleanup * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if self.status in (Status.closing, Status.closed, Status.closing_gracefully): * await self.finished() */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3301 * """ * parent: SchedulerState = cast(SchedulerState, self) * if self.status in (Status.closing, Status.closed, Status.closing_gracefully): # <<<<<<<<<<<<<< * await self.finished() * return */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_closing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_closed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_closing_gracefully); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_5; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3302 * parent: SchedulerState = cast(SchedulerState, self) * if self.status in (Status.closing, Status.closed, Status.closing_gracefully): * await self.finished() # <<<<<<<<<<<<<< * return * self.status = Status.closing */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_finished); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L8_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3302, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3302, __pyx_L1_error) } } /* "distributed/scheduler.py":3303 * if self.status in (Status.closing, Status.closed, Status.closing_gracefully): * await self.finished() * return # <<<<<<<<<<<<<< * self.status = Status.closing * */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L0; /* "distributed/scheduler.py":3301 * """ * parent: SchedulerState = cast(SchedulerState, self) * if self.status in (Status.closing, Status.closed, Status.closing_gracefully): # <<<<<<<<<<<<<< * await self.finished() * return */ } /* "distributed/scheduler.py":3304 * await self.finished() * return * self.status = Status.closing # <<<<<<<<<<<<<< * * logger.info("Scheduler closing...") */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_closing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status, __pyx_t_3) < 0) __PYX_ERR(0, 3304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3306 * self.status = Status.closing * * logger.info("Scheduler closing...") # <<<<<<<<<<<<<< * setproctitle("dask-scheduler [closing]") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_kp_u_Scheduler_closing) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Scheduler_closing); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3307 * * logger.info("Scheduler closing...") * setproctitle("dask-scheduler [closing]") # <<<<<<<<<<<<<< * * for preload in self.preloads: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_setproctitle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_kp_u_dask_scheduler_closing) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_dask_scheduler_closing); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3309 * setproctitle("dask-scheduler [closing]") * * for preload in self.preloads: # <<<<<<<<<<<<<< * await preload.teardown() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_preloads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3309, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3309, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3309, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3309, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_preload); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_preload, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3310 * * for preload in self.preloads: * await preload.teardown() # <<<<<<<<<<<<<< * * if close_workers: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_preload, __pyx_n_s_teardown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L11_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3310, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3310, __pyx_L1_error) } } /* "distributed/scheduler.py":3309 * setproctitle("dask-scheduler [closing]") * * for preload in self.preloads: # <<<<<<<<<<<<<< * await preload.teardown() * */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3312 * await preload.teardown() * * if close_workers: # <<<<<<<<<<<<<< * await self.broadcast(msg={"op": "close_gracefully"}, nanny=True) * for worker in parent._workers: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_close_workers); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3312, __pyx_L1_error) if (__pyx_t_5) { /* "distributed/scheduler.py":3313 * * if close_workers: * await self.broadcast(msg={"op": "close_gracefully"}, nanny=True) # <<<<<<<<<<<<<< * for worker in parent._workers: * self.worker_send(worker, {"op": "close"}) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_op, __pyx_n_u_close_gracefully) < 0) __PYX_ERR(0, 3313, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_msg, __pyx_t_1) < 0) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nanny, Py_True) < 0) __PYX_ERR(0, 3313, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L13_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3313, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3313, __pyx_L1_error) } } /* "distributed/scheduler.py":3314 * if close_workers: * await self.broadcast(msg={"op": "close_gracefully"}, nanny=True) * for worker in parent._workers: # <<<<<<<<<<<<<< * self.worker_send(worker, {"op": "close"}) * for i in range(20): # wait a second for send signals to clear */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_parent->_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_parent->_workers)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_parent->_workers; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_parent->_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3314, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3314, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3314, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3314, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_worker, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3315 * await self.broadcast(msg={"op": "close_gracefully"}, nanny=True) * for worker in parent._workers: * self.worker_send(worker, {"op": "close"}) # <<<<<<<<<<<<<< * for i in range(20): # wait a second for send signals to clear * if parent._workers: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_worker_send); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_op, __pyx_n_u_close) < 0) __PYX_ERR(0, 3315, __pyx_L1_error) __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_worker, __pyx_t_8}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3315, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_worker, __pyx_t_8}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3315, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3314 * if close_workers: * await self.broadcast(msg={"op": "close_gracefully"}, nanny=True) * for worker in parent._workers: # <<<<<<<<<<<<<< * self.worker_send(worker, {"op": "close"}) * for i in range(20): # wait a second for send signals to clear */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3316 * for worker in parent._workers: * self.worker_send(worker, {"op": "close"}) * for i in range(20): # wait a second for send signals to clear # <<<<<<<<<<<<<< * if parent._workers: * await asyncio.sleep(0.05) */ for (__pyx_t_12 = 0; __pyx_t_12 < 20; __pyx_t_12+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_12; /* "distributed/scheduler.py":3317 * self.worker_send(worker, {"op": "close"}) * for i in range(20): # wait a second for send signals to clear * if parent._workers: # <<<<<<<<<<<<<< * await asyncio.sleep(0.05) * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_parent->_workers); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3317, __pyx_L1_error) if (__pyx_t_5) { /* "distributed/scheduler.py":3318 * for i in range(20): # wait a second for send signals to clear * if parent._workers: * await asyncio.sleep(0.05) # <<<<<<<<<<<<<< * else: * break */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sleep); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_float_0_05) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_float_0_05); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __pyx_cur_scope->__pyx_t_3 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L19_resume_from_await:; __pyx_t_12 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3318, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3318, __pyx_L1_error) } } /* "distributed/scheduler.py":3317 * self.worker_send(worker, {"op": "close"}) * for i in range(20): # wait a second for send signals to clear * if parent._workers: # <<<<<<<<<<<<<< * await asyncio.sleep(0.05) * else: */ goto __pyx_L18; } /* "distributed/scheduler.py":3320 * await asyncio.sleep(0.05) * else: * break # <<<<<<<<<<<<<< * * await asyncio.gather(*[plugin.close() for plugin in self.plugins]) */ /*else*/ { goto __pyx_L17_break; } __pyx_L18:; } __pyx_L17_break:; /* "distributed/scheduler.py":3312 * await preload.teardown() * * if close_workers: # <<<<<<<<<<<<<< * await self.broadcast(msg={"op": "close_gracefully"}, nanny=True) * for worker in parent._workers: */ } /* "distributed/scheduler.py":3322 * break * * await asyncio.gather(*[plugin.close() for plugin in self.plugins]) # <<<<<<<<<<<<<< * * for pc in self.periodic_callbacks.values(): */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_gather); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_11 = __pyx_t_3; __Pyx_INCREF(__pyx_t_11); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3322, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_11))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3322, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3322, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_7(__pyx_t_11); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3322, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr33__pyx_v_plugin); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr33__pyx_v_plugin, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr33__pyx_v_plugin, __pyx_n_s_close); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } /* exit inner scope */ __pyx_t_11 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L22_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3322, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3322, __pyx_L1_error) } } /* "distributed/scheduler.py":3324 * await asyncio.gather(*[plugin.close() for plugin in self.plugins]) * * for pc in self.periodic_callbacks.values(): # <<<<<<<<<<<<<< * pc.stop() * self.periodic_callbacks.clear() */ __pyx_t_6 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_periodic_callbacks); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (unlikely(__pyx_t_11 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 3324, __pyx_L1_error) } __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_11, 0, __pyx_n_s_values, (&__pyx_t_13), (&__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_13, &__pyx_t_6, NULL, &__pyx_t_4, NULL, __pyx_t_10); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 3324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pc); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pc, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3325 * * for pc in self.periodic_callbacks.values(): * pc.stop() # <<<<<<<<<<<<<< * self.periodic_callbacks.clear() * */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_pc, __pyx_n_s_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3326 * for pc in self.periodic_callbacks.values(): * pc.stop() * self.periodic_callbacks.clear() # <<<<<<<<<<<<<< * * self.stop_services() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_periodic_callbacks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_clear); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3328 * self.periodic_callbacks.clear() * * self.stop_services() # <<<<<<<<<<<<<< * * for ext in parent._extensions.values(): */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stop_services); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3330 * self.stop_services() * * for ext in parent._extensions.values(): # <<<<<<<<<<<<<< * with suppress(AttributeError): * ext.teardown() */ __pyx_t_13 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_extensions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 3330, __pyx_L1_error) } __pyx_t_11 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_extensions, 1, __pyx_n_s_values, (&__pyx_t_6), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_13, NULL, &__pyx_t_11, NULL, __pyx_t_10); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 3330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ext); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ext, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":3331 * * for ext in parent._extensions.values(): * with suppress(AttributeError): # <<<<<<<<<<<<<< * ext.teardown() * logger.info("Scheduler closing all comms") */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_suppress); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_builtin_AttributeError) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_builtin_AttributeError); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_11, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_11, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3331, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3331, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); /*try:*/ { /* "distributed/scheduler.py":3332 * for ext in parent._extensions.values(): * with suppress(AttributeError): * ext.teardown() # <<<<<<<<<<<<<< * logger.info("Scheduler closing all comms") * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ext, __pyx_n_s_teardown); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3332, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3332, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":3331 * * for ext in parent._extensions.values(): * with suppress(AttributeError): # <<<<<<<<<<<<<< * ext.teardown() * logger.info("Scheduler closing all comms") */ } __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L40_try_end; __pyx_L33_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.close", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 3331, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyTuple_Pack(3, __pyx_t_11, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3331, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 3331, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_19); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (__pyx_t_5 < 0) __PYX_ERR(0, 3331, __pyx_L35_except_error) __pyx_t_2 = ((!(__pyx_t_5 != 0)) != 0); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_11, __pyx_t_4, __pyx_t_3); __pyx_t_11 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 3331, __pyx_L35_except_error) } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L34_exception_handled; } __pyx_L35_except_error:; __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); goto __pyx_L1_error; __pyx_L34_exception_handled:; __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_L40_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_15) { __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } goto __pyx_L32; } __pyx_L32:; } goto __pyx_L44; __pyx_L27_error:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L1_error; __pyx_L44:; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3333 * with suppress(AttributeError): * ext.teardown() * logger.info("Scheduler closing all comms") # <<<<<<<<<<<<<< * * futures = [] */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_u_Scheduler_closing_all_comms) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Scheduler_closing_all_comms); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3335 * logger.info("Scheduler closing all comms") * * futures = [] # <<<<<<<<<<<<<< * for w, comm in list(self.stream_comms.items()): * if not comm.closed(): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_futures = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3336 * * futures = [] * for w, comm in list(self.stream_comms.items()): # <<<<<<<<<<<<<< * if not comm.closed(): * comm.send({"op": "close", "report": False}) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3336, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 3336, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_20(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L47_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_11 = __pyx_t_20(__pyx_t_8); if (unlikely(!__pyx_t_11)) goto __pyx_L47_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_8), 2) < 0) __PYX_ERR(0, 3336, __pyx_L1_error) __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L48_unpacking_done; __pyx_L47_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 3336, __pyx_L1_error) __pyx_L48_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_w, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_comm, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":3337 * futures = [] * for w, comm in list(self.stream_comms.items()): * if not comm.closed(): # <<<<<<<<<<<<<< * comm.send({"op": "close", "report": False}) * comm.send({"op": "close-stream"}) */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_closed); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = ((!__pyx_t_2) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3338 * for w, comm in list(self.stream_comms.items()): * if not comm.closed(): * comm.send({"op": "close", "report": False}) # <<<<<<<<<<<<<< * comm.send({"op": "close-stream"}) * with suppress(AttributeError): */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_send); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_op, __pyx_n_u_close) < 0) __PYX_ERR(0, 3338, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_report, Py_False) < 0) __PYX_ERR(0, 3338, __pyx_L1_error) __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3339 * if not comm.closed(): * comm.send({"op": "close", "report": False}) * comm.send({"op": "close-stream"}) # <<<<<<<<<<<<<< * with suppress(AttributeError): * futures.append(comm.close()) */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_send); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_op, __pyx_kp_u_close_stream) < 0) __PYX_ERR(0, 3339, __pyx_L1_error) __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3337 * futures = [] * for w, comm in list(self.stream_comms.items()): * if not comm.closed(): # <<<<<<<<<<<<<< * comm.send({"op": "close", "report": False}) * comm.send({"op": "close-stream"}) */ } /* "distributed/scheduler.py":3340 * comm.send({"op": "close", "report": False}) * comm.send({"op": "close-stream"}) * with suppress(AttributeError): # <<<<<<<<<<<<<< * futures.append(comm.close()) * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_suppress); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_4, __pyx_builtin_AttributeError) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_builtin_AttributeError); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3340, __pyx_L50_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_11 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3340, __pyx_L50_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_16); /*try:*/ { /* "distributed/scheduler.py":3341 * comm.send({"op": "close-stream"}) * with suppress(AttributeError): * futures.append(comm.close()) # <<<<<<<<<<<<<< * * for future in futures: # TODO: do all at once */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_close); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3341, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3341, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_21 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_futures, __pyx_t_3); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 3341, __pyx_L56_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3340 * comm.send({"op": "close", "report": False}) * comm.send({"op": "close-stream"}) * with suppress(AttributeError): # <<<<<<<<<<<<<< * futures.append(comm.close()) * */ } __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L63_try_end; __pyx_L56_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.close", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_11, &__pyx_t_4) < 0) __PYX_ERR(0, 3340, __pyx_L58_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3340, __pyx_L58_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 3340, __pyx_L58_except_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_19); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (__pyx_t_5 < 0) __PYX_ERR(0, 3340, __pyx_L58_except_error) __pyx_t_2 = ((!(__pyx_t_5 != 0)) != 0); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_11, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_11 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 3340, __pyx_L58_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L57_exception_handled; } __pyx_L58_except_error:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16); goto __pyx_L1_error; __pyx_L57_exception_handled:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16); __pyx_L63_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_15) { __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } goto __pyx_L55; } __pyx_L55:; } goto __pyx_L67; __pyx_L50_error:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L1_error; __pyx_L67:; } /* "distributed/scheduler.py":3336 * * futures = [] * for w, comm in list(self.stream_comms.items()): # <<<<<<<<<<<<<< * if not comm.closed(): * comm.send({"op": "close", "report": False}) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3343 * futures.append(comm.close()) * * for future in futures: # TODO: do all at once # <<<<<<<<<<<<<< * await future * */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_futures; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3343, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_future); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_future, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3344 * * for future in futures: # TODO: do all at once * await future # <<<<<<<<<<<<<< * * for comm in self.client_comms.values(): */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_future); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 6; return __pyx_r; __pyx_L70_resume_from_await:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3344, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3344, __pyx_L1_error) } } /* "distributed/scheduler.py":3343 * futures.append(comm.close()) * * for future in futures: # TODO: do all at once # <<<<<<<<<<<<<< * await future * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3346 * await future * * for comm in self.client_comms.values(): # <<<<<<<<<<<<<< * comm.abort() * */ __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_t_4 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 3346, __pyx_L1_error) } __pyx_t_11 = __Pyx_dict_iterator(__pyx_t_4, 0, __pyx_n_s_values, (&__pyx_t_13), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_13, &__pyx_t_6, NULL, &__pyx_t_11, NULL, __pyx_t_10); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 3346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_comm, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":3347 * * for comm in self.client_comms.values(): * comm.abort() # <<<<<<<<<<<<<< * * await self.rpc.close() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_abort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3349 * comm.abort() * * await self.rpc.close() # <<<<<<<<<<<<<< * * self.status = Status.closed */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 7; return __pyx_r; __pyx_L73_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3349, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3349, __pyx_L1_error) } } /* "distributed/scheduler.py":3351 * await self.rpc.close() * * self.status = Status.closed # <<<<<<<<<<<<<< * self.stop() * await super().close() */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_closed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status, __pyx_t_4) < 0) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3352 * * self.status = Status.closed * self.stop() # <<<<<<<<<<<<<< * await super().close() * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3353 * self.status = Status.closed * self.stop() * await super().close() # <<<<<<<<<<<<<< * * setproctitle("dask-scheduler [closed]") */ __pyx_t_1 = __pyx_generator->classobj; if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 3353, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_1); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_cur_scope->__pyx_v_self); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_close); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 8; return __pyx_r; __pyx_L74_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3353, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3353, __pyx_L1_error) } } /* "distributed/scheduler.py":3355 * await super().close() * * setproctitle("dask-scheduler [closed]") # <<<<<<<<<<<<<< * disable_gc_diagnosis() * */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_setproctitle); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_1, __pyx_kp_u_dask_scheduler_closed) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_kp_u_dask_scheduler_closed); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":3356 * * setproctitle("dask-scheduler [closed]") * disable_gc_diagnosis() # <<<<<<<<<<<<<< * * async def close_worker(self, comm=None, worker=None, safe=None): */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_disable_gc_diagnosis); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":3293 * return self * * async def close(self, comm=None, fast=False, close_workers=False): # <<<<<<<<<<<<<< * """Send cleanup signal to all coroutines then wait until finished * */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_16generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":3358 * disable_gc_diagnosis() * * async def close_worker(self, comm=None, worker=None, safe=None): # <<<<<<<<<<<<<< * """Remove a worker from the cluster * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_15close_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_14close_worker[] = "Remove a worker from the cluster\n\n This both removes the worker from our local state and also sends a\n signal to the worker to shut down. This works regardless of whether or\n not the worker has a nanny process restarting it\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_15close_worker = {"close_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_15close_worker, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_14close_worker}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_15close_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_safe = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_worker (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_worker,&__pyx_n_s_safe,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "close_worker") < 0)) __PYX_ERR(0, 3358, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_worker = values[2]; __pyx_v_safe = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("close_worker", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3358, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.close_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_14close_worker(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_worker, __pyx_v_safe); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_14close_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_worker, PyObject *__pyx_v_safe) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close_worker", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_11_close_worker(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_11_close_worker, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 3358, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_worker = __pyx_v_worker; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); __pyx_cur_scope->__pyx_v_safe = __pyx_v_safe; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_safe); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_safe); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_16generator3, __pyx_codeobj__55, (PyObject *) __pyx_cur_scope, __pyx_n_s_close_worker, __pyx_n_s_Scheduler_close_worker, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 3358, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.close_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_16generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_worker", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L16_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3358, __pyx_L1_error) /* "distributed/scheduler.py":3365 * not the worker has a nanny process restarting it * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * logger.info("Closing worker %s", worker) * with log_errors(): */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3366 * """ * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Closing worker %s", worker) # <<<<<<<<<<<<<< * with log_errors(): * self.log_event(worker, {"action": "close-worker"}) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Closing_worker_s, __pyx_cur_scope->__pyx_v_worker}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3366, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Closing_worker_s, __pyx_cur_scope->__pyx_v_worker}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3366, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Closing_worker_s); __Pyx_GIVEREF(__pyx_kp_u_Closing_worker_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_u_Closing_worker_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_worker); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3367 * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Closing worker %s", worker) * with log_errors(): # <<<<<<<<<<<<<< * self.log_event(worker, {"action": "close-worker"}) * ws: WorkerState = parent._workers[worker] */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3367, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3367, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "distributed/scheduler.py":3368 * logger.info("Closing worker %s", worker) * with log_errors(): * self.log_event(worker, {"action": "close-worker"}) # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers[worker] * nanny_addr = ws._nanny */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3368, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3368, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_action, __pyx_kp_u_close_worker_2) < 0) __PYX_ERR(0, 3368, __pyx_L8_error) __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_worker, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3368, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_worker, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3368, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3368, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3368, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3369 * with log_errors(): * self.log_event(worker, {"action": "close-worker"}) * ws: WorkerState = parent._workers[worker] # <<<<<<<<<<<<<< * nanny_addr = ws._nanny * address = nanny_addr or worker */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_workers, __pyx_cur_scope->__pyx_v_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3369, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 3369, __pyx_L8_error) __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3370 * self.log_event(worker, {"action": "close-worker"}) * ws: WorkerState = parent._workers[worker] * nanny_addr = ws._nanny # <<<<<<<<<<<<<< * address = nanny_addr or worker * */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_ws->_nanny; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_nanny_addr = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3371 * ws: WorkerState = parent._workers[worker] * nanny_addr = ws._nanny * address = nanny_addr or worker # <<<<<<<<<<<<<< * * self.worker_send(worker, {"op": "close", "report": False}) */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_nanny_addr); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3371, __pyx_L8_error) if (!__pyx_t_11) { } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nanny_addr); __pyx_t_1 = __pyx_cur_scope->__pyx_v_nanny_addr; goto __pyx_L14_bool_binop_done; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __pyx_t_1 = __pyx_cur_scope->__pyx_v_worker; __pyx_L14_bool_binop_done:; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_address = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":3373 * address = nanny_addr or worker * * self.worker_send(worker, {"op": "close", "report": False}) # <<<<<<<<<<<<<< * await self.remove_worker(address=worker, safe=safe) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_worker_send); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3373, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3373, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_op, __pyx_n_u_close) < 0) __PYX_ERR(0, 3373, __pyx_L8_error) if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_report, Py_False) < 0) __PYX_ERR(0, 3373, __pyx_L8_error) __pyx_t_5 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_worker, __pyx_t_10}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3373, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_worker, __pyx_t_10}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3373, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3373, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3373, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3374 * * self.worker_send(worker, {"op": "close", "report": False}) * await self.remove_worker(address=worker, safe=safe) # <<<<<<<<<<<<<< * * ########### */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3374, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3374, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_address, __pyx_cur_scope->__pyx_v_worker) < 0) __PYX_ERR(0, 3374, __pyx_L8_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_cur_scope->__pyx_v_safe) < 0) __PYX_ERR(0, 3374, __pyx_L8_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3374, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_3 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L16_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3374, __pyx_L8_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3374, __pyx_L8_error) } } /* "distributed/scheduler.py":3367 * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Closing worker %s", worker) * with log_errors(): # <<<<<<<<<<<<<< * self.log_event(worker, {"action": "close-worker"}) * ws: WorkerState = parent._workers[worker] */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.close_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 3367, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3367, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3367, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 3367, __pyx_L10_except_error) __pyx_t_13 = ((!(__pyx_t_11 != 0)) != 0); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; __PYX_ERR(0, 3367, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L20; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L20:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":3358 * disable_gc_diagnosis() * * async def close_worker(self, comm=None, worker=None, safe=None): # <<<<<<<<<<<<<< * """Remove a worker from the cluster * */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("close_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3380 * ########### * * def heartbeat_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_18heartbeat_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_18heartbeat_worker = {"heartbeat_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_18heartbeat_worker, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_18heartbeat_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_address = 0; PyObject *__pyx_v_resolve_address = 0; PyObject *__pyx_v_now = 0; PyObject *__pyx_v_resources = 0; PyObject *__pyx_v_host_info = 0; PyObject *__pyx_v_metrics = 0; PyObject *__pyx_v_executing = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("heartbeat_worker (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_address,&__pyx_n_s_resolve_address,&__pyx_n_s_now,&__pyx_n_s_resources,&__pyx_n_s_host_info,&__pyx_n_s_metrics,&__pyx_n_s_executing,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":3382 * def heartbeat_worker( * self, * comm=None, # <<<<<<<<<<<<<< * address=None, * resolve_address=True, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3383 * self, * comm=None, * address=None, # <<<<<<<<<<<<<< * resolve_address=True, * now=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3384 * comm=None, * address=None, * resolve_address=True, # <<<<<<<<<<<<<< * now=None, * resources=None, */ values[3] = ((PyObject *)((PyObject *)Py_True)); /* "distributed/scheduler.py":3385 * address=None, * resolve_address=True, * now=None, # <<<<<<<<<<<<<< * resources=None, * host_info=None, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3386 * resolve_address=True, * now=None, * resources=None, # <<<<<<<<<<<<<< * host_info=None, * metrics=None, */ values[5] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3387 * now=None, * resources=None, * host_info=None, # <<<<<<<<<<<<<< * metrics=None, * executing=None, */ values[6] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3388 * resources=None, * host_info=None, * metrics=None, # <<<<<<<<<<<<<< * executing=None, * ): */ values[7] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3389 * host_info=None, * metrics=None, * executing=None, # <<<<<<<<<<<<<< * ): * parent: SchedulerState = cast(SchedulerState, self) */ values[8] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_address); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resolve_address); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_now); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resources); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host_info); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metrics); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_executing); if (value) { values[8] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "heartbeat_worker") < 0)) __PYX_ERR(0, 3380, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_address = values[2]; __pyx_v_resolve_address = values[3]; __pyx_v_now = values[4]; __pyx_v_resources = values[5]; __pyx_v_host_info = values[6]; __pyx_v_metrics = values[7]; __pyx_v_executing = values[8]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("heartbeat_worker", 0, 1, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3380, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.heartbeat_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_17heartbeat_worker(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_address, __pyx_v_resolve_address, __pyx_v_now, __pyx_v_resources, __pyx_v_host_info, __pyx_v_metrics, __pyx_v_executing); /* "distributed/scheduler.py":3380 * ########### * * def heartbeat_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_17heartbeat_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_address, PyObject *__pyx_v_resolve_address, PyObject *__pyx_v_now, PyObject *__pyx_v_resources, PyObject *__pyx_v_host_info, PyObject *__pyx_v_metrics, PyObject *__pyx_v_executing) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_host = NULL; PyObject *__pyx_v_local_now = NULL; double __pyx_v_frac; PyObject *__pyx_v_other = NULL; PyObject *__pyx_v_bw = NULL; PyObject *__pyx_v_count = NULL; PyObject *__pyx_v_alpha = NULL; PyObject *__pyx_v_typ = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_delay = NULL; PyObject *__pyx_9genexpr34__pyx_v_key = NULL; PyObject *__pyx_9genexpr34__pyx_v_duration = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; double __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *(*__pyx_t_13)(PyObject *); PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("heartbeat_worker", 0); __Pyx_INCREF(__pyx_v_address); __Pyx_INCREF(__pyx_v_now); __Pyx_INCREF(__pyx_v_host_info); /* "distributed/scheduler.py":3391 * executing=None, * ): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * address = self.coerce_address(address, resolve_address) * address = normalize_address(address) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3392 * ): * parent: SchedulerState = cast(SchedulerState, self) * address = self.coerce_address(address, resolve_address) # <<<<<<<<<<<<<< * address = normalize_address(address) * if address not in parent._workers: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_address, __pyx_v_resolve_address}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3392, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_address, __pyx_v_resolve_address}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3392, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_address); __Pyx_GIVEREF(__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_address); __Pyx_INCREF(__pyx_v_resolve_address); __Pyx_GIVEREF(__pyx_v_resolve_address); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_resolve_address); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_address, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3393 * parent: SchedulerState = cast(SchedulerState, self) * address = self.coerce_address(address, resolve_address) * address = normalize_address(address) # <<<<<<<<<<<<<< * if address not in parent._workers: * return {"status": "missing"} */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_normalize_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_address); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_address, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3394 * address = self.coerce_address(address, resolve_address) * address = normalize_address(address) * if address not in parent._workers: # <<<<<<<<<<<<<< * return {"status": "missing"} * */ __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_address, __pyx_v_parent->_workers, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3394, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":3395 * address = normalize_address(address) * if address not in parent._workers: * return {"status": "missing"} # <<<<<<<<<<<<<< * * host = get_address_host(address) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_status, __pyx_n_u_missing) < 0) __PYX_ERR(0, 3395, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":3394 * address = self.coerce_address(address, resolve_address) * address = normalize_address(address) * if address not in parent._workers: # <<<<<<<<<<<<<< * return {"status": "missing"} * */ } /* "distributed/scheduler.py":3397 * return {"status": "missing"} * * host = get_address_host(address) # <<<<<<<<<<<<<< * local_now = time() * now = now or time() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_address_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_address); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_host = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":3398 * * host = get_address_host(address) * local_now = time() # <<<<<<<<<<<<<< * now = now or time() * assert metrics */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_local_now = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":3399 * host = get_address_host(address) * local_now = time() * now = now or time() # <<<<<<<<<<<<<< * assert metrics * host_info = host_info or {} */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_now); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3399, __pyx_L1_error) if (!__pyx_t_7) { } else { __Pyx_INCREF(__pyx_v_now); __pyx_t_1 = __pyx_v_now; goto __pyx_L4_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_L4_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_now, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3400 * local_now = time() * now = now or time() * assert metrics # <<<<<<<<<<<<<< * host_info = host_info or {} * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_metrics); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3400, __pyx_L1_error) if (unlikely(!__pyx_t_7)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 3400, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":3401 * now = now or time() * assert metrics * host_info = host_info or {} # <<<<<<<<<<<<<< * * parent._host_info[host]["last-seen"] = local_now */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_host_info); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3401, __pyx_L1_error) if (!__pyx_t_7) { } else { __Pyx_INCREF(__pyx_v_host_info); __pyx_t_1 = __pyx_v_host_info; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_L6_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_host_info, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3403 * host_info = host_info or {} * * parent._host_info[host]["last-seen"] = local_now # <<<<<<<<<<<<<< * frac = 1 / len(parent._workers) * parent._bandwidth = ( */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_parent->_host_info, __pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_kp_u_last_seen_2, __pyx_v_local_now) < 0)) __PYX_ERR(0, 3403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3404 * * parent._host_info[host]["last-seen"] = local_now * frac = 1 / len(parent._workers) # <<<<<<<<<<<<<< * parent._bandwidth = ( * parent._bandwidth * (1 - frac) + metrics["bandwidth"]["total"] * frac */ __pyx_t_1 = __pyx_v_parent->_workers; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_8 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 3404, __pyx_L1_error) } __pyx_v_frac = (1.0 / ((double)__pyx_t_8)); /* "distributed/scheduler.py":3406 * frac = 1 / len(parent._workers) * parent._bandwidth = ( * parent._bandwidth * (1 - frac) + metrics["bandwidth"]["total"] * frac # <<<<<<<<<<<<<< * ) * for other, (bw, count) in metrics["bandwidth"]["workers"].items(): */ __pyx_t_1 = PyFloat_FromDouble((__pyx_v_parent->_bandwidth * (1.0 - __pyx_v_frac))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_metrics, __pyx_n_u_bandwidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_total); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_frac); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3405 * parent._host_info[host]["last-seen"] = local_now * frac = 1 / len(parent._workers) * parent._bandwidth = ( # <<<<<<<<<<<<<< * parent._bandwidth * (1 - frac) + metrics["bandwidth"]["total"] * frac * ) */ __pyx_v_parent->_bandwidth = __pyx_t_9; /* "distributed/scheduler.py":3408 * parent._bandwidth * (1 - frac) + metrics["bandwidth"]["total"] * frac * ) * for other, (bw, count) in metrics["bandwidth"]["workers"].items(): # <<<<<<<<<<<<<< * if (address, other) not in self.bandwidth_workers: * self.bandwidth_workers[address, other] = bw / count */ __pyx_t_8 = 0; __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_metrics, __pyx_n_u_bandwidth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_1 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3408, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_10, &__pyx_t_8, &__pyx_t_3, &__pyx_t_1, NULL, __pyx_t_4); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 3408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 3408, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 3408, __pyx_L1_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 3408, __pyx_L1_error) __pyx_L11_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_bw, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3409 * ) * for other, (bw, count) in metrics["bandwidth"]["workers"].items(): * if (address, other) not in self.bandwidth_workers: # <<<<<<<<<<<<<< * self.bandwidth_workers[address, other] = bw / count * else: */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_address); __Pyx_GIVEREF(__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_address); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_other); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_workers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":3410 * for other, (bw, count) in metrics["bandwidth"]["workers"].items(): * if (address, other) not in self.bandwidth_workers: * self.bandwidth_workers[address, other] = bw / count # <<<<<<<<<<<<<< * else: * alpha = (1 - frac) ** count */ __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_bw, __pyx_v_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_address); __Pyx_GIVEREF(__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_address); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_5) < 0)) __PYX_ERR(0, 3410, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3409 * ) * for other, (bw, count) in metrics["bandwidth"]["workers"].items(): * if (address, other) not in self.bandwidth_workers: # <<<<<<<<<<<<<< * self.bandwidth_workers[address, other] = bw / count * else: */ goto __pyx_L12; } /* "distributed/scheduler.py":3412 * self.bandwidth_workers[address, other] = bw / count * else: * alpha = (1 - frac) ** count # <<<<<<<<<<<<<< * self.bandwidth_workers[address, other] = self.bandwidth_workers[ * address, other */ /*else*/ { __pyx_t_5 = PyFloat_FromDouble((1.0 - __pyx_v_frac)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_v_count, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_alpha, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3413 * else: * alpha = (1 - frac) ** count * self.bandwidth_workers[address, other] = self.bandwidth_workers[ # <<<<<<<<<<<<<< * address, other * ] * alpha + bw * (1 - alpha) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":3414 * alpha = (1 - frac) ** count * self.bandwidth_workers[address, other] = self.bandwidth_workers[ * address, other # <<<<<<<<<<<<<< * ] * alpha + bw * (1 - alpha) * for typ, (bw, count) in metrics["bandwidth"]["types"].items(): */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_address); __Pyx_GIVEREF(__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_address); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); /* "distributed/scheduler.py":3413 * else: * alpha = (1 - frac) ** count * self.bandwidth_workers[address, other] = self.bandwidth_workers[ # <<<<<<<<<<<<<< * address, other * ] * alpha + bw * (1 - alpha) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3415 * self.bandwidth_workers[address, other] = self.bandwidth_workers[ * address, other * ] * alpha + bw * (1 - alpha) # <<<<<<<<<<<<<< * for typ, (bw, count) in metrics["bandwidth"]["types"].items(): * if typ not in self.bandwidth_types: */ __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_v_alpha); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_alpha, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Multiply(__pyx_v_bw, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3413 * else: * alpha = (1 - frac) ** count * self.bandwidth_workers[address, other] = self.bandwidth_workers[ # <<<<<<<<<<<<<< * address, other * ] * alpha + bw * (1 - alpha) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_address); __Pyx_GIVEREF(__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_address); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 3413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L12:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3416 * address, other * ] * alpha + bw * (1 - alpha) * for typ, (bw, count) in metrics["bandwidth"]["types"].items(): # <<<<<<<<<<<<<< * if typ not in self.bandwidth_types: * self.bandwidth_types[typ] = bw / count */ __pyx_t_10 = 0; __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_metrics, __pyx_n_u_bandwidth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_5 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3416, __pyx_L1_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_10, &__pyx_t_1, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_typ, __pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 3416, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 3416, __pyx_L1_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 3416, __pyx_L1_error) __pyx_L16_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_bw, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3417 * ] * alpha + bw * (1 - alpha) * for typ, (bw, count) in metrics["bandwidth"]["types"].items(): * if typ not in self.bandwidth_types: # <<<<<<<<<<<<<< * self.bandwidth_types[typ] = bw / count * else: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_typ, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":3418 * for typ, (bw, count) in metrics["bandwidth"]["types"].items(): * if typ not in self.bandwidth_types: * self.bandwidth_types[typ] = bw / count # <<<<<<<<<<<<<< * else: * alpha = (1 - frac) ** count */ __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_bw, __pyx_v_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_typ, __pyx_t_5) < 0)) __PYX_ERR(0, 3418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3417 * ] * alpha + bw * (1 - alpha) * for typ, (bw, count) in metrics["bandwidth"]["types"].items(): * if typ not in self.bandwidth_types: # <<<<<<<<<<<<<< * self.bandwidth_types[typ] = bw / count * else: */ goto __pyx_L17; } /* "distributed/scheduler.py":3420 * self.bandwidth_types[typ] = bw / count * else: * alpha = (1 - frac) ** count # <<<<<<<<<<<<<< * self.bandwidth_types[typ] = self.bandwidth_types[typ] * alpha + bw * ( * 1 - alpha */ /*else*/ { __pyx_t_5 = PyFloat_FromDouble((1.0 - __pyx_v_frac)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_v_count, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_alpha, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3421 * else: * alpha = (1 - frac) ** count * self.bandwidth_types[typ] = self.bandwidth_types[typ] * alpha + bw * ( # <<<<<<<<<<<<<< * 1 - alpha * ) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_typ); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_v_alpha); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3422 * alpha = (1 - frac) ** count * self.bandwidth_types[typ] = self.bandwidth_types[typ] * alpha + bw * ( * 1 - alpha # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_alpha, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":3421 * else: * alpha = (1 - frac) ** count * self.bandwidth_types[typ] = self.bandwidth_types[typ] * alpha + bw * ( # <<<<<<<<<<<<<< * 1 - alpha * ) */ __pyx_t_1 = PyNumber_Multiply(__pyx_v_bw, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bandwidth_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_typ, __pyx_t_5) < 0)) __PYX_ERR(0, 3421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L17:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3425 * ) * * ws: WorkerState = parent._workers[address] # <<<<<<<<<<<<<< * * ws._last_seen = time() */ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_parent->_workers, __pyx_v_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 3425, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3427 * ws: WorkerState = parent._workers[address] * * ws._last_seen = time() # <<<<<<<<<<<<<< * * if executing is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ws->_last_seen = __pyx_t_9; /* "distributed/scheduler.py":3429 * ws._last_seen = time() * * if executing is not None: # <<<<<<<<<<<<<< * ws._executing = { * parent._tasks[key]: duration for key, duration in executing.items() */ __pyx_t_7 = (__pyx_v_executing != Py_None); __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":3430 * * if executing is not None: * ws._executing = { # <<<<<<<<<<<<<< * parent._tasks[key]: duration for key, duration in executing.items() * } */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3430, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":3431 * if executing is not None: * ws._executing = { * parent._tasks[key]: duration for key, duration in executing.items() # <<<<<<<<<<<<<< * } * */ __pyx_t_8 = 0; if (unlikely(__pyx_v_executing == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3431, __pyx_L21_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_executing, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3431, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_10, &__pyx_t_8, &__pyx_t_1, &__pyx_t_3, NULL, __pyx_t_4); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 3431, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_duration, __pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3431, __pyx_L21_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_9genexpr34__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3431, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_3, (PyObject*)__pyx_9genexpr34__pyx_v_duration))) __PYX_ERR(0, 3431, __pyx_L21_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_duration); __pyx_9genexpr34__pyx_v_duration = 0; __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_key); __pyx_9genexpr34__pyx_v_key = 0; goto __pyx_L24_exit_scope; __pyx_L21_error:; __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_duration); __pyx_9genexpr34__pyx_v_duration = 0; __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_key); __pyx_9genexpr34__pyx_v_key = 0; goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ /* "distributed/scheduler.py":3430 * * if executing is not None: * ws._executing = { # <<<<<<<<<<<<<< * parent._tasks[key]: duration for key, duration in executing.items() * } */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_ws->_executing); __Pyx_DECREF(__pyx_v_ws->_executing); __pyx_v_ws->_executing = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3429 * ws._last_seen = time() * * if executing is not None: # <<<<<<<<<<<<<< * ws._executing = { * parent._tasks[key]: duration for key, duration in executing.items() */ } /* "distributed/scheduler.py":3434 * } * * if metrics: # <<<<<<<<<<<<<< * ws._metrics = metrics * */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_metrics); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3434, __pyx_L1_error) if (__pyx_t_6) { /* "distributed/scheduler.py":3435 * * if metrics: * ws._metrics = metrics # <<<<<<<<<<<<<< * * if host_info: */ if (!(likely(PyDict_CheckExact(__pyx_v_metrics))||((__pyx_v_metrics) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_metrics)->tp_name), 0))) __PYX_ERR(0, 3435, __pyx_L1_error) __pyx_t_2 = __pyx_v_metrics; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_ws->_metrics); __Pyx_DECREF(__pyx_v_ws->_metrics); __pyx_v_ws->_metrics = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3434 * } * * if metrics: # <<<<<<<<<<<<<< * ws._metrics = metrics * */ } /* "distributed/scheduler.py":3437 * ws._metrics = metrics * * if host_info: # <<<<<<<<<<<<<< * parent._host_info[host].update(host_info) * */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_host_info); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3437, __pyx_L1_error) if (__pyx_t_6) { /* "distributed/scheduler.py":3438 * * if host_info: * parent._host_info[host].update(host_info) # <<<<<<<<<<<<<< * * delay = time() - now */ __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_parent->_host_info, __pyx_v_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_host_info) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_host_info); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3437 * ws._metrics = metrics * * if host_info: # <<<<<<<<<<<<<< * parent._host_info[host].update(host_info) * */ } /* "distributed/scheduler.py":3440 * parent._host_info[host].update(host_info) * * delay = time() - now # <<<<<<<<<<<<<< * ws._time_delay = delay * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_v_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_delay = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":3441 * * delay = time() - now * ws._time_delay = delay # <<<<<<<<<<<<<< * * if resources: */ __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_delay); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3441, __pyx_L1_error) __pyx_v_ws->_time_delay = __pyx_t_9; /* "distributed/scheduler.py":3443 * ws._time_delay = delay * * if resources: # <<<<<<<<<<<<<< * self.add_resources(worker=address, resources=resources) * */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_resources); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3443, __pyx_L1_error) if (__pyx_t_6) { /* "distributed/scheduler.py":3444 * * if resources: * self.add_resources(worker=address, resources=resources) # <<<<<<<<<<<<<< * * self.log_event(address, merge({"action": "heartbeat"}, metrics)) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_resources); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_worker, __pyx_v_address) < 0) __PYX_ERR(0, 3444, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_resources, __pyx_v_resources) < 0) __PYX_ERR(0, 3444, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3443 * ws._time_delay = delay * * if resources: # <<<<<<<<<<<<<< * self.add_resources(worker=address, resources=resources) * */ } /* "distributed/scheduler.py":3446 * self.add_resources(worker=address, resources=resources) * * self.log_event(address, merge({"action": "heartbeat"}, metrics)) # <<<<<<<<<<<<<< * * return { */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_merge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_action, __pyx_n_u_heartbeat) < 0) __PYX_ERR(0, 3446, __pyx_L1_error) __pyx_t_14 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_12, __pyx_v_metrics}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_12, __pyx_v_metrics}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_v_metrics); __Pyx_GIVEREF(__pyx_v_metrics); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_4, __pyx_v_metrics); __pyx_t_12 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_address, __pyx_t_3}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_address, __pyx_t_3}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_address); __Pyx_GIVEREF(__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_4, __pyx_v_address); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_4, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3448 * self.log_event(address, merge({"action": "heartbeat"}, metrics)) * * return { # <<<<<<<<<<<<<< * "status": "OK", * "time": time(), */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":3449 * * return { * "status": "OK", # <<<<<<<<<<<<<< * "time": time(), * "heartbeat-interval": heartbeat_interval(len(parent._workers)), */ __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_status, __pyx_n_u_OK) < 0) __PYX_ERR(0, 3449, __pyx_L1_error) /* "distributed/scheduler.py":3450 * return { * "status": "OK", * "time": time(), # <<<<<<<<<<<<<< * "heartbeat-interval": heartbeat_interval(len(parent._workers)), * } */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_time); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_15); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_time, __pyx_t_2) < 0) __PYX_ERR(0, 3449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3451 * "status": "OK", * "time": time(), * "heartbeat-interval": heartbeat_interval(len(parent._workers)), # <<<<<<<<<<<<<< * } * */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_heartbeat_interval_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_3 = __pyx_v_parent->_workers; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_heartbeat_interval, __pyx_t_2) < 0) __PYX_ERR(0, 3449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "distributed/scheduler.py":3380 * ########### * * def heartbeat_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("distributed.scheduler.Scheduler.heartbeat_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_host); __Pyx_XDECREF(__pyx_v_local_now); __Pyx_XDECREF(__pyx_v_other); __Pyx_XDECREF(__pyx_v_bw); __Pyx_XDECREF(__pyx_v_count); __Pyx_XDECREF(__pyx_v_alpha); __Pyx_XDECREF(__pyx_v_typ); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_delay); __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_key); __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_duration); __Pyx_XDECREF(__pyx_v_address); __Pyx_XDECREF(__pyx_v_now); __Pyx_XDECREF(__pyx_v_host_info); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_21generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":3454 * } * * async def add_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_20add_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_19add_worker[] = " Add a new worker to the cluster "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_20add_worker = {"add_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_20add_worker, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_19add_worker}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_20add_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_address = 0; CYTHON_UNUSED PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_nthreads = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_resolve_address = 0; PyObject *__pyx_v_nbytes = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_now = 0; PyObject *__pyx_v_resources = 0; PyObject *__pyx_v_host_info = 0; PyObject *__pyx_v_memory_limit = 0; PyObject *__pyx_v_metrics = 0; PyObject *__pyx_v_pid = 0; PyObject *__pyx_v_services = 0; PyObject *__pyx_v_local_directory = 0; PyObject *__pyx_v_versions = 0; PyObject *__pyx_v_nanny = 0; PyObject *__pyx_v_extra = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_worker (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_address,&__pyx_n_s_keys,&__pyx_n_s_nthreads,&__pyx_n_s_name,&__pyx_n_s_resolve_address,&__pyx_n_s_nbytes,&__pyx_n_s_types,&__pyx_n_s_now,&__pyx_n_s_resources,&__pyx_n_s_host_info,&__pyx_n_s_memory_limit,&__pyx_n_s_metrics,&__pyx_n_s_pid,&__pyx_n_s_services,&__pyx_n_s_local_directory,&__pyx_n_s_versions,&__pyx_n_s_nanny,&__pyx_n_s_extra,0}; PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":3456 * async def add_worker( * self, * comm=None, # <<<<<<<<<<<<<< * address=None, * keys=(), */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3457 * self, * comm=None, * address=None, # <<<<<<<<<<<<<< * keys=(), * nthreads=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3458 * comm=None, * address=None, * keys=(), # <<<<<<<<<<<<<< * nthreads=None, * name=None, */ values[3] = ((PyObject *)((PyObject*)__pyx_empty_tuple)); /* "distributed/scheduler.py":3459 * address=None, * keys=(), * nthreads=None, # <<<<<<<<<<<<<< * name=None, * resolve_address=True, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3460 * keys=(), * nthreads=None, * name=None, # <<<<<<<<<<<<<< * resolve_address=True, * nbytes=None, */ values[5] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3461 * nthreads=None, * name=None, * resolve_address=True, # <<<<<<<<<<<<<< * nbytes=None, * types=None, */ values[6] = ((PyObject *)((PyObject *)Py_True)); /* "distributed/scheduler.py":3462 * name=None, * resolve_address=True, * nbytes=None, # <<<<<<<<<<<<<< * types=None, * now=None, */ values[7] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3463 * resolve_address=True, * nbytes=None, * types=None, # <<<<<<<<<<<<<< * now=None, * resources=None, */ values[8] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3464 * nbytes=None, * types=None, * now=None, # <<<<<<<<<<<<<< * resources=None, * host_info=None, */ values[9] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3465 * types=None, * now=None, * resources=None, # <<<<<<<<<<<<<< * host_info=None, * memory_limit=None, */ values[10] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3466 * now=None, * resources=None, * host_info=None, # <<<<<<<<<<<<<< * memory_limit=None, * metrics=None, */ values[11] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3467 * resources=None, * host_info=None, * memory_limit=None, # <<<<<<<<<<<<<< * metrics=None, * pid=0, */ values[12] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3468 * host_info=None, * memory_limit=None, * metrics=None, # <<<<<<<<<<<<<< * pid=0, * services=None, */ values[13] = ((PyObject *)((PyObject *)Py_None)); values[14] = ((PyObject *)((PyObject *)__pyx_int_0)); /* "distributed/scheduler.py":3470 * metrics=None, * pid=0, * services=None, # <<<<<<<<<<<<<< * local_directory=None, * versions=None, */ values[15] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3471 * pid=0, * services=None, * local_directory=None, # <<<<<<<<<<<<<< * versions=None, * nanny=None, */ values[16] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3472 * services=None, * local_directory=None, * versions=None, # <<<<<<<<<<<<<< * nanny=None, * extra=None, */ values[17] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3473 * local_directory=None, * versions=None, * nanny=None, # <<<<<<<<<<<<<< * extra=None, * ): */ values[18] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3474 * versions=None, * nanny=None, * extra=None, # <<<<<<<<<<<<<< * ): * """ Add a new worker to the cluster """ */ values[19] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19); CYTHON_FALLTHROUGH; case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); CYTHON_FALLTHROUGH; case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); CYTHON_FALLTHROUGH; case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); CYTHON_FALLTHROUGH; case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); CYTHON_FALLTHROUGH; case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_address); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nthreads); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resolve_address); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_types); if (value) { values[8] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_now); if (value) { values[9] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resources); if (value) { values[10] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host_info); if (value) { values[11] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_limit); if (value) { values[12] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metrics); if (value) { values[13] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid); if (value) { values[14] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 15: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_services); if (value) { values[15] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 16: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local_directory); if (value) { values[16] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 17: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_versions); if (value) { values[17] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 18: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nanny); if (value) { values[18] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 19: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extra); if (value) { values[19] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_worker") < 0)) __PYX_ERR(0, 3454, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19); CYTHON_FALLTHROUGH; case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); CYTHON_FALLTHROUGH; case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); CYTHON_FALLTHROUGH; case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); CYTHON_FALLTHROUGH; case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); CYTHON_FALLTHROUGH; case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_address = values[2]; __pyx_v_keys = values[3]; __pyx_v_nthreads = values[4]; __pyx_v_name = values[5]; __pyx_v_resolve_address = values[6]; __pyx_v_nbytes = values[7]; __pyx_v_types = values[8]; __pyx_v_now = values[9]; __pyx_v_resources = values[10]; __pyx_v_host_info = values[11]; __pyx_v_memory_limit = values[12]; __pyx_v_metrics = values[13]; __pyx_v_pid = values[14]; __pyx_v_services = values[15]; __pyx_v_local_directory = values[16]; __pyx_v_versions = values[17]; __pyx_v_nanny = values[18]; __pyx_v_extra = values[19]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_worker", 0, 1, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3454, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_19add_worker(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_address, __pyx_v_keys, __pyx_v_nthreads, __pyx_v_name, __pyx_v_resolve_address, __pyx_v_nbytes, __pyx_v_types, __pyx_v_now, __pyx_v_resources, __pyx_v_host_info, __pyx_v_memory_limit, __pyx_v_metrics, __pyx_v_pid, __pyx_v_services, __pyx_v_local_directory, __pyx_v_versions, __pyx_v_nanny, __pyx_v_extra); /* "distributed/scheduler.py":3454 * } * * async def add_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_19add_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_address, CYTHON_UNUSED PyObject *__pyx_v_keys, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_name, PyObject *__pyx_v_resolve_address, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_types, PyObject *__pyx_v_now, PyObject *__pyx_v_resources, PyObject *__pyx_v_host_info, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_metrics, PyObject *__pyx_v_pid, PyObject *__pyx_v_services, PyObject *__pyx_v_local_directory, PyObject *__pyx_v_versions, PyObject *__pyx_v_nanny, PyObject *__pyx_v_extra) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_worker", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_12_add_worker(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_12_add_worker, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 3454, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_address = __pyx_v_address; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_address); __pyx_cur_scope->__pyx_v_keys = __pyx_v_keys; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys); __pyx_cur_scope->__pyx_v_nthreads = __pyx_v_nthreads; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nthreads); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nthreads); __pyx_cur_scope->__pyx_v_name = __pyx_v_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name); __pyx_cur_scope->__pyx_v_resolve_address = __pyx_v_resolve_address; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resolve_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resolve_address); __pyx_cur_scope->__pyx_v_nbytes = __pyx_v_nbytes; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nbytes); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nbytes); __pyx_cur_scope->__pyx_v_types = __pyx_v_types; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_types); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_types); __pyx_cur_scope->__pyx_v_now = __pyx_v_now; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_now); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_now); __pyx_cur_scope->__pyx_v_resources = __pyx_v_resources; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resources); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resources); __pyx_cur_scope->__pyx_v_host_info = __pyx_v_host_info; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_host_info); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_host_info); __pyx_cur_scope->__pyx_v_memory_limit = __pyx_v_memory_limit; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_memory_limit); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_memory_limit); __pyx_cur_scope->__pyx_v_metrics = __pyx_v_metrics; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_metrics); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_metrics); __pyx_cur_scope->__pyx_v_pid = __pyx_v_pid; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pid); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pid); __pyx_cur_scope->__pyx_v_services = __pyx_v_services; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_services); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_services); __pyx_cur_scope->__pyx_v_local_directory = __pyx_v_local_directory; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_local_directory); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_local_directory); __pyx_cur_scope->__pyx_v_versions = __pyx_v_versions; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions); __pyx_cur_scope->__pyx_v_nanny = __pyx_v_nanny; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nanny); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nanny); __pyx_cur_scope->__pyx_v_extra = __pyx_v_extra; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_extra); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_extra); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_21generator4, __pyx_codeobj__56, (PyObject *) __pyx_cur_scope, __pyx_n_s_add_worker, __pyx_n_s_Scheduler_add_worker, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 3454, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_21generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; Py_ssize_t __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_t_21; char const *__pyx_t_22; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; int __pyx_t_29; int __pyx_t_30; Py_ssize_t __pyx_t_31; PyObject *__pyx_t_32 = NULL; PyObject *__pyx_t_33 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_worker", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L17_resume_from_await; case 2: goto __pyx_L33_resume_from_await; case 3: goto __pyx_L65_resume_from_await; case 4: goto __pyx_L66_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3454, __pyx_L1_error) /* "distributed/scheduler.py":3477 * ): * """ Add a new worker to the cluster """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * with log_errors(): * address = self.coerce_address(address, resolve_address) */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3478 * """ Add a new worker to the cluster """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * address = self.coerce_address(address, resolve_address) * address = normalize_address(address) */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3478, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3478, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":3479 * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): * address = self.coerce_address(address, resolve_address) # <<<<<<<<<<<<<< * address = normalize_address(address) * host = get_address_host(address) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3479, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_address, __pyx_cur_scope->__pyx_v_resolve_address}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3479, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_address, __pyx_cur_scope->__pyx_v_resolve_address}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3479, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3479, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_cur_scope->__pyx_v_address); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resolve_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resolve_address); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_cur_scope->__pyx_v_resolve_address); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3479, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_address); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_address, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3480 * with log_errors(): * address = self.coerce_address(address, resolve_address) * address = normalize_address(address) # <<<<<<<<<<<<<< * host = get_address_host(address) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_normalize_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3480, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3480, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_address); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_address, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3481 * address = self.coerce_address(address, resolve_address) * address = normalize_address(address) * host = get_address_host(address) # <<<<<<<<<<<<<< * * ws: WorkerState = parent._workers.get(address) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_address_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3481, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3481, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_host = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":3483 * host = get_address_host(address) * * ws: WorkerState = parent._workers.get(address) # <<<<<<<<<<<<<< * if ws is not None: * raise ValueError("Worker already exists %s" % ws) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_parent->_workers, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3483, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3483, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 3483, __pyx_L8_error) __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3484 * * ws: WorkerState = parent._workers.get(address) * if ws is not None: # <<<<<<<<<<<<<< * raise ValueError("Worker already exists %s" % ws) * */ __pyx_t_10 = (((PyObject *)__pyx_cur_scope->__pyx_v_ws) != Py_None); __pyx_t_11 = (__pyx_t_10 != 0); if (unlikely(__pyx_t_11)) { /* "distributed/scheduler.py":3485 * ws: WorkerState = parent._workers.get(address) * if ws is not None: * raise ValueError("Worker already exists %s" % ws) # <<<<<<<<<<<<<< * * if name in parent._aliases: */ __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Worker_already_exists_s, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3485, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3485, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 3485, __pyx_L8_error) /* "distributed/scheduler.py":3484 * * ws: WorkerState = parent._workers.get(address) * if ws is not None: # <<<<<<<<<<<<<< * raise ValueError("Worker already exists %s" % ws) * */ } /* "distributed/scheduler.py":3487 * raise ValueError("Worker already exists %s" % ws) * * if name in parent._aliases: # <<<<<<<<<<<<<< * logger.warning( * "Worker tried to connect with a duplicate name: %s", name */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_aliases == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 3487, __pyx_L8_error) } __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_name, __pyx_cur_scope->__pyx_v_parent->_aliases, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3487, __pyx_L8_error) __pyx_t_10 = (__pyx_t_11 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3488 * * if name in parent._aliases: * logger.warning( # <<<<<<<<<<<<<< * "Worker tried to connect with a duplicate name: %s", name * ) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3488, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3488, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3489 * if name in parent._aliases: * logger.warning( * "Worker tried to connect with a duplicate name: %s", name # <<<<<<<<<<<<<< * ) * msg = { */ __pyx_t_1 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Worker_tried_to_connect_with_a_d, __pyx_cur_scope->__pyx_v_name}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3488, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Worker_tried_to_connect_with_a_d, __pyx_cur_scope->__pyx_v_name}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3488, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3488, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Worker_tried_to_connect_with_a_d); __Pyx_GIVEREF(__pyx_kp_u_Worker_tried_to_connect_with_a_d); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, __pyx_kp_u_Worker_tried_to_connect_with_a_d); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_cur_scope->__pyx_v_name); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3488, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3492 * ) * msg = { * "status": "error", # <<<<<<<<<<<<<< * "message": "name taken, %s" % name, * "time": time(), */ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3492, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_status, __pyx_n_u_error) < 0) __PYX_ERR(0, 3492, __pyx_L8_error) /* "distributed/scheduler.py":3493 * msg = { * "status": "error", * "message": "name taken, %s" % name, # <<<<<<<<<<<<<< * "time": time(), * } */ __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_name_taken_s, __pyx_cur_scope->__pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3493, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_message, __pyx_t_5) < 0) __PYX_ERR(0, 3492, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3494 * "status": "error", * "message": "name taken, %s" % name, * "time": time(), # <<<<<<<<<<<<<< * } * if comm: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3494, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3494, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_time, __pyx_t_5) < 0) __PYX_ERR(0, 3492, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_msg = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3496 * "time": time(), * } * if comm: # <<<<<<<<<<<<<< * await comm.write(msg) * return */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_comm); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3496, __pyx_L8_error) if (__pyx_t_10) { /* "distributed/scheduler.py":3497 * } * if comm: * await comm.write(msg) # <<<<<<<<<<<<<< * return * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3497, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_cur_scope->__pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_msg); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3497, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L17_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3497, __pyx_L8_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3497, __pyx_L8_error) } } /* "distributed/scheduler.py":3496 * "time": time(), * } * if comm: # <<<<<<<<<<<<<< * await comm.write(msg) * return */ } /* "distributed/scheduler.py":3498 * if comm: * await comm.write(msg) * return # <<<<<<<<<<<<<< * * parent._workers[address] = ws = WorkerState( */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L12_try_return; /* "distributed/scheduler.py":3487 * raise ValueError("Worker already exists %s" % ws) * * if name in parent._aliases: # <<<<<<<<<<<<<< * logger.warning( * "Worker tried to connect with a duplicate name: %s", name */ } /* "distributed/scheduler.py":3501 * * parent._workers[address] = ws = WorkerState( * address=address, # <<<<<<<<<<<<<< * pid=pid, * nthreads=nthreads, */ __pyx_t_2 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3501, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_cur_scope->__pyx_v_address) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3502 * parent._workers[address] = ws = WorkerState( * address=address, * pid=pid, # <<<<<<<<<<<<<< * nthreads=nthreads, * memory_limit=memory_limit or 0, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pid, __pyx_cur_scope->__pyx_v_pid) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3503 * address=address, * pid=pid, * nthreads=nthreads, # <<<<<<<<<<<<<< * memory_limit=memory_limit or 0, * name=name, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nthreads, __pyx_cur_scope->__pyx_v_nthreads) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3504 * pid=pid, * nthreads=nthreads, * memory_limit=memory_limit or 0, # <<<<<<<<<<<<<< * name=name, * local_directory=local_directory, */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_memory_limit); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3504, __pyx_L8_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_memory_limit); __pyx_t_5 = __pyx_cur_scope->__pyx_v_memory_limit; goto __pyx_L18_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3504, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L18_bool_binop_done:; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_memory_limit, __pyx_t_5) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3505 * nthreads=nthreads, * memory_limit=memory_limit or 0, * name=name, # <<<<<<<<<<<<<< * local_directory=local_directory, * services=services, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_cur_scope->__pyx_v_name) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3506 * memory_limit=memory_limit or 0, * name=name, * local_directory=local_directory, # <<<<<<<<<<<<<< * services=services, * versions=versions, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_local_directory, __pyx_cur_scope->__pyx_v_local_directory) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3507 * name=name, * local_directory=local_directory, * services=services, # <<<<<<<<<<<<<< * versions=versions, * nanny=nanny, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_services, __pyx_cur_scope->__pyx_v_services) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3508 * local_directory=local_directory, * services=services, * versions=versions, # <<<<<<<<<<<<<< * nanny=nanny, * extra=extra, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_versions, __pyx_cur_scope->__pyx_v_versions) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3509 * services=services, * versions=versions, * nanny=nanny, # <<<<<<<<<<<<<< * extra=extra, * ) */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nanny, __pyx_cur_scope->__pyx_v_nanny) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3510 * versions=versions, * nanny=nanny, * extra=extra, # <<<<<<<<<<<<<< * ) * */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extra, __pyx_cur_scope->__pyx_v_extra) < 0) __PYX_ERR(0, 3501, __pyx_L8_error) /* "distributed/scheduler.py":3500 * return * * parent._workers[address] = ws = WorkerState( # <<<<<<<<<<<<<< * address=address, * pid=pid, */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11distributed_9scheduler_WorkerState), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3500, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyObject_SetItem(__pyx_cur_scope->__pyx_v_parent->_workers, __pyx_cur_scope->__pyx_v_address, __pyx_t_5) < 0)) __PYX_ERR(0, 3500, __pyx_L8_error) __Pyx_INCREF(__pyx_t_5); __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_5)); __Pyx_GIVEREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3513 * ) * * if "addresses" not in parent._host_info[host]: # <<<<<<<<<<<<<< * parent._host_info[host].update({"addresses": set(), "nthreads": 0}) * */ __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3513, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_addresses, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3513, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { /* "distributed/scheduler.py":3514 * * if "addresses" not in parent._host_info[host]: * parent._host_info[host].update({"addresses": set(), "nthreads": 0}) # <<<<<<<<<<<<<< * * parent._host_info[host]["addresses"].add(address) */ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3514, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3514, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3514, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3514, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_addresses, __pyx_t_1) < 0) __PYX_ERR(0, 3514, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_nthreads, __pyx_int_0) < 0) __PYX_ERR(0, 3514, __pyx_L8_error) __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3514, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3513 * ) * * if "addresses" not in parent._host_info[host]: # <<<<<<<<<<<<<< * parent._host_info[host].update({"addresses": set(), "nthreads": 0}) * */ } /* "distributed/scheduler.py":3516 * parent._host_info[host].update({"addresses": set(), "nthreads": 0}) * * parent._host_info[host]["addresses"].add(address) # <<<<<<<<<<<<<< * parent._host_info[host]["nthreads"] += nthreads * */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_addresses); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3517 * * parent._host_info[host]["addresses"].add(address) * parent._host_info[host]["nthreads"] += nthreads # <<<<<<<<<<<<<< * * parent._total_nthreads += nthreads */ __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3517, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_u_nthreads); __pyx_t_12 = __pyx_n_u_nthreads; __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3517, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_cur_scope->__pyx_v_nthreads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3517, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_t_12, __pyx_t_2) < 0)) __PYX_ERR(0, 3517, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3519 * parent._host_info[host]["nthreads"] += nthreads * * parent._total_nthreads += nthreads # <<<<<<<<<<<<<< * parent._aliases[name] = address * */ __pyx_t_5 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_parent->_total_nthreads); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3519, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_cur_scope->__pyx_v_nthreads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3519, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3519, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_cur_scope->__pyx_v_parent->_total_nthreads = __pyx_t_13; /* "distributed/scheduler.py":3520 * * parent._total_nthreads += nthreads * parent._aliases[name] = address # <<<<<<<<<<<<<< * * response = self.heartbeat_worker( */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_aliases == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3520, __pyx_L8_error) } if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_parent->_aliases, __pyx_cur_scope->__pyx_v_name, __pyx_cur_scope->__pyx_v_address) < 0)) __PYX_ERR(0, 3520, __pyx_L8_error) /* "distributed/scheduler.py":3522 * parent._aliases[name] = address * * response = self.heartbeat_worker( # <<<<<<<<<<<<<< * address=address, * resolve_address=resolve_address, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_heartbeat_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3522, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":3523 * * response = self.heartbeat_worker( * address=address, # <<<<<<<<<<<<<< * resolve_address=resolve_address, * now=now, */ __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3523, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_address, __pyx_cur_scope->__pyx_v_address) < 0) __PYX_ERR(0, 3523, __pyx_L8_error) /* "distributed/scheduler.py":3524 * response = self.heartbeat_worker( * address=address, * resolve_address=resolve_address, # <<<<<<<<<<<<<< * now=now, * resources=resources, */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_resolve_address, __pyx_cur_scope->__pyx_v_resolve_address) < 0) __PYX_ERR(0, 3523, __pyx_L8_error) /* "distributed/scheduler.py":3525 * address=address, * resolve_address=resolve_address, * now=now, # <<<<<<<<<<<<<< * resources=resources, * host_info=host_info, */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_now, __pyx_cur_scope->__pyx_v_now) < 0) __PYX_ERR(0, 3523, __pyx_L8_error) /* "distributed/scheduler.py":3526 * resolve_address=resolve_address, * now=now, * resources=resources, # <<<<<<<<<<<<<< * host_info=host_info, * metrics=metrics, */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_resources, __pyx_cur_scope->__pyx_v_resources) < 0) __PYX_ERR(0, 3523, __pyx_L8_error) /* "distributed/scheduler.py":3527 * now=now, * resources=resources, * host_info=host_info, # <<<<<<<<<<<<<< * metrics=metrics, * ) */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_host_info, __pyx_cur_scope->__pyx_v_host_info) < 0) __PYX_ERR(0, 3523, __pyx_L8_error) /* "distributed/scheduler.py":3528 * resources=resources, * host_info=host_info, * metrics=metrics, # <<<<<<<<<<<<<< * ) * */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_metrics, __pyx_cur_scope->__pyx_v_metrics) < 0) __PYX_ERR(0, 3523, __pyx_L8_error) /* "distributed/scheduler.py":3522 * parent._aliases[name] = address * * response = self.heartbeat_worker( # <<<<<<<<<<<<<< * address=address, * resolve_address=resolve_address, */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3522, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_response = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":3532 * * # Do not need to adjust parent._total_occupancy as self.occupancy[ws] cannot exist before this. * self.check_idle_saturated(ws) # <<<<<<<<<<<<<< * * # for key in keys: # TODO */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_idle_saturated); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3532, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3532, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3537 * # self.mark_key_in_memory(key, [address]) * * self.stream_comms[address] = BatchedSend(interval="5ms", loop=self.loop) # <<<<<<<<<<<<<< * * if ws._nthreads > len(ws._processing): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BatchedSend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3537, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3537, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interval, __pyx_kp_u_5ms) < 0) __PYX_ERR(0, 3537, __pyx_L8_error) __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3537, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_loop, __pyx_t_2) < 0) __PYX_ERR(0, 3537, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3537, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3537, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_cur_scope->__pyx_v_address, __pyx_t_2) < 0)) __PYX_ERR(0, 3537, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3539 * self.stream_comms[address] = BatchedSend(interval="5ms", loop=self.loop) * * if ws._nthreads > len(ws._processing): # <<<<<<<<<<<<<< * parent._idle[ws._address] = ws * */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_ws->_processing; __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 3539, __pyx_L8_error) } __pyx_t_13 = PyDict_Size(__pyx_t_2); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3539, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = ((__pyx_cur_scope->__pyx_v_ws->_nthreads > __pyx_t_13) != 0); if (__pyx_t_11) { /* "distributed/scheduler.py":3540 * * if ws._nthreads > len(ws._processing): * parent._idle[ws._address] = ws # <<<<<<<<<<<<<< * * for plugin in self.plugins[:]: */ if (unlikely(PyObject_SetItem(__pyx_cur_scope->__pyx_v_parent->_idle, __pyx_cur_scope->__pyx_v_ws->_address, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)) < 0)) __PYX_ERR(0, 3540, __pyx_L8_error) /* "distributed/scheduler.py":3539 * self.stream_comms[address] = BatchedSend(interval="5ms", loop=self.loop) * * if ws._nthreads > len(ws._processing): # <<<<<<<<<<<<<< * parent._idle[ws._address] = ws * */ } /* "distributed/scheduler.py":3542 * parent._idle[ws._address] = ws * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * result = plugin.add_worker(scheduler=self, worker=address) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3542, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__57, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3542, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3542, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3542, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3542, __pyx_L8_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3542, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3542, __pyx_L8_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3542, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3542, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_plugin); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_plugin, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3543 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * result = plugin.add_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): */ { __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "distributed/scheduler.py":3544 * for plugin in self.plugins[:]: * try: * result = plugin.add_worker(scheduler=self, worker=address) # <<<<<<<<<<<<<< * if inspect.isawaitable(result): * await result */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_plugin, __pyx_n_s_add_worker); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3544, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3544, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scheduler, __pyx_cur_scope->__pyx_v_self) < 0) __PYX_ERR(0, 3544, __pyx_L24_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_worker, __pyx_cur_scope->__pyx_v_address) < 0) __PYX_ERR(0, 3544, __pyx_L24_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3544, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_result); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_result, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3545 * try: * result = plugin.add_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): # <<<<<<<<<<<<<< * await result * except Exception as e: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_inspect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3545, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isawaitable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3545, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_cur_scope->__pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_result); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3545, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3545, __pyx_L24_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { /* "distributed/scheduler.py":3546 * result = plugin.add_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): * await result # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_result); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __pyx_cur_scope->__pyx_t_5 = __pyx_t_13; __pyx_cur_scope->__pyx_t_6 = __pyx_t_14; __Pyx_XGIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_t_7 = __pyx_t_15; __Pyx_XGIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_t_8 = __pyx_t_16; __Pyx_XGIVEREF(__pyx_t_17); __pyx_cur_scope->__pyx_t_9 = __pyx_t_17; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L33_resume_from_await:; __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_13 = __pyx_cur_scope->__pyx_t_5; __pyx_t_14 = __pyx_cur_scope->__pyx_t_6; __pyx_t_15 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_15); __pyx_t_16 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_16); __pyx_t_17 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3546, __pyx_L24_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3546, __pyx_L24_error) } } /* "distributed/scheduler.py":3545 * try: * result = plugin.add_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): # <<<<<<<<<<<<<< * await result * except Exception as e: */ } /* "distributed/scheduler.py":3543 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * result = plugin.add_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): */ } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L31_try_end; __pyx_L24_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3547 * if inspect.isawaitable(result): * await result * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_3) < 0) __PYX_ERR(0, 3547, __pyx_L26_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_e = __pyx_t_5; /*try:*/ { /* "distributed/scheduler.py":3548 * await result * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * * recommendations: dict */ __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_logger); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 3548, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_exception); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3548, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_19 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_19)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } __pyx_t_18 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_19, __pyx_cur_scope->__pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3548, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } /* "distributed/scheduler.py":3547 * if inspect.isawaitable(result): * await result * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; goto __pyx_L40; } __pyx_L39_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_28); __pyx_t_9 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_27, __pyx_t_28); } __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ErrRestore(__pyx_t_23, __pyx_t_24, __pyx_t_25); __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22; goto __pyx_L26_except_error; } __pyx_L40:; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L25_exception_handled; } goto __pyx_L26_except_error; __pyx_L26_except_error:; /* "distributed/scheduler.py":3543 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * result = plugin.add_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); goto __pyx_L8_error; __pyx_L25_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_L31_try_end:; } /* "distributed/scheduler.py":3542 * parent._idle[ws._address] = ws * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * result = plugin.add_worker(scheduler=self, worker=address) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3551 * * recommendations: dict * if nbytes: # <<<<<<<<<<<<<< * for key in nbytes: * tasks: dict = parent._tasks */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_nbytes); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3551, __pyx_L8_error) if (__pyx_t_11) { /* "distributed/scheduler.py":3552 * recommendations: dict * if nbytes: * for key in nbytes: # <<<<<<<<<<<<<< * tasks: dict = parent._tasks * ts: TaskState = tasks.get(key) */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_nbytes)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_nbytes)) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_nbytes; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3552, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3552, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3552, __pyx_L8_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3552, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3552, __pyx_L8_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3552, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3552, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3553 * if nbytes: * for key in nbytes: * tasks: dict = parent._tasks # <<<<<<<<<<<<<< * ts: TaskState = tasks.get(key) * if ts is not None and ts._state in ("processing", "waiting"): */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_parent->_tasks; __Pyx_INCREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tasks); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tasks, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3554 * for key in nbytes: * tasks: dict = parent._tasks * ts: TaskState = tasks.get(key) # <<<<<<<<<<<<<< * if ts is not None and ts._state in ("processing", "waiting"): * recommendations = self.transition( */ if (unlikely(__pyx_cur_scope->__pyx_v_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3554, __pyx_L8_error) } __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_tasks, __pyx_cur_scope->__pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3554, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3554, __pyx_L8_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3555 * tasks: dict = parent._tasks * ts: TaskState = tasks.get(key) * if ts is not None and ts._state in ("processing", "waiting"): # <<<<<<<<<<<<<< * recommendations = self.transition( * key, */ __pyx_t_10 = (((PyObject *)__pyx_cur_scope->__pyx_v_ts) != Py_None); __pyx_t_29 = (__pyx_t_10 != 0); if (__pyx_t_29) { } else { __pyx_t_11 = __pyx_t_29; goto __pyx_L49_bool_binop_done; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ts->_state); __pyx_t_12 = __pyx_cur_scope->__pyx_v_ts->_state; __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3555, __pyx_L8_error) __pyx_t_30 = (__pyx_t_10 != 0); if (!__pyx_t_30) { } else { __pyx_t_29 = __pyx_t_30; goto __pyx_L51_bool_binop_done; } __pyx_t_30 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_waiting, Py_EQ)); if (unlikely(__pyx_t_30 < 0)) __PYX_ERR(0, 3555, __pyx_L8_error) __pyx_t_10 = (__pyx_t_30 != 0); __pyx_t_29 = __pyx_t_10; __pyx_L51_bool_binop_done:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_10 = (__pyx_t_29 != 0); __pyx_t_11 = __pyx_t_10; __pyx_L49_bool_binop_done:; if (__pyx_t_11) { /* "distributed/scheduler.py":3556 * ts: TaskState = tasks.get(key) * if ts is not None and ts._state in ("processing", "waiting"): * recommendations = self.transition( # <<<<<<<<<<<<<< * key, * "memory", */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_transition); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3556, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":3557 * if ts is not None and ts._state in ("processing", "waiting"): * recommendations = self.transition( * key, # <<<<<<<<<<<<<< * "memory", * worker=address, */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3556, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_key); __Pyx_INCREF(__pyx_n_u_memory_2); __Pyx_GIVEREF(__pyx_n_u_memory_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_u_memory_2); /* "distributed/scheduler.py":3559 * key, * "memory", * worker=address, # <<<<<<<<<<<<<< * nbytes=nbytes[key], * typename=types[key], */ __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3559, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_worker, __pyx_cur_scope->__pyx_v_address) < 0) __PYX_ERR(0, 3559, __pyx_L8_error) /* "distributed/scheduler.py":3560 * "memory", * worker=address, * nbytes=nbytes[key], # <<<<<<<<<<<<<< * typename=types[key], * ) */ __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_nbytes, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3560, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nbytes, __pyx_t_18) < 0) __PYX_ERR(0, 3559, __pyx_L8_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3561 * worker=address, * nbytes=nbytes[key], * typename=types[key], # <<<<<<<<<<<<<< * ) * self.transitions(recommendations) */ __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_types, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3561, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_typename, __pyx_t_18) < 0) __PYX_ERR(0, 3559, __pyx_L8_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3556 * ts: TaskState = tasks.get(key) * if ts is not None and ts._state in ("processing", "waiting"): * recommendations = self.transition( # <<<<<<<<<<<<<< * key, * "memory", */ __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3556, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyDict_CheckExact(__pyx_t_18))||((__pyx_t_18) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_18)->tp_name), 0))) __PYX_ERR(0, 3556, __pyx_L8_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_recommendations); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_recommendations, ((PyObject*)__pyx_t_18)); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3563 * typename=types[key], * ) * self.transitions(recommendations) # <<<<<<<<<<<<<< * * recommendations = {} */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3563, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_18 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_cur_scope->__pyx_v_recommendations) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_recommendations); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3563, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3555 * tasks: dict = parent._tasks * ts: TaskState = tasks.get(key) * if ts is not None and ts._state in ("processing", "waiting"): # <<<<<<<<<<<<<< * recommendations = self.transition( * key, */ } /* "distributed/scheduler.py":3552 * recommendations: dict * if nbytes: * for key in nbytes: # <<<<<<<<<<<<<< * tasks: dict = parent._tasks * ts: TaskState = tasks.get(key) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3551 * * recommendations: dict * if nbytes: # <<<<<<<<<<<<<< * for key in nbytes: * tasks: dict = parent._tasks */ } /* "distributed/scheduler.py":3565 * self.transitions(recommendations) * * recommendations = {} # <<<<<<<<<<<<<< * for ts in list(parent._unrunnable): * valid: set = self.valid_workers(ts) */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3565, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_recommendations); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_recommendations, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3566 * * recommendations = {} * for ts in list(parent._unrunnable): # <<<<<<<<<<<<<< * valid: set = self.valid_workers(ts) * if valid is None or ws in valid: */ __pyx_t_2 = PySequence_List(__pyx_cur_scope->__pyx_v_parent->_unrunnable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3566, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_18 = __pyx_t_2; __Pyx_INCREF(__pyx_t_18); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_18)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3566, __pyx_L8_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_18, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3566, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3566, __pyx_L8_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3567 * recommendations = {} * for ts in list(parent._unrunnable): * valid: set = self.valid_workers(ts) # <<<<<<<<<<<<<< * if valid is None or ws in valid: * recommendations[ts._key] = "waiting" */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_valid_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3567, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3567, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PySet_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 3567, __pyx_L8_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_valid); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_valid, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3568 * for ts in list(parent._unrunnable): * valid: set = self.valid_workers(ts) * if valid is None or ws in valid: # <<<<<<<<<<<<<< * recommendations[ts._key] = "waiting" * */ __pyx_t_10 = (__pyx_cur_scope->__pyx_v_valid == ((PyObject*)Py_None)); __pyx_t_29 = (__pyx_t_10 != 0); if (!__pyx_t_29) { } else { __pyx_t_11 = __pyx_t_29; goto __pyx_L56_bool_binop_done; } if (unlikely(__pyx_cur_scope->__pyx_v_valid == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 3568, __pyx_L8_error) } __pyx_t_29 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_cur_scope->__pyx_v_ws), __pyx_cur_scope->__pyx_v_valid, Py_EQ)); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 3568, __pyx_L8_error) __pyx_t_10 = (__pyx_t_29 != 0); __pyx_t_11 = __pyx_t_10; __pyx_L56_bool_binop_done:; if (__pyx_t_11) { /* "distributed/scheduler.py":3569 * valid: set = self.valid_workers(ts) * if valid is None or ws in valid: * recommendations[ts._key] = "waiting" # <<<<<<<<<<<<<< * * if recommendations: */ if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_recommendations, __pyx_cur_scope->__pyx_v_ts->_key, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 3569, __pyx_L8_error) /* "distributed/scheduler.py":3568 * for ts in list(parent._unrunnable): * valid: set = self.valid_workers(ts) * if valid is None or ws in valid: # <<<<<<<<<<<<<< * recommendations[ts._key] = "waiting" * */ } /* "distributed/scheduler.py":3566 * * recommendations = {} * for ts in list(parent._unrunnable): # <<<<<<<<<<<<<< * valid: set = self.valid_workers(ts) * if valid is None or ws in valid: */ } __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3571 * recommendations[ts._key] = "waiting" * * if recommendations: # <<<<<<<<<<<<<< * self.transitions(recommendations) * */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_recommendations); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3571, __pyx_L8_error) if (__pyx_t_11) { /* "distributed/scheduler.py":3572 * * if recommendations: * self.transitions(recommendations) # <<<<<<<<<<<<<< * * self.log_event(address, {"action": "add-worker"}) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3572, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_18 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_cur_scope->__pyx_v_recommendations) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_recommendations); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3572, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3571 * recommendations[ts._key] = "waiting" * * if recommendations: # <<<<<<<<<<<<<< * self.transitions(recommendations) * */ } /* "distributed/scheduler.py":3574 * self.transitions(recommendations) * * self.log_event(address, {"action": "add-worker"}) # <<<<<<<<<<<<<< * self.log_event("all", {"action": "add-worker", "worker": address}) * logger.info("Register worker %s", ws) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3574, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3574, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_action, __pyx_kp_u_add_worker_2) < 0) __PYX_ERR(0, 3574, __pyx_L8_error) __pyx_t_5 = NULL; __pyx_t_21 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_21 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_address, __pyx_t_1}; __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3574, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_address, __pyx_t_1}; __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3574, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_21); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3574, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_21, __pyx_cur_scope->__pyx_v_address); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_21, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3574, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3575 * * self.log_event(address, {"action": "add-worker"}) * self.log_event("all", {"action": "add-worker", "worker": address}) # <<<<<<<<<<<<<< * logger.info("Register worker %s", ws) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3575, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3575, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_action, __pyx_kp_u_add_worker_2) < 0) __PYX_ERR(0, 3575, __pyx_L8_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_worker, __pyx_cur_scope->__pyx_v_address) < 0) __PYX_ERR(0, 3575, __pyx_L8_error) __pyx_t_1 = NULL; __pyx_t_21 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_21 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_n_u_all, __pyx_t_3}; __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3575, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_n_u_all, __pyx_t_3}; __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3575, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_21); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3575, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_21, __pyx_n_u_all); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_21, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3575, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3576 * self.log_event(address, {"action": "add-worker"}) * self.log_event("all", {"action": "add-worker", "worker": address}) * logger.info("Register worker %s", ws) # <<<<<<<<<<<<<< * * msg = { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3576, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3576, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_21 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_21 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Register_worker_s, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)}; __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3576, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_18); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Register_worker_s, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)}; __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3576, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_18); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_21); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3576, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Register_worker_s); __Pyx_GIVEREF(__pyx_kp_u_Register_worker_s); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_21, __pyx_kp_u_Register_worker_s); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_21, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3576, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3579 * * msg = { * "status": "OK", # <<<<<<<<<<<<<< * "time": time(), * "heartbeat-interval": heartbeat_interval(len(parent._workers)), */ __pyx_t_18 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3579, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_18, __pyx_n_u_status, __pyx_n_u_OK) < 0) __PYX_ERR(0, 3579, __pyx_L8_error) /* "distributed/scheduler.py":3580 * msg = { * "status": "OK", * "time": time(), # <<<<<<<<<<<<<< * "heartbeat-interval": heartbeat_interval(len(parent._workers)), * "worker-plugins": self.worker_plugins, */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3580, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3580, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_18, __pyx_n_u_time, __pyx_t_5) < 0) __PYX_ERR(0, 3579, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3581 * "status": "OK", * "time": time(), * "heartbeat-interval": heartbeat_interval(len(parent._workers)), # <<<<<<<<<<<<<< * "worker-plugins": self.worker_plugins, * } */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_heartbeat_interval_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3581, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_cur_scope->__pyx_v_parent->_workers; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3581, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3581, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3581, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_18, __pyx_kp_u_heartbeat_interval, __pyx_t_5) < 0) __PYX_ERR(0, 3579, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3582 * "time": time(), * "heartbeat-interval": heartbeat_interval(len(parent._workers)), * "worker-plugins": self.worker_plugins, # <<<<<<<<<<<<<< * } * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_worker_plugins); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3582, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_18, __pyx_kp_u_worker_plugins_2, __pyx_t_5) < 0) __PYX_ERR(0, 3579, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_v_msg = ((PyObject*)__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3586 * * cs: ClientState * version_warning = version_module.error_message( # <<<<<<<<<<<<<< * version_module.get_versions(), * merge( */ __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_version_module); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3586, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_error_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3586, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3587 * cs: ClientState * version_warning = version_module.error_message( * version_module.get_versions(), # <<<<<<<<<<<<<< * merge( * {w: ws._versions for w, ws in parent._workers.items()}, */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_version_module); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3587, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_versions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3587, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_18 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3587, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3588 * version_warning = version_module.error_message( * version_module.get_versions(), * merge( # <<<<<<<<<<<<<< * {w: ws._versions for w, ws in parent._workers.items()}, * { */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_merge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3588, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); { /* enter inner scope */ /* "distributed/scheduler.py":3589 * version_module.get_versions(), * merge( * {w: ws._versions for w, ws in parent._workers.items()}, # <<<<<<<<<<<<<< * { * c: cs._versions */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3589, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3589, __pyx_L8_error) } __pyx_t_19 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers, 0, __pyx_n_s_items, (&__pyx_t_31), (&__pyx_t_21)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 3589, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = __pyx_t_19; __pyx_t_19 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_20, __pyx_t_31, &__pyx_t_13, &__pyx_t_19, &__pyx_t_32, NULL, __pyx_t_21); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 3589, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_GOTREF(__pyx_t_32); if (!(likely(((__pyx_t_32) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_32, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 3589, __pyx_L8_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr35__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr35__pyx_v_w, __pyx_t_19); __Pyx_GIVEREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr35__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr35__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_32)); __Pyx_GIVEREF(__pyx_t_32); __pyx_t_32 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr35__pyx_v_w, (PyObject*)__pyx_cur_scope->__pyx_9genexpr35__pyx_v_ws->_versions))) __PYX_ERR(0, 3589, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } /* exit inner scope */ { /* enter inner scope */ /* "distributed/scheduler.py":3590 * merge( * {w: ws._versions for w, ws in parent._workers.items()}, * { # <<<<<<<<<<<<<< * c: cs._versions * for c, cs in parent._clients.items() */ __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3590, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_20); /* "distributed/scheduler.py":3592 * { * c: cs._versions * for c, cs in parent._clients.items() # <<<<<<<<<<<<<< * if cs._versions * }, */ __pyx_t_31 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_clients == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3592, __pyx_L8_error) } __pyx_t_19 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_clients, 1, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_21)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 3592, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = __pyx_t_19; __pyx_t_19 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_32, __pyx_t_13, &__pyx_t_31, &__pyx_t_19, &__pyx_t_33, NULL, __pyx_t_21); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 3592, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_GOTREF(__pyx_t_33); if (!(likely(((__pyx_t_33) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_33, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 3592, __pyx_L8_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr36__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr36__pyx_v_c, __pyx_t_19); __Pyx_GIVEREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr36__pyx_v_cs)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr36__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_33)); __Pyx_GIVEREF(__pyx_t_33); __pyx_t_33 = 0; /* "distributed/scheduler.py":3593 * c: cs._versions * for c, cs in parent._clients.items() * if cs._versions # <<<<<<<<<<<<<< * }, * ), */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_9genexpr36__pyx_v_cs->_versions); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3593, __pyx_L8_error) if (__pyx_t_11) { /* "distributed/scheduler.py":3591 * {w: ws._versions for w, ws in parent._workers.items()}, * { * c: cs._versions # <<<<<<<<<<<<<< * for c, cs in parent._clients.items() * if cs._versions */ if (unlikely(PyDict_SetItem(__pyx_t_20, (PyObject*)__pyx_cur_scope->__pyx_9genexpr36__pyx_v_c, (PyObject*)__pyx_cur_scope->__pyx_9genexpr36__pyx_v_cs->_versions))) __PYX_ERR(0, 3591, __pyx_L8_error) /* "distributed/scheduler.py":3593 * c: cs._versions * for c, cs in parent._clients.items() * if cs._versions # <<<<<<<<<<<<<< * }, * ), */ } } __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0; } /* exit inner scope */ __pyx_t_32 = NULL; __pyx_t_21 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_32 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_32)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_32); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_21 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_32, __pyx_t_1, __pyx_t_20}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3588, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_32, __pyx_t_1, __pyx_t_20}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3588, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else #endif { __pyx_t_33 = PyTuple_New(2+__pyx_t_21); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 3588, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_33); if (__pyx_t_32) { __Pyx_GIVEREF(__pyx_t_32); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_32); __pyx_t_32 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_33, 0+__pyx_t_21, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_33, 1+__pyx_t_21, __pyx_t_20); __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3588, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3586 * * cs: ClientState * version_warning = version_module.error_message( # <<<<<<<<<<<<<< * version_module.get_versions(), * merge( */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3586, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_versions); __pyx_t_18 = 0; __pyx_t_2 = 0; /* "distributed/scheduler.py":3597 * ), * versions, * client_name="This Worker", # <<<<<<<<<<<<<< * ) * msg.update(version_warning) */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3597, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client_name, __pyx_kp_u_This_Worker) < 0) __PYX_ERR(0, 3597, __pyx_L8_error) /* "distributed/scheduler.py":3586 * * cs: ClientState * version_warning = version_module.error_message( # <<<<<<<<<<<<<< * version_module.get_versions(), * merge( */ __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3586, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_v_version_warning = __pyx_t_18; __pyx_t_18 = 0; /* "distributed/scheduler.py":3599 * client_name="This Worker", * ) * msg.update(version_warning) # <<<<<<<<<<<<<< * * if comm: */ __pyx_t_18 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_cur_scope->__pyx_v_msg, __pyx_cur_scope->__pyx_v_version_warning); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3599, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":3601 * msg.update(version_warning) * * if comm: # <<<<<<<<<<<<<< * await comm.write(msg) * await self.handle_worker(comm=comm, worker=address) */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_comm); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3601, __pyx_L8_error) if (__pyx_t_11) { /* "distributed/scheduler.py":3602 * * if comm: * await comm.write(msg) # <<<<<<<<<<<<<< * await self.handle_worker(comm=comm, worker=address) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3602, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_18 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_msg); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3602, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_18); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L65_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3602, __pyx_L8_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3602, __pyx_L8_error) } } /* "distributed/scheduler.py":3601 * msg.update(version_warning) * * if comm: # <<<<<<<<<<<<<< * await comm.write(msg) * await self.handle_worker(comm=comm, worker=address) */ } /* "distributed/scheduler.py":3603 * if comm: * await comm.write(msg) * await self.handle_worker(comm=comm, worker=address) # <<<<<<<<<<<<<< * * def update_graph_hlg( */ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_handle_worker); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3603, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3603, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_comm, __pyx_cur_scope->__pyx_v_comm) < 0) __PYX_ERR(0, 3603, __pyx_L8_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_worker, __pyx_cur_scope->__pyx_v_address) < 0) __PYX_ERR(0, 3603, __pyx_L8_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3603, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L66_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3603, __pyx_L8_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 3603, __pyx_L8_error) } } /* "distributed/scheduler.py":3478 * """ Add a new worker to the cluster """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * address = self.coerce_address(address, resolve_address) * address = normalize_address(address) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0; __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_18) < 0) __PYX_ERR(0, 3478, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_18); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_18); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3478, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3478, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 3478, __pyx_L10_except_error) __pyx_t_10 = ((!(__pyx_t_11 != 0)) != 0); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_18); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_18 = 0; __PYX_ERR(0, 3478, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L12_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L5_return; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L7; } __pyx_L5_return: { __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_28 = __pyx_r; __pyx_r = 0; if (__pyx_t_4) { __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 3478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; } __pyx_r = __pyx_t_28; __pyx_t_28 = 0; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; goto __pyx_L0; } __pyx_L7:; } goto __pyx_L70; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L70:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":3454 * } * * async def add_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_XDECREF(__pyx_t_32); __Pyx_XDECREF(__pyx_t_33); __Pyx_AddTraceback("add_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3605 * await self.handle_worker(comm=comm, worker=address) * * def update_graph_hlg( # <<<<<<<<<<<<<< * self, * client=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_23update_graph_hlg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_23update_graph_hlg = {"update_graph_hlg", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_23update_graph_hlg, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_23update_graph_hlg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_client = 0; PyObject *__pyx_v_hlg = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_dependencies = 0; PyObject *__pyx_v_restrictions = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_v_loose_restrictions = 0; PyObject *__pyx_v_resources = 0; PyObject *__pyx_v_submitting_task = 0; PyObject *__pyx_v_retries = 0; PyObject *__pyx_v_user_priority = 0; PyObject *__pyx_v_actors = 0; PyObject *__pyx_v_fifo_timeout = 0; PyObject *__pyx_v_annotations = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update_graph_hlg (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,&__pyx_n_s_hlg,&__pyx_n_s_keys,&__pyx_n_s_dependencies,&__pyx_n_s_restrictions,&__pyx_n_s_priority,&__pyx_n_s_loose_restrictions,&__pyx_n_s_resources,&__pyx_n_s_submitting_task,&__pyx_n_s_retries,&__pyx_n_s_user_priority,&__pyx_n_s_actors,&__pyx_n_s_fifo_timeout,&__pyx_n_s_annotations,0}; PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":3607 * def update_graph_hlg( * self, * client=None, # <<<<<<<<<<<<<< * hlg=None, * keys=None, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3608 * self, * client=None, * hlg=None, # <<<<<<<<<<<<<< * keys=None, * dependencies=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3609 * client=None, * hlg=None, * keys=None, # <<<<<<<<<<<<<< * dependencies=None, * restrictions=None, */ values[3] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3610 * hlg=None, * keys=None, * dependencies=None, # <<<<<<<<<<<<<< * restrictions=None, * priority=None, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3611 * keys=None, * dependencies=None, * restrictions=None, # <<<<<<<<<<<<<< * priority=None, * loose_restrictions=None, */ values[5] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3612 * dependencies=None, * restrictions=None, * priority=None, # <<<<<<<<<<<<<< * loose_restrictions=None, * resources=None, */ values[6] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3613 * restrictions=None, * priority=None, * loose_restrictions=None, # <<<<<<<<<<<<<< * resources=None, * submitting_task=None, */ values[7] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3614 * priority=None, * loose_restrictions=None, * resources=None, # <<<<<<<<<<<<<< * submitting_task=None, * retries=None, */ values[8] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3615 * loose_restrictions=None, * resources=None, * submitting_task=None, # <<<<<<<<<<<<<< * retries=None, * user_priority=0, */ values[9] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3616 * resources=None, * submitting_task=None, * retries=None, # <<<<<<<<<<<<<< * user_priority=0, * actors=None, */ values[10] = ((PyObject *)((PyObject *)Py_None)); values[11] = ((PyObject *)((PyObject *)__pyx_int_0)); /* "distributed/scheduler.py":3618 * retries=None, * user_priority=0, * actors=None, # <<<<<<<<<<<<<< * fifo_timeout=0, * annotations=None, */ values[12] = ((PyObject *)((PyObject *)Py_None)); values[13] = ((PyObject *)((PyObject *)__pyx_int_0)); /* "distributed/scheduler.py":3620 * actors=None, * fifo_timeout=0, * annotations=None, # <<<<<<<<<<<<<< * ): * */ values[14] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hlg); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dependencies); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_restrictions); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loose_restrictions); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resources); if (value) { values[8] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submitting_task); if (value) { values[9] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_retries); if (value) { values[10] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user_priority); if (value) { values[11] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_actors); if (value) { values[12] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fifo_timeout); if (value) { values[13] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_annotations); if (value) { values[14] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_graph_hlg") < 0)) __PYX_ERR(0, 3605, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_client = values[1]; __pyx_v_hlg = values[2]; __pyx_v_keys = values[3]; __pyx_v_dependencies = values[4]; __pyx_v_restrictions = values[5]; __pyx_v_priority = values[6]; __pyx_v_loose_restrictions = values[7]; __pyx_v_resources = values[8]; __pyx_v_submitting_task = values[9]; __pyx_v_retries = values[10]; __pyx_v_user_priority = values[11]; __pyx_v_actors = values[12]; __pyx_v_fifo_timeout = values[13]; __pyx_v_annotations = values[14]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update_graph_hlg", 0, 1, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3605, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph_hlg", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_22update_graph_hlg(__pyx_self, __pyx_v_self, __pyx_v_client, __pyx_v_hlg, __pyx_v_keys, __pyx_v_dependencies, __pyx_v_restrictions, __pyx_v_priority, __pyx_v_loose_restrictions, __pyx_v_resources, __pyx_v_submitting_task, __pyx_v_retries, __pyx_v_user_priority, __pyx_v_actors, __pyx_v_fifo_timeout, __pyx_v_annotations); /* "distributed/scheduler.py":3605 * await self.handle_worker(comm=comm, worker=address) * * def update_graph_hlg( # <<<<<<<<<<<<<< * self, * client=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_22update_graph_hlg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_hlg, PyObject *__pyx_v_keys, PyObject *__pyx_v_dependencies, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_priority, PyObject *__pyx_v_loose_restrictions, PyObject *__pyx_v_resources, PyObject *__pyx_v_submitting_task, PyObject *__pyx_v_retries, PyObject *__pyx_v_user_priority, PyObject *__pyx_v_actors, PyObject *__pyx_v_fifo_timeout, PyObject *__pyx_v_annotations) { PyObject *__pyx_v_dsk = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_v_deps = NULL; PyObject *__pyx_v_dsk_keys = NULL; PyObject *__pyx_v_stripped_deps = NULL; PyObject *__pyx_9genexpr37__pyx_v_k = NULL; PyObject *__pyx_9genexpr37__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update_graph_hlg", 0); __Pyx_INCREF(__pyx_v_dependencies); __Pyx_INCREF(__pyx_v_priority); __Pyx_INCREF(__pyx_v_annotations); /* "distributed/scheduler.py":3623 * ): * * dsk, dependencies, annotations = highlevelgraph_unpack(hlg, annotations) # <<<<<<<<<<<<<< * * # Remove any self-dependencies (happens on test_publish_bag() and others) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_highlevelgraph_unpack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_hlg, __pyx_v_annotations}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_hlg, __pyx_v_annotations}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_hlg); __Pyx_GIVEREF(__pyx_v_hlg); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_hlg); __Pyx_INCREF(__pyx_v_annotations); __Pyx_GIVEREF(__pyx_v_annotations); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_annotations); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 3623, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 3623, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 3623, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_dsk = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_dependencies, __pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_annotations, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3626 * * # Remove any self-dependencies (happens on test_publish_bag() and others) * for k, v in dependencies.items(): # <<<<<<<<<<<<<< * deps = set(v) * if k in deps: */ __pyx_t_8 = 0; if (unlikely(__pyx_v_dependencies == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3626, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_dependencies, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_8, &__pyx_t_3, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 3626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3627 * # Remove any self-dependencies (happens on test_publish_bag() and others) * for k, v in dependencies.items(): * deps = set(v) # <<<<<<<<<<<<<< * if k in deps: * deps.remove(k) */ __pyx_t_5 = PySet_New(__pyx_v_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_deps, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":3628 * for k, v in dependencies.items(): * deps = set(v) * if k in deps: # <<<<<<<<<<<<<< * deps.remove(k) * dependencies[k] = deps */ __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_v_k, __pyx_v_deps, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3628, __pyx_L1_error) __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":3629 * deps = set(v) * if k in deps: * deps.remove(k) # <<<<<<<<<<<<<< * dependencies[k] = deps * */ __pyx_t_13 = __Pyx_PySet_Remove(__pyx_v_deps, __pyx_v_k); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 3629, __pyx_L1_error) /* "distributed/scheduler.py":3628 * for k, v in dependencies.items(): * deps = set(v) * if k in deps: # <<<<<<<<<<<<<< * deps.remove(k) * dependencies[k] = deps */ } /* "distributed/scheduler.py":3630 * if k in deps: * deps.remove(k) * dependencies[k] = deps # <<<<<<<<<<<<<< * * if priority is None: */ if (unlikely(PyObject_SetItem(__pyx_v_dependencies, __pyx_v_k, __pyx_v_deps) < 0)) __PYX_ERR(0, 3630, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3632 * dependencies[k] = deps * * if priority is None: # <<<<<<<<<<<<<< * # Removing all non-local keys before calling order() * dsk_keys = set(dsk) # intersection() of sets is much faster than dict_keys */ __pyx_t_12 = (__pyx_v_priority == Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (__pyx_t_11) { /* "distributed/scheduler.py":3634 * if priority is None: * # Removing all non-local keys before calling order() * dsk_keys = set(dsk) # intersection() of sets is much faster than dict_keys # <<<<<<<<<<<<<< * stripped_deps = { * k: v.intersection(dsk_keys) */ __pyx_t_1 = PySet_New(__pyx_v_dsk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dsk_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3635 * # Removing all non-local keys before calling order() * dsk_keys = set(dsk) # intersection() of sets is much faster than dict_keys * stripped_deps = { # <<<<<<<<<<<<<< * k: v.intersection(dsk_keys) * for k, v in dependencies.items() */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3635, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":3637 * stripped_deps = { * k: v.intersection(dsk_keys) * for k, v in dependencies.items() # <<<<<<<<<<<<<< * if k in dsk_keys * } */ __pyx_t_9 = 0; if (unlikely(__pyx_v_dependencies == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3637, __pyx_L11_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_dependencies, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3637, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_8, &__pyx_t_9, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_4); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 3637, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3638 * k: v.intersection(dsk_keys) * for k, v in dependencies.items() * if k in dsk_keys # <<<<<<<<<<<<<< * } * priority = dask.order.order(dsk, dependencies=stripped_deps) */ __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_9genexpr37__pyx_v_k, __pyx_v_dsk_keys, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3638, __pyx_L11_error) __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":3636 * dsk_keys = set(dsk) # intersection() of sets is much faster than dict_keys * stripped_deps = { * k: v.intersection(dsk_keys) # <<<<<<<<<<<<<< * for k, v in dependencies.items() * if k in dsk_keys */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr37__pyx_v_v, __pyx_n_s_intersection); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3636, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_dsk_keys) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dsk_keys); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3636, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr37__pyx_v_k, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 3636, __pyx_L11_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3638 * k: v.intersection(dsk_keys) * for k, v in dependencies.items() * if k in dsk_keys # <<<<<<<<<<<<<< * } * priority = dask.order.order(dsk, dependencies=stripped_deps) */ } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_k); __pyx_9genexpr37__pyx_v_k = 0; __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_v); __pyx_9genexpr37__pyx_v_v = 0; goto __pyx_L15_exit_scope; __pyx_L11_error:; __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_k); __pyx_9genexpr37__pyx_v_k = 0; __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_v); __pyx_9genexpr37__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_v_stripped_deps = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3640 * if k in dsk_keys * } * priority = dask.order.order(dsk, dependencies=stripped_deps) # <<<<<<<<<<<<<< * * return self.update_graph( */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_order); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_order); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_dsk); __Pyx_GIVEREF(__pyx_v_dsk); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dsk); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dependencies, __pyx_v_stripped_deps) < 0) __PYX_ERR(0, 3640, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_priority, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3632 * dependencies[k] = deps * * if priority is None: # <<<<<<<<<<<<<< * # Removing all non-local keys before calling order() * dsk_keys = set(dsk) # intersection() of sets is much faster than dict_keys */ } /* "distributed/scheduler.py":3642 * priority = dask.order.order(dsk, dependencies=stripped_deps) * * return self.update_graph( # <<<<<<<<<<<<<< * client, * dsk, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_graph_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":3656 * actors, * fifo_timeout, * annotations, # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[15] = {__pyx_t_5, __pyx_v_client, __pyx_v_dsk, __pyx_v_keys, __pyx_v_dependencies, __pyx_v_restrictions, __pyx_v_priority, __pyx_v_loose_restrictions, __pyx_v_resources, __pyx_v_submitting_task, __pyx_v_retries, __pyx_v_user_priority, __pyx_v_actors, __pyx_v_fifo_timeout, __pyx_v_annotations}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 14+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3642, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[15] = {__pyx_t_5, __pyx_v_client, __pyx_v_dsk, __pyx_v_keys, __pyx_v_dependencies, __pyx_v_restrictions, __pyx_v_priority, __pyx_v_loose_restrictions, __pyx_v_resources, __pyx_v_submitting_task, __pyx_v_retries, __pyx_v_user_priority, __pyx_v_actors, __pyx_v_fifo_timeout, __pyx_v_annotations}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 14+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3642, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_1 = PyTuple_New(14+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_client); __Pyx_GIVEREF(__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_client); __Pyx_INCREF(__pyx_v_dsk); __Pyx_GIVEREF(__pyx_v_dsk); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_v_dsk); __Pyx_INCREF(__pyx_v_keys); __Pyx_GIVEREF(__pyx_v_keys); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_4, __pyx_v_keys); __Pyx_INCREF(__pyx_v_dependencies); __Pyx_GIVEREF(__pyx_v_dependencies); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_4, __pyx_v_dependencies); __Pyx_INCREF(__pyx_v_restrictions); __Pyx_GIVEREF(__pyx_v_restrictions); PyTuple_SET_ITEM(__pyx_t_1, 4+__pyx_t_4, __pyx_v_restrictions); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_1, 5+__pyx_t_4, __pyx_v_priority); __Pyx_INCREF(__pyx_v_loose_restrictions); __Pyx_GIVEREF(__pyx_v_loose_restrictions); PyTuple_SET_ITEM(__pyx_t_1, 6+__pyx_t_4, __pyx_v_loose_restrictions); __Pyx_INCREF(__pyx_v_resources); __Pyx_GIVEREF(__pyx_v_resources); PyTuple_SET_ITEM(__pyx_t_1, 7+__pyx_t_4, __pyx_v_resources); __Pyx_INCREF(__pyx_v_submitting_task); __Pyx_GIVEREF(__pyx_v_submitting_task); PyTuple_SET_ITEM(__pyx_t_1, 8+__pyx_t_4, __pyx_v_submitting_task); __Pyx_INCREF(__pyx_v_retries); __Pyx_GIVEREF(__pyx_v_retries); PyTuple_SET_ITEM(__pyx_t_1, 9+__pyx_t_4, __pyx_v_retries); __Pyx_INCREF(__pyx_v_user_priority); __Pyx_GIVEREF(__pyx_v_user_priority); PyTuple_SET_ITEM(__pyx_t_1, 10+__pyx_t_4, __pyx_v_user_priority); __Pyx_INCREF(__pyx_v_actors); __Pyx_GIVEREF(__pyx_v_actors); PyTuple_SET_ITEM(__pyx_t_1, 11+__pyx_t_4, __pyx_v_actors); __Pyx_INCREF(__pyx_v_fifo_timeout); __Pyx_GIVEREF(__pyx_v_fifo_timeout); PyTuple_SET_ITEM(__pyx_t_1, 12+__pyx_t_4, __pyx_v_fifo_timeout); __Pyx_INCREF(__pyx_v_annotations); __Pyx_GIVEREF(__pyx_v_annotations); PyTuple_SET_ITEM(__pyx_t_1, 13+__pyx_t_4, __pyx_v_annotations); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":3605 * await self.handle_worker(comm=comm, worker=address) * * def update_graph_hlg( # <<<<<<<<<<<<<< * self, * client=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph_hlg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dsk); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XDECREF(__pyx_v_deps); __Pyx_XDECREF(__pyx_v_dsk_keys); __Pyx_XDECREF(__pyx_v_stripped_deps); __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_k); __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_v); __Pyx_XDECREF(__pyx_v_dependencies); __Pyx_XDECREF(__pyx_v_priority); __Pyx_XDECREF(__pyx_v_annotations); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3659 * ) * * def update_graph( # <<<<<<<<<<<<<< * self, * client=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_25update_graph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_24update_graph[] = "\n Add new computations to the internal dask graph\n\n This happens whenever the Client calls submit, map, get, or compute.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_25update_graph = {"update_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_25update_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_24update_graph}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_25update_graph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_client = 0; PyObject *__pyx_v_tasks = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_dependencies = 0; PyObject *__pyx_v_restrictions = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_v_loose_restrictions = 0; PyObject *__pyx_v_resources = 0; PyObject *__pyx_v_submitting_task = 0; PyObject *__pyx_v_retries = 0; PyObject *__pyx_v_user_priority = 0; PyObject *__pyx_v_actors = 0; PyObject *__pyx_v_fifo_timeout = 0; PyObject *__pyx_v_annotations = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update_graph (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,&__pyx_n_s_tasks,&__pyx_n_s_keys,&__pyx_n_s_dependencies,&__pyx_n_s_restrictions,&__pyx_n_s_priority,&__pyx_n_s_loose_restrictions,&__pyx_n_s_resources,&__pyx_n_s_submitting_task,&__pyx_n_s_retries,&__pyx_n_s_user_priority,&__pyx_n_s_actors,&__pyx_n_s_fifo_timeout,&__pyx_n_s_annotations,0}; PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":3661 * def update_graph( * self, * client=None, # <<<<<<<<<<<<<< * tasks=None, * keys=None, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3662 * self, * client=None, * tasks=None, # <<<<<<<<<<<<<< * keys=None, * dependencies=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3663 * client=None, * tasks=None, * keys=None, # <<<<<<<<<<<<<< * dependencies=None, * restrictions=None, */ values[3] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3664 * tasks=None, * keys=None, * dependencies=None, # <<<<<<<<<<<<<< * restrictions=None, * priority=None, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3665 * keys=None, * dependencies=None, * restrictions=None, # <<<<<<<<<<<<<< * priority=None, * loose_restrictions=None, */ values[5] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3666 * dependencies=None, * restrictions=None, * priority=None, # <<<<<<<<<<<<<< * loose_restrictions=None, * resources=None, */ values[6] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3667 * restrictions=None, * priority=None, * loose_restrictions=None, # <<<<<<<<<<<<<< * resources=None, * submitting_task=None, */ values[7] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3668 * priority=None, * loose_restrictions=None, * resources=None, # <<<<<<<<<<<<<< * submitting_task=None, * retries=None, */ values[8] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3669 * loose_restrictions=None, * resources=None, * submitting_task=None, # <<<<<<<<<<<<<< * retries=None, * user_priority=0, */ values[9] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":3670 * resources=None, * submitting_task=None, * retries=None, # <<<<<<<<<<<<<< * user_priority=0, * actors=None, */ values[10] = ((PyObject *)((PyObject *)Py_None)); values[11] = ((PyObject *)((PyObject *)__pyx_int_0)); /* "distributed/scheduler.py":3672 * retries=None, * user_priority=0, * actors=None, # <<<<<<<<<<<<<< * fifo_timeout=0, * annotations=None, */ values[12] = ((PyObject *)((PyObject *)Py_None)); values[13] = ((PyObject *)((PyObject *)__pyx_int_0)); /* "distributed/scheduler.py":3674 * actors=None, * fifo_timeout=0, * annotations=None, # <<<<<<<<<<<<<< * ): * """ */ values[14] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tasks); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dependencies); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_restrictions); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loose_restrictions); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resources); if (value) { values[8] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submitting_task); if (value) { values[9] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_retries); if (value) { values[10] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user_priority); if (value) { values[11] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_actors); if (value) { values[12] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fifo_timeout); if (value) { values[13] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_annotations); if (value) { values[14] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_graph") < 0)) __PYX_ERR(0, 3659, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_client = values[1]; __pyx_v_tasks = values[2]; __pyx_v_keys = values[3]; __pyx_v_dependencies = values[4]; __pyx_v_restrictions = values[5]; __pyx_v_priority = values[6]; __pyx_v_loose_restrictions = values[7]; __pyx_v_resources = values[8]; __pyx_v_submitting_task = values[9]; __pyx_v_retries = values[10]; __pyx_v_user_priority = values[11]; __pyx_v_actors = values[12]; __pyx_v_fifo_timeout = values[13]; __pyx_v_annotations = values[14]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update_graph", 0, 1, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3659, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_24update_graph(__pyx_self, __pyx_v_self, __pyx_v_client, __pyx_v_tasks, __pyx_v_keys, __pyx_v_dependencies, __pyx_v_restrictions, __pyx_v_priority, __pyx_v_loose_restrictions, __pyx_v_resources, __pyx_v_submitting_task, __pyx_v_retries, __pyx_v_user_priority, __pyx_v_actors, __pyx_v_fifo_timeout, __pyx_v_annotations); /* "distributed/scheduler.py":3659 * ) * * def update_graph( # <<<<<<<<<<<<<< * self, * client=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_2generator29(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":3702 * for k, deps in list(dependencies.items()): * if any( * dep not in parent._tasks and dep not in tasks for dep in deps # <<<<<<<<<<<<<< * ): # bad key * logger.info("User asked for computation on lost data, %s", k) */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_14_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 3702, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_2generator29, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_update_graph_locals_ge, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 3702, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_2generator29(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3702, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deps)) { __Pyx_RaiseClosureNameError("deps"); __PYX_ERR(0, 3702, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deps)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deps)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_deps; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3702, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3702, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3702, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3702, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_dep); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_dep, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parent)) { __Pyx_RaiseClosureNameError("parent"); __PYX_ERR(0, 3702, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 3702, __pyx_L1_error) } __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_dep, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_parent->_tasks, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3702, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tasks)) { __Pyx_RaiseClosureNameError("tasks"); __PYX_ERR(0, 3702, __pyx_L1_error) } __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_dep, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tasks, Py_NE)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3702, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); __pyx_t_5 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { /* "distributed/scheduler.py":3701 * n = len(tasks) * for k, deps in list(dependencies.items()): * if any( # <<<<<<<<<<<<<< * dep not in parent._tasks and dep not in tasks for dep in deps * ): # bad key */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":3702 * for k, deps in list(dependencies.items()): * if any( * dep not in parent._tasks and dep not in tasks for dep in deps # <<<<<<<<<<<<<< * ): # bad key * logger.info("User asked for computation on lost data, %s", k) */ __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } } /*else*/ { /* "distributed/scheduler.py":3701 * n = len(tasks) * for k, deps in list(dependencies.items()): * if any( # <<<<<<<<<<<<<< * dep not in parent._tasks and dep not in tasks for dep in deps * ): # bad key */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":3702 * for k, deps in list(dependencies.items()): * if any( * dep not in parent._tasks and dep not in tasks for dep in deps # <<<<<<<<<<<<<< * ): # bad key * logger.info("User asked for computation on lost data, %s", k) */ __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_5generator30(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":3738 * else: * child_deps = self.dependencies[dep] * if all(d in done for d in child_deps): # <<<<<<<<<<<<<< * if dep in parent._tasks and dep not in done: * done.add(dep) */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_3genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_15_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_15_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 3738, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_5generator30, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_update_graph_locals_ge, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 3738, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_5generator30(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3738, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_child_deps)) { __Pyx_RaiseClosureNameError("child_deps"); __PYX_ERR(0, 3738, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_child_deps)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_child_deps)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_child_deps; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_child_deps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3738, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3738, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3738, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3738, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_d); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_done)) { __Pyx_RaiseClosureNameError("done"); __PYX_ERR(0, 3738, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_done == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 3738, __pyx_L1_error) } __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_cur_scope->__pyx_v_d, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_done, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3738, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0); if (__pyx_t_6) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } } /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_8generator31(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":3797 * if "allow_other_workers" in annotations: * loose_restrictions.extend( * k for k, v in annotations["allow_other_workers"].items() if v # <<<<<<<<<<<<<< * ) * */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_6genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_16_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_16_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 3797, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_8generator31, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_update_graph_locals_ge, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 3797, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_12update_graph_8generator31(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L7_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3797, __pyx_L1_error) __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_annotations)) { __Pyx_RaiseClosureNameError("annotations"); __PYX_ERR(0, 3797, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_annotations, __pyx_n_u_allow_other_workers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_t_5 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3797, __pyx_L1_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 3797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_v); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3797, __pyx_L1_error) if (__pyx_t_8) { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_k); __pyx_r = __pyx_cur_scope->__pyx_v_k; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3797, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3659 * ) * * def update_graph( # <<<<<<<<<<<<<< * self, * client=None, */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_24update_graph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_tasks, PyObject *__pyx_v_keys, PyObject *__pyx_v_dependencies, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_priority, PyObject *__pyx_v_loose_restrictions, PyObject *__pyx_v_resources, PyObject *__pyx_v_submitting_task, PyObject *__pyx_v_retries, PyObject *__pyx_v_user_priority, PyObject *__pyx_v_actors, PyObject *__pyx_v_fifo_timeout, PyObject *__pyx_v_annotations) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *__pyx_cur_scope; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_k = NULL; Py_ssize_t __pyx_v_n; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_already_in_memory = NULL; PyObject *__pyx_v_v = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_dependents = NULL; PyObject *__pyx_v_stack = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_dep = NULL; PyObject *__pyx_v_d = NULL; PyObject *__pyx_v_touched_keys = NULL; PyObject *__pyx_v_touched_tasks = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_v_kv = NULL; PyObject *__pyx_v_actor = NULL; PyObject *__pyx_v_generation = NULL; PyObject *__pyx_v_runnables = NULL; PyObject *__pyx_v_w = NULL; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_plugin = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_end = NULL; PyObject *__pyx_9genexpr40__pyx_v_k = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr42__pyx_v_ts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); Py_ssize_t __pyx_t_12; int __pyx_t_13; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *(*__pyx_t_20)(PyObject *); Py_ssize_t __pyx_t_21; Py_ssize_t __pyx_t_22; int __pyx_t_23; PyObject *__pyx_t_24 = NULL; char const *__pyx_t_25; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; PyObject *__pyx_t_29 = NULL; PyObject *__pyx_t_30 = NULL; PyObject *__pyx_t_31 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update_graph", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_13_update_graph(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_13_update_graph, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 3659, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_tasks = __pyx_v_tasks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tasks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tasks); __pyx_cur_scope->__pyx_v_annotations = __pyx_v_annotations; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_annotations); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_annotations); __Pyx_INCREF(__pyx_v_keys); __Pyx_INCREF(__pyx_v_dependencies); __Pyx_INCREF(__pyx_v_restrictions); __Pyx_INCREF(__pyx_v_priority); __Pyx_INCREF(__pyx_v_loose_restrictions); __Pyx_INCREF(__pyx_v_resources); __Pyx_INCREF(__pyx_v_retries); __Pyx_INCREF(__pyx_v_user_priority); __Pyx_INCREF(__pyx_v_actors); __Pyx_INCREF(__pyx_v_fifo_timeout); /* "distributed/scheduler.py":3681 * This happens whenever the Client calls submit, map, get, or compute. * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * start = time() * fifo_timeout = parse_timedelta(fifo_timeout) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3682 * """ * parent: SchedulerState = cast(SchedulerState, self) * start = time() # <<<<<<<<<<<<<< * fifo_timeout = parse_timedelta(fifo_timeout) * keys = set(keys) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_start = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":3683 * parent: SchedulerState = cast(SchedulerState, self) * start = time() * fifo_timeout = parse_timedelta(fifo_timeout) # <<<<<<<<<<<<<< * keys = set(keys) * if len(tasks) > 1: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_fifo_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_fifo_timeout); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_fifo_timeout, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3684 * start = time() * fifo_timeout = parse_timedelta(fifo_timeout) * keys = set(keys) # <<<<<<<<<<<<<< * if len(tasks) > 1: * self.log_event( */ __pyx_t_1 = PySet_New(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3685 * fifo_timeout = parse_timedelta(fifo_timeout) * keys = set(keys) * if len(tasks) > 1: # <<<<<<<<<<<<<< * self.log_event( * ["all", client], {"action": "update_graph", "count": len(tasks)} */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_tasks; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = ((__pyx_t_4 > 1) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3686 * keys = set(keys) * if len(tasks) > 1: * self.log_event( # <<<<<<<<<<<<<< * ["all", client], {"action": "update_graph", "count": len(tasks)} * ) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":3687 * if len(tasks) > 1: * self.log_event( * ["all", client], {"action": "update_graph", "count": len(tasks)} # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_all); __Pyx_INCREF(__pyx_v_client); __Pyx_GIVEREF(__pyx_v_client); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_client); __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_action, __pyx_n_u_update_graph_2) < 0) __PYX_ERR(0, 3687, __pyx_L1_error) __pyx_t_7 = __pyx_cur_scope->__pyx_v_tasks; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_count, __pyx_t_7) < 0) __PYX_ERR(0, 3687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_3, __pyx_t_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3686, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_3, __pyx_t_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3686, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3685 * fifo_timeout = parse_timedelta(fifo_timeout) * keys = set(keys) * if len(tasks) > 1: # <<<<<<<<<<<<<< * self.log_event( * ["all", client], {"action": "update_graph", "count": len(tasks)} */ } /* "distributed/scheduler.py":3691 * * # Remove aliases * for k in list(tasks): # <<<<<<<<<<<<<< * if tasks[k] is k: * del tasks[k] */ __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3691, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3692 * # Remove aliases * for k in list(tasks): * if tasks[k] is k: # <<<<<<<<<<<<<< * del tasks[k] * */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_tasks, __pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = (__pyx_t_1 == __pyx_v_k); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = (__pyx_t_5 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3693 * for k in list(tasks): * if tasks[k] is k: * del tasks[k] # <<<<<<<<<<<<<< * * dependencies = dependencies or {} */ if (unlikely(PyObject_DelItem(__pyx_cur_scope->__pyx_v_tasks, __pyx_v_k) < 0)) __PYX_ERR(0, 3693, __pyx_L1_error) /* "distributed/scheduler.py":3692 * # Remove aliases * for k in list(tasks): * if tasks[k] is k: # <<<<<<<<<<<<<< * del tasks[k] * */ } /* "distributed/scheduler.py":3691 * * # Remove aliases * for k in list(tasks): # <<<<<<<<<<<<<< * if tasks[k] is k: * del tasks[k] */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3695 * del tasks[k] * * dependencies = dependencies or {} # <<<<<<<<<<<<<< * * n = 0 */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_dependencies); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3695, __pyx_L1_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_v_dependencies); __pyx_t_2 = __pyx_v_dependencies; goto __pyx_L7_bool_binop_done; } __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_L7_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_dependencies, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3697 * dependencies = dependencies or {} * * n = 0 # <<<<<<<<<<<<<< * while len(tasks) != n: # walk through new tasks, cancel any bad deps * n = len(tasks) */ __pyx_v_n = 0; /* "distributed/scheduler.py":3698 * * n = 0 * while len(tasks) != n: # walk through new tasks, cancel any bad deps # <<<<<<<<<<<<<< * n = len(tasks) * for k, deps in list(dependencies.items()): */ while (1) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_tasks; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = ((__pyx_t_4 != __pyx_v_n) != 0); if (!__pyx_t_10) break; /* "distributed/scheduler.py":3699 * n = 0 * while len(tasks) != n: # walk through new tasks, cancel any bad deps * n = len(tasks) # <<<<<<<<<<<<<< * for k, deps in list(dependencies.items()): * if any( */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_tasks; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3699, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_n = __pyx_t_4; /* "distributed/scheduler.py":3700 * while len(tasks) != n: # walk through new tasks, cancel any bad deps * n = len(tasks) * for k, deps in list(dependencies.items()): # <<<<<<<<<<<<<< * if any( * dep not in parent._tasks and dep not in tasks for dep in deps */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependencies, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3700, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 3700, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_6 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_3), 2) < 0) __PYX_ERR(0, 3700, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L14_unpacking_done; __pyx_L13_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 3700, __pyx_L1_error) __pyx_L14_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_deps); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_deps, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3702 * for k, deps in list(dependencies.items()): * if any( * dep not in parent._tasks and dep not in tasks for dep in deps # <<<<<<<<<<<<<< * ): # bad key * logger.info("User asked for computation on lost data, %s", k) */ __pyx_t_1 = __pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3702, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3701 * n = len(tasks) * for k, deps in list(dependencies.items()): * if any( # <<<<<<<<<<<<<< * dep not in parent._tasks and dep not in tasks for dep in deps * ): # bad key */ if (__pyx_t_10) { /* "distributed/scheduler.py":3704 * dep not in parent._tasks and dep not in tasks for dep in deps * ): # bad key * logger.info("User asked for computation on lost data, %s", k) # <<<<<<<<<<<<<< * del tasks[k] * del dependencies[k] */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_User_asked_for_computation_on_lo, __pyx_v_k}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3704, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_User_asked_for_computation_on_lo, __pyx_v_k}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3704, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_User_asked_for_computation_on_lo); __Pyx_GIVEREF(__pyx_kp_u_User_asked_for_computation_on_lo); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_kp_u_User_asked_for_computation_on_lo); __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_k); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3705 * ): # bad key * logger.info("User asked for computation on lost data, %s", k) * del tasks[k] # <<<<<<<<<<<<<< * del dependencies[k] * if k in keys: */ if (unlikely(PyObject_DelItem(__pyx_cur_scope->__pyx_v_tasks, __pyx_v_k) < 0)) __PYX_ERR(0, 3705, __pyx_L1_error) /* "distributed/scheduler.py":3706 * logger.info("User asked for computation on lost data, %s", k) * del tasks[k] * del dependencies[k] # <<<<<<<<<<<<<< * if k in keys: * keys.remove(k) */ if (unlikely(PyObject_DelItem(__pyx_v_dependencies, __pyx_v_k) < 0)) __PYX_ERR(0, 3706, __pyx_L1_error) /* "distributed/scheduler.py":3707 * del tasks[k] * del dependencies[k] * if k in keys: # <<<<<<<<<<<<<< * keys.remove(k) * self.report({"op": "cancelled-key", "key": k}, client=client) */ __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_keys, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3707, __pyx_L1_error) __pyx_t_5 = (__pyx_t_10 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3708 * del dependencies[k] * if k in keys: * keys.remove(k) # <<<<<<<<<<<<<< * self.report({"op": "cancelled-key", "key": k}, client=client) * self.client_releases_keys(keys=[k], client=client) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_keys, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_k); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3707 * del tasks[k] * del dependencies[k] * if k in keys: # <<<<<<<<<<<<<< * keys.remove(k) * self.report({"op": "cancelled-key", "key": k}, client=client) */ } /* "distributed/scheduler.py":3709 * if k in keys: * keys.remove(k) * self.report({"op": "cancelled-key", "key": k}, client=client) # <<<<<<<<<<<<<< * self.client_releases_keys(keys=[k], client=client) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_report); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_op, __pyx_kp_u_cancelled_key) < 0) __PYX_ERR(0, 3709, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_key, __pyx_v_k) < 0) __PYX_ERR(0, 3709, __pyx_L1_error) __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 3709, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3710 * keys.remove(k) * self.report({"op": "cancelled-key", "key": k}, client=client) * self.client_releases_keys(keys=[k], client=client) # <<<<<<<<<<<<<< * * # Avoid computation that is already finished */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_releases_keys_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_k); if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_keys, __pyx_t_3) < 0) __PYX_ERR(0, 3710, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 3710, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3701 * n = len(tasks) * for k, deps in list(dependencies.items()): * if any( # <<<<<<<<<<<<<< * dep not in parent._tasks and dep not in tasks for dep in deps * ): # bad key */ } /* "distributed/scheduler.py":3700 * while len(tasks) != n: # walk through new tasks, cancel any bad deps * n = len(tasks) * for k, deps in list(dependencies.items()): # <<<<<<<<<<<<<< * if any( * dep not in parent._tasks and dep not in tasks for dep in deps */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "distributed/scheduler.py":3714 * # Avoid computation that is already finished * ts: TaskState * already_in_memory = set() # tasks that are already done # <<<<<<<<<<<<<< * for k, v in dependencies.items(): * if v and k in parent._tasks: */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_already_in_memory = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3715 * ts: TaskState * already_in_memory = set() # tasks that are already done * for k, v in dependencies.items(): # <<<<<<<<<<<<<< * if v and k in parent._tasks: * ts = parent._tasks[k] */ __pyx_t_4 = 0; if (unlikely(__pyx_v_dependencies == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3715, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_dependencies, 0, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_12, &__pyx_t_4, &__pyx_t_3, &__pyx_t_9, NULL, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3716 * already_in_memory = set() # tasks that are already done * for k, v in dependencies.items(): * if v and k in parent._tasks: # <<<<<<<<<<<<<< * ts = parent._tasks[k] * if ts._state in ("memory", "erred"): */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3716, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_5 = __pyx_t_10; goto __pyx_L20_bool_binop_done; } if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 3716, __pyx_L1_error) } __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_k, __pyx_cur_scope->__pyx_v_parent->_tasks, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3716, __pyx_L1_error) __pyx_t_14 = (__pyx_t_10 != 0); __pyx_t_5 = __pyx_t_14; __pyx_L20_bool_binop_done:; if (__pyx_t_5) { /* "distributed/scheduler.py":3717 * for k, v in dependencies.items(): * if v and k in parent._tasks: * ts = parent._tasks[k] # <<<<<<<<<<<<<< * if ts._state in ("memory", "erred"): * already_in_memory.add(k) */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3717, __pyx_L1_error) } __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_k); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3717, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":3718 * if v and k in parent._tasks: * ts = parent._tasks[k] * if ts._state in ("memory", "erred"): # <<<<<<<<<<<<<< * already_in_memory.add(k) * */ __Pyx_INCREF(__pyx_v_ts->_state); __pyx_t_15 = __pyx_v_ts->_state; __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_15, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 3718, __pyx_L1_error) __pyx_t_10 = (__pyx_t_14 != 0); if (!__pyx_t_10) { } else { __pyx_t_5 = __pyx_t_10; goto __pyx_L23_bool_binop_done; } __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_15, __pyx_n_u_erred, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3718, __pyx_L1_error) __pyx_t_14 = (__pyx_t_10 != 0); __pyx_t_5 = __pyx_t_14; __pyx_L23_bool_binop_done:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_14 = (__pyx_t_5 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3719 * ts = parent._tasks[k] * if ts._state in ("memory", "erred"): * already_in_memory.add(k) # <<<<<<<<<<<<<< * * dts: TaskState */ __pyx_t_16 = PySet_Add(__pyx_v_already_in_memory, __pyx_v_k); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3719, __pyx_L1_error) /* "distributed/scheduler.py":3718 * if v and k in parent._tasks: * ts = parent._tasks[k] * if ts._state in ("memory", "erred"): # <<<<<<<<<<<<<< * already_in_memory.add(k) * */ } /* "distributed/scheduler.py":3716 * already_in_memory = set() # tasks that are already done * for k, v in dependencies.items(): * if v and k in parent._tasks: # <<<<<<<<<<<<<< * ts = parent._tasks[k] * if ts._state in ("memory", "erred"): */ } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3722 * * dts: TaskState * if already_in_memory: # <<<<<<<<<<<<<< * dependents = dask.core.reverse_dict(dependencies) * stack = list(already_in_memory) */ __pyx_t_14 = (PySet_GET_SIZE(__pyx_v_already_in_memory) != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3723 * dts: TaskState * if already_in_memory: * dependents = dask.core.reverse_dict(dependencies) # <<<<<<<<<<<<<< * stack = list(already_in_memory) * done = set(already_in_memory) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_dask); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reverse_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_dependencies) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_dependencies); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_dependents = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":3724 * if already_in_memory: * dependents = dask.core.reverse_dict(dependencies) * stack = list(already_in_memory) # <<<<<<<<<<<<<< * done = set(already_in_memory) * while stack: # remove unnecessary dependencies */ __pyx_t_2 = PySequence_List(__pyx_v_already_in_memory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_stack = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3725 * dependents = dask.core.reverse_dict(dependencies) * stack = list(already_in_memory) * done = set(already_in_memory) # <<<<<<<<<<<<<< * while stack: # remove unnecessary dependencies * key = stack.pop() */ __pyx_t_2 = PySet_New(__pyx_v_already_in_memory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_done = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3726 * stack = list(already_in_memory) * done = set(already_in_memory) * while stack: # remove unnecessary dependencies # <<<<<<<<<<<<<< * key = stack.pop() * ts = parent._tasks[key] */ while (1) { __pyx_t_14 = (PyList_GET_SIZE(__pyx_v_stack) != 0); if (!__pyx_t_14) break; /* "distributed/scheduler.py":3727 * done = set(already_in_memory) * while stack: # remove unnecessary dependencies * key = stack.pop() # <<<<<<<<<<<<<< * ts = parent._tasks[key] * try: */ __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3728 * while stack: # remove unnecessary dependencies * key = stack.pop() * ts = parent._tasks[key] # <<<<<<<<<<<<<< * try: * deps = dependencies[key] */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3728, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3728, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":3729 * key = stack.pop() * ts = parent._tasks[key] * try: # <<<<<<<<<<<<<< * deps = dependencies[key] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); /*try:*/ { /* "distributed/scheduler.py":3730 * ts = parent._tasks[key] * try: * deps = dependencies[key] # <<<<<<<<<<<<<< * except KeyError: * deps = self.dependencies[key] */ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_dependencies, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3730, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_deps); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_deps, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3729 * key = stack.pop() * ts = parent._tasks[key] * try: # <<<<<<<<<<<<<< * deps = dependencies[key] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L35_try_end; __pyx_L28_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3731 * try: * deps = dependencies[key] * except KeyError: # <<<<<<<<<<<<<< * deps = self.dependencies[key] * for dep in deps: */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 3731, __pyx_L30_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":3732 * deps = dependencies[key] * except KeyError: * deps = self.dependencies[key] # <<<<<<<<<<<<<< * for dep in deps: * if dep in dependents: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dependencies); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3732, __pyx_L30_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3732, __pyx_L30_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_deps); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_deps, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L29_exception_handled; } goto __pyx_L30_except_error; __pyx_L30_except_error:; /* "distributed/scheduler.py":3729 * key = stack.pop() * ts = parent._tasks[key] * try: # <<<<<<<<<<<<<< * deps = dependencies[key] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); goto __pyx_L1_error; __pyx_L29_exception_handled:; __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_L35_try_end:; } /* "distributed/scheduler.py":3733 * except KeyError: * deps = self.dependencies[key] * for dep in deps: # <<<<<<<<<<<<<< * if dep in dependents: * child_deps = dependents[dep] */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_deps)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_deps)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_deps; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0; __pyx_t_20 = NULL; } else { __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_deps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3733, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3733, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3733, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3733, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF_SET(__pyx_v_dep, __pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3734 * deps = self.dependencies[key] * for dep in deps: * if dep in dependents: # <<<<<<<<<<<<<< * child_deps = dependents[dep] * else: */ __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_dep, __pyx_v_dependents, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 3734, __pyx_L1_error) __pyx_t_5 = (__pyx_t_14 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3735 * for dep in deps: * if dep in dependents: * child_deps = dependents[dep] # <<<<<<<<<<<<<< * else: * child_deps = self.dependencies[dep] */ __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_dependents, __pyx_v_dep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_child_deps); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_child_deps, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3734 * deps = self.dependencies[key] * for dep in deps: * if dep in dependents: # <<<<<<<<<<<<<< * child_deps = dependents[dep] * else: */ goto __pyx_L40; } /* "distributed/scheduler.py":3737 * child_deps = dependents[dep] * else: * child_deps = self.dependencies[dep] # <<<<<<<<<<<<<< * if all(d in done for d in child_deps): * if dep in parent._tasks and dep not in done: */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dependencies); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_dep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_child_deps); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_child_deps, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L40:; /* "distributed/scheduler.py":3738 * else: * child_deps = self.dependencies[dep] * if all(d in done for d in child_deps): # <<<<<<<<<<<<<< * if dep in parent._tasks and dep not in done: * done.add(dep) */ __pyx_t_2 = __pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3738, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":3739 * child_deps = self.dependencies[dep] * if all(d in done for d in child_deps): * if dep in parent._tasks and dep not in done: # <<<<<<<<<<<<<< * done.add(dep) * stack.append(dep) */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 3739, __pyx_L1_error) } __pyx_t_14 = (__Pyx_PyDict_ContainsTF(__pyx_v_dep, __pyx_cur_scope->__pyx_v_parent->_tasks, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 3739, __pyx_L1_error) __pyx_t_10 = (__pyx_t_14 != 0); if (__pyx_t_10) { } else { __pyx_t_5 = __pyx_t_10; goto __pyx_L43_bool_binop_done; } __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_dep, __pyx_cur_scope->__pyx_v_done, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3739, __pyx_L1_error) __pyx_t_14 = (__pyx_t_10 != 0); __pyx_t_5 = __pyx_t_14; __pyx_L43_bool_binop_done:; if (__pyx_t_5) { /* "distributed/scheduler.py":3740 * if all(d in done for d in child_deps): * if dep in parent._tasks and dep not in done: * done.add(dep) # <<<<<<<<<<<<<< * stack.append(dep) * */ __pyx_t_16 = PySet_Add(__pyx_cur_scope->__pyx_v_done, __pyx_v_dep); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3740, __pyx_L1_error) /* "distributed/scheduler.py":3741 * if dep in parent._tasks and dep not in done: * done.add(dep) * stack.append(dep) # <<<<<<<<<<<<<< * * for d in done: */ __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_stack, __pyx_v_dep); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3741, __pyx_L1_error) /* "distributed/scheduler.py":3739 * child_deps = self.dependencies[dep] * if all(d in done for d in child_deps): * if dep in parent._tasks and dep not in done: # <<<<<<<<<<<<<< * done.add(dep) * stack.append(dep) */ } /* "distributed/scheduler.py":3738 * else: * child_deps = self.dependencies[dep] * if all(d in done for d in child_deps): # <<<<<<<<<<<<<< * if dep in parent._tasks and dep not in done: * done.add(dep) */ } /* "distributed/scheduler.py":3733 * except KeyError: * deps = self.dependencies[key] * for dep in deps: # <<<<<<<<<<<<<< * if dep in dependents: * child_deps = dependents[dep] */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "distributed/scheduler.py":3743 * stack.append(dep) * * for d in done: # <<<<<<<<<<<<<< * tasks.pop(d, None) * dependencies.pop(d, None) */ __pyx_t_12 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_done, 1, (&__pyx_t_4), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_13 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_4, &__pyx_t_12, &__pyx_t_9, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3744 * * for d in done: * tasks.pop(d, None) # <<<<<<<<<<<<<< * dependencies.pop(d, None) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tasks, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_13 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_13 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_d, Py_None}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3744, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_d, Py_None}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3744, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_13, __pyx_v_d); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_13, Py_None); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3745 * for d in done: * tasks.pop(d, None) * dependencies.pop(d, None) # <<<<<<<<<<<<<< * * # Get or create task states */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependencies, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_13 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_13 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_d, Py_None}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3745, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_d, Py_None}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3745, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_13, __pyx_v_d); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_13, Py_None); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3722 * * dts: TaskState * if already_in_memory: # <<<<<<<<<<<<<< * dependents = dask.core.reverse_dict(dependencies) * stack = list(already_in_memory) */ } /* "distributed/scheduler.py":3748 * * # Get or create task states * stack = list(keys) # <<<<<<<<<<<<<< * touched_keys = set() * touched_tasks = [] */ __pyx_t_3 = PySequence_List(__pyx_v_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_stack, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":3749 * # Get or create task states * stack = list(keys) * touched_keys = set() # <<<<<<<<<<<<<< * touched_tasks = [] * while stack: */ __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_touched_keys = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3750 * stack = list(keys) * touched_keys = set() * touched_tasks = [] # <<<<<<<<<<<<<< * while stack: * k = stack.pop() */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_touched_tasks = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3751 * touched_keys = set() * touched_tasks = [] * while stack: # <<<<<<<<<<<<<< * k = stack.pop() * if k in touched_keys: */ while (1) { __pyx_t_5 = (PyList_GET_SIZE(__pyx_v_stack) != 0); if (!__pyx_t_5) break; /* "distributed/scheduler.py":3752 * touched_tasks = [] * while stack: * k = stack.pop() # <<<<<<<<<<<<<< * if k in touched_keys: * continue */ __pyx_t_3 = __Pyx_PyList_Pop(__pyx_v_stack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3753 * while stack: * k = stack.pop() * if k in touched_keys: # <<<<<<<<<<<<<< * continue * # XXX Have a method get_task_state(self, k) ? */ __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_v_k, __pyx_v_touched_keys, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3753, __pyx_L1_error) __pyx_t_14 = (__pyx_t_5 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3754 * k = stack.pop() * if k in touched_keys: * continue # <<<<<<<<<<<<<< * # XXX Have a method get_task_state(self, k) ? * ts = parent._tasks.get(k) */ goto __pyx_L47_continue; /* "distributed/scheduler.py":3753 * while stack: * k = stack.pop() * if k in touched_keys: # <<<<<<<<<<<<<< * continue * # XXX Have a method get_task_state(self, k) ? */ } /* "distributed/scheduler.py":3756 * continue * # XXX Have a method get_task_state(self, k) ? * ts = parent._tasks.get(k) # <<<<<<<<<<<<<< * if ts is None: * ts = self.new_task(k, tasks.get(k), "released") */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3756, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_k, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3756, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":3757 * # XXX Have a method get_task_state(self, k) ? * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * ts = self.new_task(k, tasks.get(k), "released") * elif not ts._run_spec: */ __pyx_t_14 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_5 = (__pyx_t_14 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3758 * ts = parent._tasks.get(k) * if ts is None: * ts = self.new_task(k, tasks.get(k), "released") # <<<<<<<<<<<<<< * elif not ts._run_spec: * ts._run_spec = tasks.get(k) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_new_task); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tasks, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_k); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_k, __pyx_t_2, __pyx_n_u_released}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3758, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_k, __pyx_t_2, __pyx_n_u_released}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3758, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_1 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_v_k); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_n_u_released); __Pyx_GIVEREF(__pyx_n_u_released); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_8, __pyx_n_u_released); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3758, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":3757 * # XXX Have a method get_task_state(self, k) ? * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * ts = self.new_task(k, tasks.get(k), "released") * elif not ts._run_spec: */ goto __pyx_L50; } /* "distributed/scheduler.py":3759 * if ts is None: * ts = self.new_task(k, tasks.get(k), "released") * elif not ts._run_spec: # <<<<<<<<<<<<<< * ts._run_spec = tasks.get(k) * */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3759, __pyx_L1_error) __pyx_t_14 = ((!__pyx_t_5) != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3760 * ts = self.new_task(k, tasks.get(k), "released") * elif not ts._run_spec: * ts._run_spec = tasks.get(k) # <<<<<<<<<<<<<< * * touched_keys.add(k) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tasks, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_1, __pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_k); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_ts->_run_spec); __Pyx_DECREF(__pyx_v_ts->_run_spec); __pyx_v_ts->_run_spec = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":3759 * if ts is None: * ts = self.new_task(k, tasks.get(k), "released") * elif not ts._run_spec: # <<<<<<<<<<<<<< * ts._run_spec = tasks.get(k) * */ } __pyx_L50:; /* "distributed/scheduler.py":3762 * ts._run_spec = tasks.get(k) * * touched_keys.add(k) # <<<<<<<<<<<<<< * touched_tasks.append(ts) * stack.extend(dependencies.get(k, ())) */ __pyx_t_16 = PySet_Add(__pyx_v_touched_keys, __pyx_v_k); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3762, __pyx_L1_error) /* "distributed/scheduler.py":3763 * * touched_keys.add(k) * touched_tasks.append(ts) # <<<<<<<<<<<<<< * stack.extend(dependencies.get(k, ())) * */ __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_touched_tasks, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3763, __pyx_L1_error) /* "distributed/scheduler.py":3764 * touched_keys.add(k) * touched_tasks.append(ts) * stack.extend(dependencies.get(k, ())) # <<<<<<<<<<<<<< * * self.client_desires_keys(keys=keys, client=client) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependencies, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_k, __pyx_empty_tuple}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3764, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_k, __pyx_empty_tuple}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3764, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_v_k); __Pyx_INCREF(__pyx_empty_tuple); __Pyx_GIVEREF(__pyx_empty_tuple); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_empty_tuple); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_16 = __Pyx_PyList_Extend(__pyx_v_stack, __pyx_t_3); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L47_continue:; } /* "distributed/scheduler.py":3766 * stack.extend(dependencies.get(k, ())) * * self.client_desires_keys(keys=keys, client=client) # <<<<<<<<<<<<<< * * # Add dependencies */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_desires_keys_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_keys, __pyx_v_keys) < 0) __PYX_ERR(0, 3766, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 3766, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3769 * * # Add dependencies * for key, deps in dependencies.items(): # <<<<<<<<<<<<<< * ts = parent._tasks.get(key) * if ts is None or ts._dependencies: */ __pyx_t_4 = 0; if (unlikely(__pyx_v_dependencies == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3769, __pyx_L1_error) } __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_dependencies, 0, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_12, &__pyx_t_4, &__pyx_t_9, &__pyx_t_3, NULL, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_deps); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_deps, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3770 * # Add dependencies * for key, deps in dependencies.items(): * ts = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is None or ts._dependencies: * continue */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3770, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3770, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":3771 * for key, deps in dependencies.items(): * ts = parent._tasks.get(key) * if ts is None or ts._dependencies: # <<<<<<<<<<<<<< * continue * for dep in deps: */ __pyx_t_5 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_10 = (__pyx_t_5 != 0); if (!__pyx_t_10) { } else { __pyx_t_14 = __pyx_t_10; goto __pyx_L54_bool_binop_done; } __pyx_t_10 = (__pyx_v_ts->_dependencies != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_dependencies) != 0); __pyx_t_14 = __pyx_t_10; __pyx_L54_bool_binop_done:; if (__pyx_t_14) { /* "distributed/scheduler.py":3772 * ts = parent._tasks.get(key) * if ts is None or ts._dependencies: * continue # <<<<<<<<<<<<<< * for dep in deps: * dts = parent._tasks[dep] */ goto __pyx_L51_continue; /* "distributed/scheduler.py":3771 * for key, deps in dependencies.items(): * ts = parent._tasks.get(key) * if ts is None or ts._dependencies: # <<<<<<<<<<<<<< * continue * for dep in deps: */ } /* "distributed/scheduler.py":3773 * if ts is None or ts._dependencies: * continue * for dep in deps: # <<<<<<<<<<<<<< * dts = parent._tasks[dep] * ts.add_dependency(dts) */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_deps)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_deps)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_deps; __Pyx_INCREF(__pyx_t_3); __pyx_t_21 = 0; __pyx_t_20 = NULL; } else { __pyx_t_21 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_deps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3773, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_21); __Pyx_INCREF(__pyx_t_9); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 3773, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_21 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_21); __Pyx_INCREF(__pyx_t_9); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 3773, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3773, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF_SET(__pyx_v_dep, __pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3774 * continue * for dep in deps: * dts = parent._tasks[dep] # <<<<<<<<<<<<<< * ts.add_dependency(dts) * */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3774, __pyx_L1_error) } __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_dep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3774, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":3775 * for dep in deps: * dts = parent._tasks[dep] * ts.add_dependency(dts) # <<<<<<<<<<<<<< * * # Compute priorities */ __pyx_t_9 = __pyx_f_11distributed_9scheduler_9TaskState_add_dependency(__pyx_v_ts, __pyx_v_dts, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3773 * if ts is None or ts._dependencies: * continue * for dep in deps: # <<<<<<<<<<<<<< * dts = parent._tasks[dep] * ts.add_dependency(dts) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L51_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3778 * * # Compute priorities * if isinstance(user_priority, Number): # <<<<<<<<<<<<<< * user_priority = {k: user_priority for k in tasks} * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = PyObject_IsInstance(__pyx_v_user_priority, __pyx_t_2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 3778, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = (__pyx_t_14 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3779 * # Compute priorities * if isinstance(user_priority, Number): * user_priority = {k: user_priority for k in tasks} # <<<<<<<<<<<<<< * * annotations = annotations or {} */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3779, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_tasks)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_tasks)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_tasks; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0; __pyx_t_20 = NULL; } else { __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_tasks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3779, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3779, __pyx_L61_error) } for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3779, __pyx_L61_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3779, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3779, __pyx_L61_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3779, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3779, __pyx_L61_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_k, __pyx_t_9); __pyx_t_9 = 0; if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr40__pyx_v_k, (PyObject*)__pyx_v_user_priority))) __PYX_ERR(0, 3779, __pyx_L61_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_k); __pyx_9genexpr40__pyx_v_k = 0; goto __pyx_L64_exit_scope; __pyx_L61_error:; __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_k); __pyx_9genexpr40__pyx_v_k = 0; goto __pyx_L1_error; __pyx_L64_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_user_priority, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3778 * * # Compute priorities * if isinstance(user_priority, Number): # <<<<<<<<<<<<<< * user_priority = {k: user_priority for k in tasks} * */ } /* "distributed/scheduler.py":3781 * user_priority = {k: user_priority for k in tasks} * * annotations = annotations or {} # <<<<<<<<<<<<<< * restrictions = restrictions or {} * loose_restrictions = loose_restrictions or [] */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_annotations); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3781, __pyx_L1_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_annotations); __pyx_t_2 = __pyx_cur_scope->__pyx_v_annotations; goto __pyx_L65_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L65_bool_binop_done:; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_annotations); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_annotations, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3782 * * annotations = annotations or {} * restrictions = restrictions or {} # <<<<<<<<<<<<<< * loose_restrictions = loose_restrictions or [] * resources = resources or {} */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_restrictions); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3782, __pyx_L1_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_v_restrictions); __pyx_t_2 = __pyx_v_restrictions; goto __pyx_L67_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L67_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_restrictions, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3783 * annotations = annotations or {} * restrictions = restrictions or {} * loose_restrictions = loose_restrictions or [] # <<<<<<<<<<<<<< * resources = resources or {} * retries = retries or {} */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_loose_restrictions); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3783, __pyx_L1_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_v_loose_restrictions); __pyx_t_2 = __pyx_v_loose_restrictions; goto __pyx_L69_bool_binop_done; } __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L69_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_loose_restrictions, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3784 * restrictions = restrictions or {} * loose_restrictions = loose_restrictions or [] * resources = resources or {} # <<<<<<<<<<<<<< * retries = retries or {} * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_resources); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3784, __pyx_L1_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_v_resources); __pyx_t_2 = __pyx_v_resources; goto __pyx_L71_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L71_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_resources, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3785 * loose_restrictions = loose_restrictions or [] * resources = resources or {} * retries = retries or {} # <<<<<<<<<<<<<< * * # Override existing taxonomy with per task annotations */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_retries); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3785, __pyx_L1_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_v_retries); __pyx_t_2 = __pyx_v_retries; goto __pyx_L73_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L73_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_retries, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3788 * * # Override existing taxonomy with per task annotations * if annotations: # <<<<<<<<<<<<<< * if "priority" in annotations: * user_priority.update(annotations["priority"]) */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_annotations); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3788, __pyx_L1_error) if (__pyx_t_10) { /* "distributed/scheduler.py":3789 * # Override existing taxonomy with per task annotations * if annotations: * if "priority" in annotations: # <<<<<<<<<<<<<< * user_priority.update(annotations["priority"]) * */ __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_priority, __pyx_cur_scope->__pyx_v_annotations, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3789, __pyx_L1_error) __pyx_t_14 = (__pyx_t_10 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3790 * if annotations: * if "priority" in annotations: * user_priority.update(annotations["priority"]) # <<<<<<<<<<<<<< * * if "workers" in annotations: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_user_priority, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_annotations, __pyx_n_u_priority); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3789 * # Override existing taxonomy with per task annotations * if annotations: * if "priority" in annotations: # <<<<<<<<<<<<<< * user_priority.update(annotations["priority"]) * */ } /* "distributed/scheduler.py":3792 * user_priority.update(annotations["priority"]) * * if "workers" in annotations: # <<<<<<<<<<<<<< * restrictions.update(annotations["workers"]) * */ __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_workers, __pyx_cur_scope->__pyx_v_annotations, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 3792, __pyx_L1_error) __pyx_t_10 = (__pyx_t_14 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3793 * * if "workers" in annotations: * restrictions.update(annotations["workers"]) # <<<<<<<<<<<<<< * * if "allow_other_workers" in annotations: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_restrictions, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_annotations, __pyx_n_u_workers); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3792 * user_priority.update(annotations["priority"]) * * if "workers" in annotations: # <<<<<<<<<<<<<< * restrictions.update(annotations["workers"]) * */ } /* "distributed/scheduler.py":3795 * restrictions.update(annotations["workers"]) * * if "allow_other_workers" in annotations: # <<<<<<<<<<<<<< * loose_restrictions.extend( * k for k, v in annotations["allow_other_workers"].items() if v */ __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_allow_other_workers, __pyx_cur_scope->__pyx_v_annotations, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3795, __pyx_L1_error) __pyx_t_14 = (__pyx_t_10 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3796 * * if "allow_other_workers" in annotations: * loose_restrictions.extend( # <<<<<<<<<<<<<< * k for k, v in annotations["allow_other_workers"].items() if v * ) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_loose_restrictions, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":3797 * if "allow_other_workers" in annotations: * loose_restrictions.extend( * k for k, v in annotations["allow_other_workers"].items() if v # <<<<<<<<<<<<<< * ) * */ __pyx_t_9 = __pyx_pf_11distributed_9scheduler_9Scheduler_12update_graph_6genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3795 * restrictions.update(annotations["workers"]) * * if "allow_other_workers" in annotations: # <<<<<<<<<<<<<< * loose_restrictions.extend( * k for k, v in annotations["allow_other_workers"].items() if v */ } /* "distributed/scheduler.py":3800 * ) * * if "retries" in annotations: # <<<<<<<<<<<<<< * retries.update(annotations["retries"]) * */ __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_retries, __pyx_cur_scope->__pyx_v_annotations, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 3800, __pyx_L1_error) __pyx_t_10 = (__pyx_t_14 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3801 * * if "retries" in annotations: * retries.update(annotations["retries"]) # <<<<<<<<<<<<<< * * if "resources" in annotations: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_retries, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_annotations, __pyx_n_u_retries); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3800 * ) * * if "retries" in annotations: # <<<<<<<<<<<<<< * retries.update(annotations["retries"]) * */ } /* "distributed/scheduler.py":3803 * retries.update(annotations["retries"]) * * if "resources" in annotations: # <<<<<<<<<<<<<< * resources.update(annotations["resources"]) * */ __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_resources, __pyx_cur_scope->__pyx_v_annotations, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3803, __pyx_L1_error) __pyx_t_14 = (__pyx_t_10 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3804 * * if "resources" in annotations: * resources.update(annotations["resources"]) # <<<<<<<<<<<<<< * * for a, kv in annotations.items(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_resources, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_annotations, __pyx_n_u_resources); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3803 * retries.update(annotations["retries"]) * * if "resources" in annotations: # <<<<<<<<<<<<<< * resources.update(annotations["resources"]) * */ } /* "distributed/scheduler.py":3806 * resources.update(annotations["resources"]) * * for a, kv in annotations.items(): # <<<<<<<<<<<<<< * for k, v in kv.items(): * ts = parent._tasks[k] */ __pyx_t_12 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_annotations == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3806, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_annotations, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_12, &__pyx_t_3, &__pyx_t_9, NULL, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_kv, __pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3807 * * for a, kv in annotations.items(): * for k, v in kv.items(): # <<<<<<<<<<<<<< * ts = parent._tasks[k] * ts._annotations[a] = v */ __pyx_t_21 = 0; if (unlikely(__pyx_v_kv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3807, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_kv, 0, __pyx_n_s_items, (&__pyx_t_22), (&__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_23 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_22, &__pyx_t_21, &__pyx_t_3, &__pyx_t_1, NULL, __pyx_t_13); if (unlikely(__pyx_t_23 == 0)) break; if (unlikely(__pyx_t_23 == -1)) __PYX_ERR(0, 3807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3808 * for a, kv in annotations.items(): * for k, v in kv.items(): * ts = parent._tasks[k] # <<<<<<<<<<<<<< * ts._annotations[a] = v * */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3808, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3808, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":3809 * for k, v in kv.items(): * ts = parent._tasks[k] * ts._annotations[a] = v # <<<<<<<<<<<<<< * * # Add actors */ if (unlikely(__pyx_v_ts->_annotations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3809, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_ts->_annotations, __pyx_v_a, __pyx_v_v) < 0)) __PYX_ERR(0, 3809, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3788 * * # Override existing taxonomy with per task annotations * if annotations: # <<<<<<<<<<<<<< * if "priority" in annotations: * user_priority.update(annotations["priority"]) */ } /* "distributed/scheduler.py":3812 * * # Add actors * if actors is True: # <<<<<<<<<<<<<< * actors = list(keys) * for actor in actors or []: */ __pyx_t_14 = (__pyx_v_actors == Py_True); __pyx_t_10 = (__pyx_t_14 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3813 * # Add actors * if actors is True: * actors = list(keys) # <<<<<<<<<<<<<< * for actor in actors or []: * ts = parent._tasks[actor] */ __pyx_t_2 = PySequence_List(__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_actors, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3812 * * # Add actors * if actors is True: # <<<<<<<<<<<<<< * actors = list(keys) * for actor in actors or []: */ } /* "distributed/scheduler.py":3814 * if actors is True: * actors = list(keys) * for actor in actors or []: # <<<<<<<<<<<<<< * ts = parent._tasks[actor] * ts._actor = True */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_actors); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3814, __pyx_L1_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_v_actors); __pyx_t_2 = __pyx_v_actors; goto __pyx_L88_bool_binop_done; } __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_9); __pyx_t_2 = __pyx_t_9; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_L88_bool_binop_done:; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_9 = __pyx_t_2; __Pyx_INCREF(__pyx_t_9); __pyx_t_4 = 0; __pyx_t_20 = NULL; } else { __pyx_t_4 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_20 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3814, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3814, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3814, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_20(__pyx_t_9); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3814, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_actor, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3815 * actors = list(keys) * for actor in actors or []: * ts = parent._tasks[actor] # <<<<<<<<<<<<<< * ts._actor = True * */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3815, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_actor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3815, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":3816 * for actor in actors or []: * ts = parent._tasks[actor] * ts._actor = True # <<<<<<<<<<<<<< * * priority = priority or dask.order.order( */ __pyx_v_ts->_actor = 1; /* "distributed/scheduler.py":3814 * if actors is True: * actors = list(keys) * for actor in actors or []: # <<<<<<<<<<<<<< * ts = parent._tasks[actor] * ts._actor = True */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3818 * ts._actor = True * * priority = priority or dask.order.order( # <<<<<<<<<<<<<< * tasks * ) # TODO: define order wrt old graph */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_priority); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3818, __pyx_L1_error) if (!__pyx_t_10) { } else { __Pyx_INCREF(__pyx_v_priority); __pyx_t_9 = __pyx_v_priority; goto __pyx_L90_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_order); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_order); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3819 * * priority = priority or dask.order.order( * tasks # <<<<<<<<<<<<<< * ) # TODO: define order wrt old graph * */ __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_cur_scope->__pyx_v_tasks) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_tasks); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_L90_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_priority, __pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3822 * ) # TODO: define order wrt old graph * * if submitting_task: # sub-tasks get better priority than parent tasks # <<<<<<<<<<<<<< * ts = parent._tasks.get(submitting_task) * if ts is not None: */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_submitting_task); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3822, __pyx_L1_error) if (__pyx_t_10) { /* "distributed/scheduler.py":3823 * * if submitting_task: # sub-tasks get better priority than parent tasks * ts = parent._tasks.get(submitting_task) # <<<<<<<<<<<<<< * if ts is not None: * generation = ts._priority[0] - 0.01 */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3823, __pyx_L1_error) } __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_submitting_task, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3823, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":3824 * if submitting_task: # sub-tasks get better priority than parent tasks * ts = parent._tasks.get(submitting_task) * if ts is not None: # <<<<<<<<<<<<<< * generation = ts._priority[0] - 0.01 * else: # super-task already cleaned up */ __pyx_t_10 = (((PyObject *)__pyx_v_ts) != Py_None); __pyx_t_14 = (__pyx_t_10 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3825 * ts = parent._tasks.get(submitting_task) * if ts is not None: * generation = ts._priority[0] - 0.01 # <<<<<<<<<<<<<< * else: # super-task already cleaned up * generation = self.generation */ if (unlikely(__pyx_v_ts->_priority == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3825, __pyx_L1_error) } __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v_ts->_priority, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyFloat_SubtractObjC(__pyx_t_9, __pyx_float_0_01, 0.01, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_generation = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":3824 * if submitting_task: # sub-tasks get better priority than parent tasks * ts = parent._tasks.get(submitting_task) * if ts is not None: # <<<<<<<<<<<<<< * generation = ts._priority[0] - 0.01 * else: # super-task already cleaned up */ goto __pyx_L93; } /* "distributed/scheduler.py":3827 * generation = ts._priority[0] - 0.01 * else: # super-task already cleaned up * generation = self.generation # <<<<<<<<<<<<<< * elif self._last_time + fifo_timeout < start: * self.generation += 1 # older graph generations take precedence */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_generation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_generation = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L93:; /* "distributed/scheduler.py":3822 * ) # TODO: define order wrt old graph * * if submitting_task: # sub-tasks get better priority than parent tasks # <<<<<<<<<<<<<< * ts = parent._tasks.get(submitting_task) * if ts is not None: */ goto __pyx_L92; } /* "distributed/scheduler.py":3828 * else: # super-task already cleaned up * generation = self.generation * elif self._last_time + fifo_timeout < start: # <<<<<<<<<<<<<< * self.generation += 1 # older graph generations take precedence * generation = self.generation */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_v_fifo_timeout); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, __pyx_v_start, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 3828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_14) { /* "distributed/scheduler.py":3829 * generation = self.generation * elif self._last_time + fifo_timeout < start: * self.generation += 1 # older graph generations take precedence # <<<<<<<<<<<<<< * generation = self.generation * self._last_time = start */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_generation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_generation, __pyx_t_9) < 0) __PYX_ERR(0, 3829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3830 * elif self._last_time + fifo_timeout < start: * self.generation += 1 # older graph generations take precedence * generation = self.generation # <<<<<<<<<<<<<< * self._last_time = start * else: */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_generation); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_generation = __pyx_t_9; __pyx_t_9 = 0; /* "distributed/scheduler.py":3831 * self.generation += 1 # older graph generations take precedence * generation = self.generation * self._last_time = start # <<<<<<<<<<<<<< * else: * generation = self.generation */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_time, __pyx_v_start) < 0) __PYX_ERR(0, 3831, __pyx_L1_error) /* "distributed/scheduler.py":3828 * else: # super-task already cleaned up * generation = self.generation * elif self._last_time + fifo_timeout < start: # <<<<<<<<<<<<<< * self.generation += 1 # older graph generations take precedence * generation = self.generation */ goto __pyx_L92; } /* "distributed/scheduler.py":3833 * self._last_time = start * else: * generation = self.generation # <<<<<<<<<<<<<< * * for key in set(priority) & touched_keys: */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_generation); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_generation = __pyx_t_9; __pyx_t_9 = 0; } __pyx_L92:; /* "distributed/scheduler.py":3835 * generation = self.generation * * for key in set(priority) & touched_keys: # <<<<<<<<<<<<<< * ts = parent._tasks[key] * if ts._priority is None: */ __pyx_t_4 = 0; __pyx_t_2 = PySet_New(__pyx_v_priority); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_v_touched_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_set_iterator(__pyx_t_1, 1, (&__pyx_t_12), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_13 = __Pyx_set_iter_next(__pyx_t_9, __pyx_t_12, &__pyx_t_4, &__pyx_t_2, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3836 * * for key in set(priority) & touched_keys: * ts = parent._tasks[key] # <<<<<<<<<<<<<< * if ts._priority is None: * ts._priority = (-(user_priority.get(key, 0)), generation, priority[key]) */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3836, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3836, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":3837 * for key in set(priority) & touched_keys: * ts = parent._tasks[key] * if ts._priority is None: # <<<<<<<<<<<<<< * ts._priority = (-(user_priority.get(key, 0)), generation, priority[key]) * */ __pyx_t_14 = (__pyx_v_ts->_priority == ((PyObject*)Py_None)); __pyx_t_10 = (__pyx_t_14 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3838 * ts = parent._tasks[key] * if ts._priority is None: * ts._priority = (-(user_priority.get(key, 0)), generation, priority[key]) # <<<<<<<<<<<<<< * * # Ensure all runnables have a priority */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_user_priority, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_13 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_13 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_int_0}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3838, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_int_0}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3838, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_13, __pyx_v_key); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_13, __pyx_int_0); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_priority, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_generation); __Pyx_GIVEREF(__pyx_v_generation); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_generation); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_ts->_priority); __Pyx_DECREF(__pyx_v_ts->_priority); __pyx_v_ts->_priority = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3837 * for key in set(priority) & touched_keys: * ts = parent._tasks[key] * if ts._priority is None: # <<<<<<<<<<<<<< * ts._priority = (-(user_priority.get(key, 0)), generation, priority[key]) * */ } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3841 * * # Ensure all runnables have a priority * runnables = [ts for ts in touched_tasks if ts._run_spec] # <<<<<<<<<<<<<< * for ts in runnables: * if ts._priority is None and ts._run_spec: */ { /* enter inner scope */ __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3841, __pyx_L99_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __pyx_v_touched_tasks; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0; for (;;) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3841, __pyx_L99_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3841, __pyx_L99_error) __Pyx_GOTREF(__pyx_t_2); #endif if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3841, __pyx_L99_error) __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_9genexpr42__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3841, __pyx_L99_error) if (__pyx_t_10) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_9genexpr42__pyx_v_ts))) __PYX_ERR(0, 3841, __pyx_L99_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr42__pyx_v_ts); __pyx_9genexpr42__pyx_v_ts = 0; goto __pyx_L103_exit_scope; __pyx_L99_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr42__pyx_v_ts); __pyx_9genexpr42__pyx_v_ts = 0; goto __pyx_L1_error; __pyx_L103_exit_scope:; } /* exit inner scope */ __pyx_v_runnables = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3842 * # Ensure all runnables have a priority * runnables = [ts for ts in touched_tasks if ts._run_spec] * for ts in runnables: # <<<<<<<<<<<<<< * if ts._priority is None and ts._run_spec: * ts._priority = (self.generation, 0) */ __pyx_t_9 = __pyx_v_runnables; __Pyx_INCREF(__pyx_t_9); __pyx_t_12 = 0; for (;;) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 3842, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3842, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":3843 * runnables = [ts for ts in touched_tasks if ts._run_spec] * for ts in runnables: * if ts._priority is None and ts._run_spec: # <<<<<<<<<<<<<< * ts._priority = (self.generation, 0) * */ __pyx_t_14 = (__pyx_v_ts->_priority == ((PyObject*)Py_None)); __pyx_t_5 = (__pyx_t_14 != 0); if (__pyx_t_5) { } else { __pyx_t_10 = __pyx_t_5; goto __pyx_L107_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3843, __pyx_L1_error) __pyx_t_10 = __pyx_t_5; __pyx_L107_bool_binop_done:; if (__pyx_t_10) { /* "distributed/scheduler.py":3844 * for ts in runnables: * if ts._priority is None and ts._run_spec: * ts._priority = (self.generation, 0) # <<<<<<<<<<<<<< * * if restrictions: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_generation); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_ts->_priority); __Pyx_DECREF(__pyx_v_ts->_priority); __pyx_v_ts->_priority = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3843 * runnables = [ts for ts in touched_tasks if ts._run_spec] * for ts in runnables: * if ts._priority is None and ts._run_spec: # <<<<<<<<<<<<<< * ts._priority = (self.generation, 0) * */ } /* "distributed/scheduler.py":3842 * # Ensure all runnables have a priority * runnables = [ts for ts in touched_tasks if ts._run_spec] * for ts in runnables: # <<<<<<<<<<<<<< * if ts._priority is None and ts._run_spec: * ts._priority = (self.generation, 0) */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3846 * ts._priority = (self.generation, 0) * * if restrictions: # <<<<<<<<<<<<<< * # *restrictions* is a dict keying task ids to lists of * # restriction specifications (either worker names or addresses) */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_restrictions); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3846, __pyx_L1_error) if (__pyx_t_10) { /* "distributed/scheduler.py":3849 * # *restrictions* is a dict keying task ids to lists of * # restriction specifications (either worker names or addresses) * for k, v in restrictions.items(): # <<<<<<<<<<<<<< * if v is None: * continue */ __pyx_t_12 = 0; if (unlikely(__pyx_v_restrictions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3849, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_restrictions, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_4, &__pyx_t_12, &__pyx_t_2, &__pyx_t_6, NULL, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3850 * # restriction specifications (either worker names or addresses) * for k, v in restrictions.items(): * if v is None: # <<<<<<<<<<<<<< * continue * ts = parent._tasks.get(k) */ __pyx_t_10 = (__pyx_v_v == Py_None); __pyx_t_5 = (__pyx_t_10 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3851 * for k, v in restrictions.items(): * if v is None: * continue # <<<<<<<<<<<<<< * ts = parent._tasks.get(k) * if ts is None: */ goto __pyx_L110_continue; /* "distributed/scheduler.py":3850 * # restriction specifications (either worker names or addresses) * for k, v in restrictions.items(): * if v is None: # <<<<<<<<<<<<<< * continue * ts = parent._tasks.get(k) */ } /* "distributed/scheduler.py":3852 * if v is None: * continue * ts = parent._tasks.get(k) # <<<<<<<<<<<<<< * if ts is None: * continue */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3852, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_k, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3852, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":3853 * continue * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * continue * ts._host_restrictions = set() */ __pyx_t_5 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_10 = (__pyx_t_5 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3854 * ts = parent._tasks.get(k) * if ts is None: * continue # <<<<<<<<<<<<<< * ts._host_restrictions = set() * ts._worker_restrictions = set() */ goto __pyx_L110_continue; /* "distributed/scheduler.py":3853 * continue * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * continue * ts._host_restrictions = set() */ } /* "distributed/scheduler.py":3855 * if ts is None: * continue * ts._host_restrictions = set() # <<<<<<<<<<<<<< * ts._worker_restrictions = set() * for w in v: */ __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_ts->_host_restrictions); __Pyx_DECREF(__pyx_v_ts->_host_restrictions); __pyx_v_ts->_host_restrictions = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3856 * continue * ts._host_restrictions = set() * ts._worker_restrictions = set() # <<<<<<<<<<<<<< * for w in v: * try: */ __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_ts->_worker_restrictions); __Pyx_DECREF(__pyx_v_ts->_worker_restrictions); __pyx_v_ts->_worker_restrictions = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3857 * ts._host_restrictions = set() * ts._worker_restrictions = set() * for w in v: # <<<<<<<<<<<<<< * try: * w = self.coerce_address(w) */ if (likely(PyList_CheckExact(__pyx_v_v)) || PyTuple_CheckExact(__pyx_v_v)) { __pyx_t_6 = __pyx_v_v; __Pyx_INCREF(__pyx_t_6); __pyx_t_22 = 0; __pyx_t_20 = NULL; } else { __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_v); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_20 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3857, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_2); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 3857, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_2); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 3857, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_20(__pyx_t_6); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3857, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3858 * ts._worker_restrictions = set() * for w in v: * try: # <<<<<<<<<<<<<< * w = self.coerce_address(w) * except ValueError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "distributed/scheduler.py":3859 * for w in v: * try: * w = self.coerce_address(w) # <<<<<<<<<<<<<< * except ValueError: * # Not a valid address, but perhaps it's a hostname */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3859, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_w) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_w); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3859, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_w, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3858 * ts._worker_restrictions = set() * for w in v: * try: # <<<<<<<<<<<<<< * w = self.coerce_address(w) * except ValueError: */ } /* "distributed/scheduler.py":3864 * ts._host_restrictions.add(w) * else: * ts._worker_restrictions.add(w) # <<<<<<<<<<<<<< * * if loose_restrictions: */ /*else:*/ { if (unlikely(__pyx_v_ts->_worker_restrictions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 3864, __pyx_L118_except_error) } __pyx_t_16 = PySet_Add(__pyx_v_ts->_worker_restrictions, __pyx_v_w); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3864, __pyx_L118_except_error) } __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L123_try_end; __pyx_L116_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":3860 * try: * w = self.coerce_address(w) * except ValueError: # <<<<<<<<<<<<<< * # Not a valid address, but perhaps it's a hostname * ts._host_restrictions.add(w) */ __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_13) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 3860, __pyx_L118_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":3862 * except ValueError: * # Not a valid address, but perhaps it's a hostname * ts._host_restrictions.add(w) # <<<<<<<<<<<<<< * else: * ts._worker_restrictions.add(w) */ if (unlikely(__pyx_v_ts->_host_restrictions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 3862, __pyx_L118_except_error) } __pyx_t_16 = PySet_Add(__pyx_v_ts->_host_restrictions, __pyx_v_w); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3862, __pyx_L118_except_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L117_exception_handled; } goto __pyx_L118_except_error; __pyx_L118_except_error:; /* "distributed/scheduler.py":3858 * ts._worker_restrictions = set() * for w in v: * try: # <<<<<<<<<<<<<< * w = self.coerce_address(w) * except ValueError: */ __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17); goto __pyx_L1_error; __pyx_L117_exception_handled:; __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17); __pyx_L123_try_end:; } /* "distributed/scheduler.py":3857 * ts._host_restrictions = set() * ts._worker_restrictions = set() * for w in v: # <<<<<<<<<<<<<< * try: * w = self.coerce_address(w) */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_L110_continue:; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3866 * ts._worker_restrictions.add(w) * * if loose_restrictions: # <<<<<<<<<<<<<< * for k in loose_restrictions: * ts = parent._tasks[k] */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_loose_restrictions); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3866, __pyx_L1_error) if (__pyx_t_10) { /* "distributed/scheduler.py":3867 * * if loose_restrictions: * for k in loose_restrictions: # <<<<<<<<<<<<<< * ts = parent._tasks[k] * ts._loose_restrictions = True */ if (likely(PyList_CheckExact(__pyx_v_loose_restrictions)) || PyTuple_CheckExact(__pyx_v_loose_restrictions)) { __pyx_t_9 = __pyx_v_loose_restrictions; __Pyx_INCREF(__pyx_t_9); __pyx_t_4 = 0; __pyx_t_20 = NULL; } else { __pyx_t_4 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_loose_restrictions); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_20 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3867, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3867, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3867, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_20(__pyx_t_9); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3867, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3868 * if loose_restrictions: * for k in loose_restrictions: * ts = parent._tasks[k] # <<<<<<<<<<<<<< * ts._loose_restrictions = True * */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3868, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3868, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":3869 * for k in loose_restrictions: * ts = parent._tasks[k] * ts._loose_restrictions = True # <<<<<<<<<<<<<< * * if resources: */ __pyx_v_ts->_loose_restrictions = 1; /* "distributed/scheduler.py":3867 * * if loose_restrictions: * for k in loose_restrictions: # <<<<<<<<<<<<<< * ts = parent._tasks[k] * ts._loose_restrictions = True */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3866 * ts._worker_restrictions.add(w) * * if loose_restrictions: # <<<<<<<<<<<<<< * for k in loose_restrictions: * ts = parent._tasks[k] */ } /* "distributed/scheduler.py":3846 * ts._priority = (self.generation, 0) * * if restrictions: # <<<<<<<<<<<<<< * # *restrictions* is a dict keying task ids to lists of * # restriction specifications (either worker names or addresses) */ } /* "distributed/scheduler.py":3871 * ts._loose_restrictions = True * * if resources: # <<<<<<<<<<<<<< * for k, v in resources.items(): * if v is None: */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_resources); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3871, __pyx_L1_error) if (__pyx_t_10) { /* "distributed/scheduler.py":3872 * * if resources: * for k, v in resources.items(): # <<<<<<<<<<<<<< * if v is None: * continue */ __pyx_t_4 = 0; if (unlikely(__pyx_v_resources == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3872, __pyx_L1_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_resources, 0, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_12, &__pyx_t_4, &__pyx_t_6, &__pyx_t_3, NULL, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3873 * if resources: * for k, v in resources.items(): * if v is None: # <<<<<<<<<<<<<< * continue * assert isinstance(v, dict) */ __pyx_t_10 = (__pyx_v_v == Py_None); __pyx_t_5 = (__pyx_t_10 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3874 * for k, v in resources.items(): * if v is None: * continue # <<<<<<<<<<<<<< * assert isinstance(v, dict) * ts = parent._tasks.get(k) */ goto __pyx_L130_continue; /* "distributed/scheduler.py":3873 * if resources: * for k, v in resources.items(): * if v is None: # <<<<<<<<<<<<<< * continue * assert isinstance(v, dict) */ } /* "distributed/scheduler.py":3875 * if v is None: * continue * assert isinstance(v, dict) # <<<<<<<<<<<<<< * ts = parent._tasks.get(k) * if ts is None: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = PyDict_Check(__pyx_v_v); if (unlikely(!(__pyx_t_5 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 3875, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":3876 * continue * assert isinstance(v, dict) * ts = parent._tasks.get(k) # <<<<<<<<<<<<<< * if ts is None: * continue */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3876, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_k, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3876, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":3877 * assert isinstance(v, dict) * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * continue * ts._resource_restrictions = v */ __pyx_t_5 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_10 = (__pyx_t_5 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":3878 * ts = parent._tasks.get(k) * if ts is None: * continue # <<<<<<<<<<<<<< * ts._resource_restrictions = v * */ goto __pyx_L130_continue; /* "distributed/scheduler.py":3877 * assert isinstance(v, dict) * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * continue * ts._resource_restrictions = v */ } /* "distributed/scheduler.py":3879 * if ts is None: * continue * ts._resource_restrictions = v # <<<<<<<<<<<<<< * * if retries: */ if (!(likely(PyDict_CheckExact(__pyx_v_v))||((__pyx_v_v) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_v)->tp_name), 0))) __PYX_ERR(0, 3879, __pyx_L1_error) __pyx_t_3 = __pyx_v_v; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_ts->_resource_restrictions); __Pyx_DECREF(__pyx_v_ts->_resource_restrictions); __pyx_v_ts->_resource_restrictions = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; __pyx_L130_continue:; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3871 * ts._loose_restrictions = True * * if resources: # <<<<<<<<<<<<<< * for k, v in resources.items(): * if v is None: */ } /* "distributed/scheduler.py":3881 * ts._resource_restrictions = v * * if retries: # <<<<<<<<<<<<<< * for k, v in retries.items(): * assert isinstance(v, int) */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_retries); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3881, __pyx_L1_error) if (__pyx_t_10) { /* "distributed/scheduler.py":3882 * * if retries: * for k, v in retries.items(): # <<<<<<<<<<<<<< * assert isinstance(v, int) * ts = parent._tasks.get(k) */ __pyx_t_12 = 0; if (unlikely(__pyx_v_retries == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 3882, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_retries, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_4, &__pyx_t_12, &__pyx_t_3, &__pyx_t_6, NULL, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3883 * if retries: * for k, v in retries.items(): * assert isinstance(v, int) # <<<<<<<<<<<<<< * ts = parent._tasks.get(k) * if ts is None: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_10 = PyInt_Check(__pyx_v_v); if (unlikely(!(__pyx_t_10 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 3883, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":3884 * for k, v in retries.items(): * assert isinstance(v, int) * ts = parent._tasks.get(k) # <<<<<<<<<<<<<< * if ts is None: * continue */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3884, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_v_k, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3884, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":3885 * assert isinstance(v, int) * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * continue * ts._retries = v */ __pyx_t_10 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_5 = (__pyx_t_10 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3886 * ts = parent._tasks.get(k) * if ts is None: * continue # <<<<<<<<<<<<<< * ts._retries = v * */ goto __pyx_L135_continue; /* "distributed/scheduler.py":3885 * assert isinstance(v, int) * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * continue * ts._retries = v */ } /* "distributed/scheduler.py":3887 * if ts is None: * continue * ts._retries = v # <<<<<<<<<<<<<< * * # Compute recommendations */ __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_v); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3887, __pyx_L1_error) __pyx_v_ts->_retries = __pyx_t_22; __pyx_L135_continue:; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3881 * ts._resource_restrictions = v * * if retries: # <<<<<<<<<<<<<< * for k, v in retries.items(): * assert isinstance(v, int) */ } /* "distributed/scheduler.py":3890 * * # Compute recommendations * recommendations: dict = {} # <<<<<<<<<<<<<< * * for ts in sorted(runnables, key=operator.attrgetter("priority"), reverse=True): */ __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_recommendations = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3892 * recommendations: dict = {} * * for ts in sorted(runnables, key=operator.attrgetter("priority"), reverse=True): # <<<<<<<<<<<<<< * if ts._state == "released" and ts._run_spec: * recommendations[ts._key] = "waiting" */ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_runnables); __Pyx_GIVEREF(__pyx_v_runnables); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_runnables); __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_priority) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_priority); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_reverse, Py_True) < 0) __PYX_ERR(0, 3892, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; __pyx_t_20 = NULL; } else { __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_20 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3892, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3892, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3892, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_20(__pyx_t_6); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3892, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3892, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":3893 * * for ts in sorted(runnables, key=operator.attrgetter("priority"), reverse=True): * if ts._state == "released" and ts._run_spec: # <<<<<<<<<<<<<< * recommendations[ts._key] = "waiting" * */ __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_released, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3893, __pyx_L1_error) __pyx_t_14 = (__pyx_t_10 != 0); if (__pyx_t_14) { } else { __pyx_t_5 = __pyx_t_14; goto __pyx_L141_bool_binop_done; } __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 3893, __pyx_L1_error) __pyx_t_5 = __pyx_t_14; __pyx_L141_bool_binop_done:; if (__pyx_t_5) { /* "distributed/scheduler.py":3894 * for ts in sorted(runnables, key=operator.attrgetter("priority"), reverse=True): * if ts._state == "released" and ts._run_spec: * recommendations[ts._key] = "waiting" # <<<<<<<<<<<<<< * * for ts in touched_tasks: */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_ts->_key, __pyx_n_u_waiting) < 0)) __PYX_ERR(0, 3894, __pyx_L1_error) /* "distributed/scheduler.py":3893 * * for ts in sorted(runnables, key=operator.attrgetter("priority"), reverse=True): * if ts._state == "released" and ts._run_spec: # <<<<<<<<<<<<<< * recommendations[ts._key] = "waiting" * */ } /* "distributed/scheduler.py":3892 * recommendations: dict = {} * * for ts in sorted(runnables, key=operator.attrgetter("priority"), reverse=True): # <<<<<<<<<<<<<< * if ts._state == "released" and ts._run_spec: * recommendations[ts._key] = "waiting" */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3896 * recommendations[ts._key] = "waiting" * * for ts in touched_tasks: # <<<<<<<<<<<<<< * for dts in ts._dependencies: * if dts._exception_blame: */ __pyx_t_6 = __pyx_v_touched_tasks; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3896, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3896, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":3897 * * for ts in touched_tasks: * for dts in ts._dependencies: # <<<<<<<<<<<<<< * if dts._exception_blame: * ts._exception_blame = dts._exception_blame */ __pyx_t_12 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_22), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_13 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_22, &__pyx_t_12, &__pyx_t_9, __pyx_t_8); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3897, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":3898 * for ts in touched_tasks: * for dts in ts._dependencies: * if dts._exception_blame: # <<<<<<<<<<<<<< * ts._exception_blame = dts._exception_blame * recommendations[ts._key] = "erred" */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dts->_exception_blame); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3898, __pyx_L1_error) if (__pyx_t_5) { /* "distributed/scheduler.py":3899 * for dts in ts._dependencies: * if dts._exception_blame: * ts._exception_blame = dts._exception_blame # <<<<<<<<<<<<<< * recommendations[ts._key] = "erred" * break */ __pyx_t_9 = __pyx_v_dts->_exception_blame; __Pyx_INCREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __Pyx_GOTREF(__pyx_v_ts->_exception_blame); __Pyx_DECREF(__pyx_v_ts->_exception_blame); __pyx_v_ts->_exception_blame = __pyx_t_9; __pyx_t_9 = 0; /* "distributed/scheduler.py":3900 * if dts._exception_blame: * ts._exception_blame = dts._exception_blame * recommendations[ts._key] = "erred" # <<<<<<<<<<<<<< * break * */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_ts->_key, __pyx_n_u_erred) < 0)) __PYX_ERR(0, 3900, __pyx_L1_error) /* "distributed/scheduler.py":3901 * ts._exception_blame = dts._exception_blame * recommendations[ts._key] = "erred" * break # <<<<<<<<<<<<<< * * for plugin in self.plugins[:]: */ goto __pyx_L146_break; /* "distributed/scheduler.py":3898 * for ts in touched_tasks: * for dts in ts._dependencies: * if dts._exception_blame: # <<<<<<<<<<<<<< * ts._exception_blame = dts._exception_blame * recommendations[ts._key] = "erred" */ } } __pyx_L146_break:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3896 * recommendations[ts._key] = "waiting" * * for ts in touched_tasks: # <<<<<<<<<<<<<< * for dts in ts._dependencies: * if dts._exception_blame: */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3903 * break * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * plugin.update_graph( */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, 0, NULL, NULL, &__pyx_slice__57, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; __pyx_t_20 = NULL; } else { __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_20 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3903, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3903, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3903, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_20(__pyx_t_6); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 3903, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_plugin, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":3904 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.update_graph( * self, */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); /*try:*/ { /* "distributed/scheduler.py":3905 * for plugin in self.plugins[:]: * try: * plugin.update_graph( # <<<<<<<<<<<<<< * self, * client=client, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_plugin, __pyx_n_s_update_graph_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3905, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":3906 * try: * plugin.update_graph( * self, # <<<<<<<<<<<<<< * client=client, * tasks=tasks, */ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3905, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_self); /* "distributed/scheduler.py":3907 * plugin.update_graph( * self, * client=client, # <<<<<<<<<<<<<< * tasks=tasks, * keys=keys, */ __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3907, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) /* "distributed/scheduler.py":3908 * self, * client=client, * tasks=tasks, # <<<<<<<<<<<<<< * keys=keys, * restrictions=restrictions or {}, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tasks, __pyx_cur_scope->__pyx_v_tasks) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) /* "distributed/scheduler.py":3909 * client=client, * tasks=tasks, * keys=keys, # <<<<<<<<<<<<<< * restrictions=restrictions or {}, * dependencies=dependencies, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_keys, __pyx_v_keys) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) /* "distributed/scheduler.py":3910 * tasks=tasks, * keys=keys, * restrictions=restrictions or {}, # <<<<<<<<<<<<<< * dependencies=dependencies, * priority=priority, */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_restrictions); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3910, __pyx_L150_error) if (!__pyx_t_5) { } else { __Pyx_INCREF(__pyx_v_restrictions); __pyx_t_1 = __pyx_v_restrictions; goto __pyx_L158_bool_binop_done; } __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3910, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_7); __pyx_t_1 = __pyx_t_7; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_L158_bool_binop_done:; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_restrictions, __pyx_t_1) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3911 * keys=keys, * restrictions=restrictions or {}, * dependencies=dependencies, # <<<<<<<<<<<<<< * priority=priority, * loose_restrictions=loose_restrictions, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dependencies, __pyx_v_dependencies) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) /* "distributed/scheduler.py":3912 * restrictions=restrictions or {}, * dependencies=dependencies, * priority=priority, # <<<<<<<<<<<<<< * loose_restrictions=loose_restrictions, * resources=resources, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_priority, __pyx_v_priority) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) /* "distributed/scheduler.py":3913 * dependencies=dependencies, * priority=priority, * loose_restrictions=loose_restrictions, # <<<<<<<<<<<<<< * resources=resources, * annotations=annotations, */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_loose_restrictions, __pyx_v_loose_restrictions) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) /* "distributed/scheduler.py":3914 * priority=priority, * loose_restrictions=loose_restrictions, * resources=resources, # <<<<<<<<<<<<<< * annotations=annotations, * ) */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_resources, __pyx_v_resources) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) /* "distributed/scheduler.py":3915 * loose_restrictions=loose_restrictions, * resources=resources, * annotations=annotations, # <<<<<<<<<<<<<< * ) * except Exception as e: */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_annotations, __pyx_cur_scope->__pyx_v_annotations) < 0) __PYX_ERR(0, 3907, __pyx_L150_error) /* "distributed/scheduler.py":3905 * for plugin in self.plugins[:]: * try: * plugin.update_graph( # <<<<<<<<<<<<<< * self, * client=client, */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3905, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3904 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.update_graph( * self, */ } __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L157_try_end; __pyx_L150_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":3917 * annotations=annotations, * ) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_9) < 0) __PYX_ERR(0, 3917, __pyx_L152_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_v_e = __pyx_t_2; /*try:*/ { /* "distributed/scheduler.py":3918 * ) * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * * self.transitions(recommendations) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3918, __pyx_L165_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exception); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 3918, __pyx_L165_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_24); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_24, function); } } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_7, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_v_e); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3918, __pyx_L165_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "distributed/scheduler.py":3917 * annotations=annotations, * ) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; goto __pyx_L166; } __pyx_L165_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28) < 0)) __Pyx_ErrFetch(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_29); __Pyx_XGOTREF(__pyx_t_30); __Pyx_XGOTREF(__pyx_t_31); __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_25 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_29); __Pyx_XGIVEREF(__pyx_t_30); __Pyx_XGIVEREF(__pyx_t_31); __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_30, __pyx_t_31); } __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_ErrRestore(__pyx_t_26, __pyx_t_27, __pyx_t_28); __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_25; goto __pyx_L152_except_error; } __pyx_L166:; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L151_exception_handled; } goto __pyx_L152_except_error; __pyx_L152_except_error:; /* "distributed/scheduler.py":3904 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.update_graph( * self, */ __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); goto __pyx_L1_error; __pyx_L151_exception_handled:; __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_L157_try_end:; } /* "distributed/scheduler.py":3903 * break * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * plugin.update_graph( */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3920 * logger.exception(e) * * self.transitions(recommendations) # <<<<<<<<<<<<<< * * for ts in touched_tasks: */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_v_recommendations) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_recommendations); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3922 * self.transitions(recommendations) * * for ts in touched_tasks: # <<<<<<<<<<<<<< * if ts._state in ("memory", "erred"): * self.report_on_key(ts=ts, client=client) */ __pyx_t_6 = __pyx_v_touched_tasks; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3922, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3922, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":3923 * * for ts in touched_tasks: * if ts._state in ("memory", "erred"): # <<<<<<<<<<<<<< * self.report_on_key(ts=ts, client=client) * */ __Pyx_INCREF(__pyx_v_ts->_state); __pyx_t_15 = __pyx_v_ts->_state; __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_15, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 3923, __pyx_L1_error) __pyx_t_10 = (__pyx_t_14 != 0); if (!__pyx_t_10) { } else { __pyx_t_5 = __pyx_t_10; goto __pyx_L174_bool_binop_done; } __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_15, __pyx_n_u_erred, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3923, __pyx_L1_error) __pyx_t_14 = (__pyx_t_10 != 0); __pyx_t_5 = __pyx_t_14; __pyx_L174_bool_binop_done:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_14 = (__pyx_t_5 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":3924 * for ts in touched_tasks: * if ts._state in ("memory", "erred"): * self.report_on_key(ts=ts, client=client) # <<<<<<<<<<<<<< * * end = time() */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_report_on_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ts, ((PyObject *)__pyx_v_ts)) < 0) __PYX_ERR(0, 3924, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 3924, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3923 * * for ts in touched_tasks: * if ts._state in ("memory", "erred"): # <<<<<<<<<<<<<< * self.report_on_key(ts=ts, client=client) * */ } /* "distributed/scheduler.py":3922 * self.transitions(recommendations) * * for ts in touched_tasks: # <<<<<<<<<<<<<< * if ts._state in ("memory", "erred"): * self.report_on_key(ts=ts, client=client) */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3926 * self.report_on_key(ts=ts, client=client) * * end = time() # <<<<<<<<<<<<<< * if self.digests is not None: * self.digests["update-graph-duration"].add(end - start) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_end = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":3927 * * end = time() * if self.digests is not None: # <<<<<<<<<<<<<< * self.digests["update-graph-duration"].add(end - start) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_digests); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_14 = (__pyx_t_6 != Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = (__pyx_t_14 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3928 * end = time() * if self.digests is not None: * self.digests["update-graph-duration"].add(end - start) # <<<<<<<<<<<<<< * * # TODO: balance workers */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_digests); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_kp_u_update_graph_duration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":3927 * * end = time() * if self.digests is not None: # <<<<<<<<<<<<<< * self.digests["update-graph-duration"].add(end - start) * */ } /* "distributed/scheduler.py":3659 * ) * * def update_graph( # <<<<<<<<<<<<<< * self, * client=None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_24); __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_already_in_memory); __Pyx_XDECREF(__pyx_v_v); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_dependents); __Pyx_XDECREF(__pyx_v_stack); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_dep); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_touched_keys); __Pyx_XDECREF(__pyx_v_touched_tasks); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_kv); __Pyx_XDECREF(__pyx_v_actor); __Pyx_XDECREF(__pyx_v_generation); __Pyx_XDECREF(__pyx_v_runnables); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_plugin); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_k); __Pyx_XDECREF((PyObject *)__pyx_9genexpr42__pyx_v_ts); __Pyx_XDECREF(__pyx_v_keys); __Pyx_XDECREF(__pyx_v_dependencies); __Pyx_XDECREF(__pyx_v_restrictions); __Pyx_XDECREF(__pyx_v_priority); __Pyx_XDECREF(__pyx_v_loose_restrictions); __Pyx_XDECREF(__pyx_v_resources); __Pyx_XDECREF(__pyx_v_retries); __Pyx_XDECREF(__pyx_v_user_priority); __Pyx_XDECREF(__pyx_v_actors); __Pyx_XDECREF(__pyx_v_fifo_timeout); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3932 * # TODO: balance workers * * def new_task(self, key, spec, state): # <<<<<<<<<<<<<< * """ Create a new task, and associated states """ * parent: SchedulerState = cast(SchedulerState, self) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_27new_task(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_26new_task[] = " Create a new task, and associated states "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_27new_task = {"new_task", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_27new_task, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_26new_task}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_27new_task(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_spec = 0; PyObject *__pyx_v_state = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_task (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_spec,&__pyx_n_s_state,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_task", 1, 4, 4, 1); __PYX_ERR(0, 3932, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_task", 1, 4, 4, 2); __PYX_ERR(0, 3932, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_task", 1, 4, 4, 3); __PYX_ERR(0, 3932, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new_task") < 0)) __PYX_ERR(0, 3932, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_spec = values[2]; __pyx_v_state = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("new_task", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3932, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.new_task", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_26new_task(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_spec, __pyx_v_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_26new_task(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_spec, PyObject *__pyx_v_state) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v_tp = 0; struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_tg = 0; PyObject *__pyx_v_prefix_key = NULL; PyObject *__pyx_v_group_key = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_task", 0); /* "distributed/scheduler.py":3934 * def new_task(self, key, spec, state): * """ Create a new task, and associated states """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = TaskState(key, spec) * tp: TaskPrefix */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3935 * """ Create a new task, and associated states """ * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = TaskState(key, spec) # <<<<<<<<<<<<<< * tp: TaskPrefix * tg: TaskGroup */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_spec); __Pyx_GIVEREF(__pyx_v_spec); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_spec); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11distributed_9scheduler_TaskState), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3938 * tp: TaskPrefix * tg: TaskGroup * ts._state = state # <<<<<<<<<<<<<< * prefix_key = key_split(key) * tp = parent._task_prefixes.get(prefix_key) */ if (!(likely(PyUnicode_CheckExact(__pyx_v_state))||((__pyx_v_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_state)->tp_name), 0))) __PYX_ERR(0, 3938, __pyx_L1_error) __pyx_t_2 = __pyx_v_state; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_ts->_state); __Pyx_DECREF(__pyx_v_ts->_state); __pyx_v_ts->_state = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3939 * tg: TaskGroup * ts._state = state * prefix_key = key_split(key) # <<<<<<<<<<<<<< * tp = parent._task_prefixes.get(prefix_key) * if tp is None: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_key_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_prefix_key = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":3940 * ts._state = state * prefix_key = key_split(key) * tp = parent._task_prefixes.get(prefix_key) # <<<<<<<<<<<<<< * if tp is None: * parent._task_prefixes[prefix_key] = tp = TaskPrefix(prefix_key) */ if (unlikely(__pyx_v_parent->_task_prefixes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3940, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_task_prefixes, __pyx_v_prefix_key, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskPrefix))))) __PYX_ERR(0, 3940, __pyx_L1_error) __pyx_v_tp = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3941 * prefix_key = key_split(key) * tp = parent._task_prefixes.get(prefix_key) * if tp is None: # <<<<<<<<<<<<<< * parent._task_prefixes[prefix_key] = tp = TaskPrefix(prefix_key) * ts._prefix = tp */ __pyx_t_4 = (((PyObject *)__pyx_v_tp) == Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":3942 * tp = parent._task_prefixes.get(prefix_key) * if tp is None: * parent._task_prefixes[prefix_key] = tp = TaskPrefix(prefix_key) # <<<<<<<<<<<<<< * ts._prefix = tp * */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11distributed_9scheduler_TaskPrefix), __pyx_v_prefix_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_parent->_task_prefixes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3942, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_parent->_task_prefixes, __pyx_v_prefix_key, __pyx_t_2) < 0)) __PYX_ERR(0, 3942, __pyx_L1_error) __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_tp, ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3941 * prefix_key = key_split(key) * tp = parent._task_prefixes.get(prefix_key) * if tp is None: # <<<<<<<<<<<<<< * parent._task_prefixes[prefix_key] = tp = TaskPrefix(prefix_key) * ts._prefix = tp */ } /* "distributed/scheduler.py":3943 * if tp is None: * parent._task_prefixes[prefix_key] = tp = TaskPrefix(prefix_key) * ts._prefix = tp # <<<<<<<<<<<<<< * * group_key = ts._group_key */ __Pyx_INCREF(((PyObject *)__pyx_v_tp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tp)); __Pyx_GOTREF(__pyx_v_ts->_prefix); __Pyx_DECREF(((PyObject *)__pyx_v_ts->_prefix)); __pyx_v_ts->_prefix = __pyx_v_tp; /* "distributed/scheduler.py":3945 * ts._prefix = tp * * group_key = ts._group_key # <<<<<<<<<<<<<< * tg = parent._task_groups.get(group_key) * if tg is None: */ __pyx_t_2 = __pyx_v_ts->_group_key; __Pyx_INCREF(__pyx_t_2); __pyx_v_group_key = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3946 * * group_key = ts._group_key * tg = parent._task_groups.get(group_key) # <<<<<<<<<<<<<< * if tg is None: * parent._task_groups[group_key] = tg = TaskGroup(group_key) */ if (unlikely(__pyx_v_parent->_task_groups == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3946, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_task_groups, __pyx_v_group_key, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(0, 3946, __pyx_L1_error) __pyx_v_tg = ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3947 * group_key = ts._group_key * tg = parent._task_groups.get(group_key) * if tg is None: # <<<<<<<<<<<<<< * parent._task_groups[group_key] = tg = TaskGroup(group_key) * tg._prefix = tp */ __pyx_t_5 = (((PyObject *)__pyx_v_tg) == Py_None); __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { /* "distributed/scheduler.py":3948 * tg = parent._task_groups.get(group_key) * if tg is None: * parent._task_groups[group_key] = tg = TaskGroup(group_key) # <<<<<<<<<<<<<< * tg._prefix = tp * tp._groups.append(tg) */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11distributed_9scheduler_TaskGroup), __pyx_v_group_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_parent->_task_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3948, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_parent->_task_groups, __pyx_v_group_key, __pyx_t_2) < 0)) __PYX_ERR(0, 3948, __pyx_L1_error) __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_tg, ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3949 * if tg is None: * parent._task_groups[group_key] = tg = TaskGroup(group_key) * tg._prefix = tp # <<<<<<<<<<<<<< * tp._groups.append(tg) * tg.add(ts) */ __Pyx_INCREF(((PyObject *)__pyx_v_tp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tp)); __Pyx_GOTREF(__pyx_v_tg->_prefix); __Pyx_DECREF(((PyObject *)__pyx_v_tg->_prefix)); __pyx_v_tg->_prefix = __pyx_v_tp; /* "distributed/scheduler.py":3950 * parent._task_groups[group_key] = tg = TaskGroup(group_key) * tg._prefix = tp * tp._groups.append(tg) # <<<<<<<<<<<<<< * tg.add(ts) * parent._tasks[key] = ts */ if (unlikely(__pyx_v_tp->_groups == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); __PYX_ERR(0, 3950, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_tp->_groups, ((PyObject *)__pyx_v_tg)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 3950, __pyx_L1_error) /* "distributed/scheduler.py":3947 * group_key = ts._group_key * tg = parent._task_groups.get(group_key) * if tg is None: # <<<<<<<<<<<<<< * parent._task_groups[group_key] = tg = TaskGroup(group_key) * tg._prefix = tp */ } /* "distributed/scheduler.py":3951 * tg._prefix = tp * tp._groups.append(tg) * tg.add(ts) # <<<<<<<<<<<<<< * parent._tasks[key] = ts * return ts */ __pyx_t_2 = __pyx_f_11distributed_9scheduler_9TaskGroup_add(__pyx_v_tg, ((PyObject *)__pyx_v_ts), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3952 * tp._groups.append(tg) * tg.add(ts) * parent._tasks[key] = ts # <<<<<<<<<<<<<< * return ts * */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3952, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_parent->_tasks, __pyx_v_key, ((PyObject *)__pyx_v_ts)) < 0)) __PYX_ERR(0, 3952, __pyx_L1_error) /* "distributed/scheduler.py":3953 * tg.add(ts) * parent._tasks[key] = ts * return ts # <<<<<<<<<<<<<< * * def stimulus_task_finished(self, key=None, worker=None, **kwargs): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __pyx_r = ((PyObject *)__pyx_v_ts); goto __pyx_L0; /* "distributed/scheduler.py":3932 * # TODO: balance workers * * def new_task(self, key, spec, state): # <<<<<<<<<<<<<< * """ Create a new task, and associated states """ * parent: SchedulerState = cast(SchedulerState, self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.new_task", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_tp); __Pyx_XDECREF((PyObject *)__pyx_v_tg); __Pyx_XDECREF(__pyx_v_prefix_key); __Pyx_XDECREF(__pyx_v_group_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3955 * return ts * * def stimulus_task_finished(self, key=None, worker=None, **kwargs): # <<<<<<<<<<<<<< * """ Mark that a task has finished execution on a particular worker """ * parent: SchedulerState = cast(SchedulerState, self) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_29stimulus_task_finished(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_28stimulus_task_finished[] = " Mark that a task has finished execution on a particular worker "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_29stimulus_task_finished = {"stimulus_task_finished", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_29stimulus_task_finished, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_28stimulus_task_finished}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_29stimulus_task_finished(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stimulus_task_finished (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_worker,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "stimulus_task_finished") < 0)) __PYX_ERR(0, 3955, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_worker = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stimulus_task_finished", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3955, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_task_finished", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_28stimulus_task_finished(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_worker, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_28stimulus_task_finished(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_tasks = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stimulus_task_finished", 0); /* "distributed/scheduler.py":3957 * def stimulus_task_finished(self, key=None, worker=None, **kwargs): * """ Mark that a task has finished execution on a particular worker """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * logger.debug("Stimulus task finished %s, %s", key, worker) * */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3958 * """ Mark that a task has finished execution on a particular worker """ * parent: SchedulerState = cast(SchedulerState, self) * logger.debug("Stimulus task finished %s, %s", key, worker) # <<<<<<<<<<<<<< * * tasks: dict = parent._tasks */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Stimulus_task_finished_s_s, __pyx_v_key, __pyx_v_worker}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3958, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Stimulus_task_finished_s_s, __pyx_v_key, __pyx_v_worker}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3958, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Stimulus_task_finished_s_s); __Pyx_GIVEREF(__pyx_kp_u_Stimulus_task_finished_s_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_u_Stimulus_task_finished_s_s); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_key); __Pyx_INCREF(__pyx_v_worker); __Pyx_GIVEREF(__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_worker); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3960 * logger.debug("Stimulus task finished %s, %s", key, worker) * * tasks: dict = parent._tasks # <<<<<<<<<<<<<< * ts: TaskState = tasks.get(key) * if ts is None: */ __pyx_t_1 = __pyx_v_parent->_tasks; __Pyx_INCREF(__pyx_t_1); __pyx_v_tasks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3961 * * tasks: dict = parent._tasks * ts: TaskState = tasks.get(key) # <<<<<<<<<<<<<< * if ts is None: * return {} */ if (unlikely(__pyx_v_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3961, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3961, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3962 * tasks: dict = parent._tasks * ts: TaskState = tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * return {} * ws: WorkerState = parent._workers_dv[worker] */ __pyx_t_6 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":3963 * ts: TaskState = tasks.get(key) * if ts is None: * return {} # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[worker] * ts._metadata.update(kwargs["metadata"]) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":3962 * tasks: dict = parent._tasks * ts: TaskState = tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * return {} * ws: WorkerState = parent._workers_dv[worker] */ } /* "distributed/scheduler.py":3964 * if ts is None: * return {} * ws: WorkerState = parent._workers_dv[worker] # <<<<<<<<<<<<<< * ts._metadata.update(kwargs["metadata"]) * */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3964, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_v_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 3964, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3965 * return {} * ws: WorkerState = parent._workers_dv[worker] * ts._metadata.update(kwargs["metadata"]) # <<<<<<<<<<<<<< * * recommendations: dict */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts->_metadata, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_u_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3968 * * recommendations: dict * if ts._state == "processing": # <<<<<<<<<<<<<< * recommendations = self.transition(key, "memory", worker=worker, **kwargs) * */ __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3968, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":3969 * recommendations: dict * if ts._state == "processing": * recommendations = self.transition(key, "memory", worker=worker, **kwargs) # <<<<<<<<<<<<<< * * if ts._state == "memory": */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __Pyx_INCREF(__pyx_n_u_memory_2); __Pyx_GIVEREF(__pyx_n_u_memory_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_memory_2); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_worker, __pyx_v_worker) < 0) __PYX_ERR(0, 3969, __pyx_L1_error) __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwargs) < 0) __PYX_ERR(0, 3969, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 3969, __pyx_L1_error) __pyx_v_recommendations = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3971 * recommendations = self.transition(key, "memory", worker=worker, **kwargs) * * if ts._state == "memory": # <<<<<<<<<<<<<< * assert ws in ts._who_has * else: */ __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3971, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":3972 * * if ts._state == "memory": * assert ws in ts._who_has # <<<<<<<<<<<<<< * else: * logger.debug( */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 3972, __pyx_L1_error) } __pyx_t_7 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ws), __pyx_v_ts->_who_has, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3972, __pyx_L1_error) if (unlikely(!(__pyx_t_7 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 3972, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":3971 * recommendations = self.transition(key, "memory", worker=worker, **kwargs) * * if ts._state == "memory": # <<<<<<<<<<<<<< * assert ws in ts._who_has * else: */ } /* "distributed/scheduler.py":3968 * * recommendations: dict * if ts._state == "processing": # <<<<<<<<<<<<<< * recommendations = self.transition(key, "memory", worker=worker, **kwargs) * */ goto __pyx_L4; } /* "distributed/scheduler.py":3974 * assert ws in ts._who_has * else: * logger.debug( # <<<<<<<<<<<<<< * "Received already computed task, worker: %s, state: %s" * ", key: %s, who_has: %s", */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":3980 * ts._state, * key, * ts._who_has, # <<<<<<<<<<<<<< * ) * if ws not in ts._who_has: */ __pyx_t_5 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[6] = {__pyx_t_5, __pyx_kp_u_Received_already_computed_task_w, __pyx_v_worker, __pyx_v_ts->_state, __pyx_v_key, __pyx_v_ts->_who_has}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3974, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[6] = {__pyx_t_5, __pyx_kp_u_Received_already_computed_task_w, __pyx_v_worker, __pyx_v_ts->_state, __pyx_v_key, __pyx_v_ts->_who_has}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3974, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_1 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_kp_u_Received_already_computed_task_w); __Pyx_GIVEREF(__pyx_kp_u_Received_already_computed_task_w); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_kp_u_Received_already_computed_task_w); __Pyx_INCREF(__pyx_v_worker); __Pyx_GIVEREF(__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_v_worker); __Pyx_INCREF(__pyx_v_ts->_state); __Pyx_GIVEREF(__pyx_v_ts->_state); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_4, __pyx_v_ts->_state); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_4, __pyx_v_key); __Pyx_INCREF(__pyx_v_ts->_who_has); __Pyx_GIVEREF(__pyx_v_ts->_who_has); PyTuple_SET_ITEM(__pyx_t_1, 4+__pyx_t_4, __pyx_v_ts->_who_has); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3982 * ts._who_has, * ) * if ws not in ts._who_has: # <<<<<<<<<<<<<< * self.worker_send(worker, {"op": "release-task", "key": key}) * recommendations = {} */ if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 3982, __pyx_L1_error) } __pyx_t_7 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ws), __pyx_v_ts->_who_has, Py_NE)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3982, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":3983 * ) * if ws not in ts._who_has: * self.worker_send(worker, {"op": "release-task", "key": key}) # <<<<<<<<<<<<<< * recommendations = {} * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_worker_send); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_op, __pyx_kp_u_release_task) < 0) __PYX_ERR(0, 3983, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_key, __pyx_v_key) < 0) __PYX_ERR(0, 3983, __pyx_L1_error) __pyx_t_5 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_worker, __pyx_t_1}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3983, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_worker, __pyx_t_1}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3983, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_worker); __Pyx_GIVEREF(__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_v_worker); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":3982 * ts._who_has, * ) * if ws not in ts._who_has: # <<<<<<<<<<<<<< * self.worker_send(worker, {"op": "release-task", "key": key}) * recommendations = {} */ } /* "distributed/scheduler.py":3984 * if ws not in ts._who_has: * self.worker_send(worker, {"op": "release-task", "key": key}) * recommendations = {} # <<<<<<<<<<<<<< * * return recommendations */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_recommendations = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L4:; /* "distributed/scheduler.py":3986 * recommendations = {} * * return recommendations # <<<<<<<<<<<<<< * * def stimulus_task_erred( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_recommendations); __pyx_r = __pyx_v_recommendations; goto __pyx_L0; /* "distributed/scheduler.py":3955 * return ts * * def stimulus_task_finished(self, key=None, worker=None, **kwargs): # <<<<<<<<<<<<<< * """ Mark that a task has finished execution on a particular worker """ * parent: SchedulerState = cast(SchedulerState, self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_task_finished", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_tasks); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":3988 * return recommendations * * def stimulus_task_erred( # <<<<<<<<<<<<<< * self, key=None, worker=None, exception=None, traceback=None, **kwargs * ): */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_31stimulus_task_erred(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_30stimulus_task_erred[] = " Mark that a task has erred on a particular worker "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_31stimulus_task_erred = {"stimulus_task_erred", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_31stimulus_task_erred, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_30stimulus_task_erred}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_31stimulus_task_erred(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_exception = 0; PyObject *__pyx_v_traceback = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stimulus_task_erred (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_worker,&__pyx_n_s_exception,&__pyx_n_s_traceback,0}; PyObject* values[5] = {0,0,0,0,0}; /* "distributed/scheduler.py":3989 * * def stimulus_task_erred( * self, key=None, worker=None, exception=None, traceback=None, **kwargs # <<<<<<<<<<<<<< * ): * """ Mark that a task has erred on a particular worker """ */ values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_traceback); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "stimulus_task_erred") < 0)) __PYX_ERR(0, 3988, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_worker = values[2]; __pyx_v_exception = values[3]; __pyx_v_traceback = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stimulus_task_erred", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3988, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_task_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_30stimulus_task_erred(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_worker, __pyx_v_exception, __pyx_v_traceback, __pyx_v_kwargs); /* "distributed/scheduler.py":3988 * return recommendations * * def stimulus_task_erred( # <<<<<<<<<<<<<< * self, key=None, worker=None, exception=None, traceback=None, **kwargs * ): */ /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_30stimulus_task_erred(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, PyObject *__pyx_v_exception, PyObject *__pyx_v_traceback, PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_retries = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stimulus_task_erred", 0); /* "distributed/scheduler.py":3992 * ): * """ Mark that a task has erred on a particular worker """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * logger.debug("Stimulus task erred %s, %s", key, worker) * */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3993 * """ Mark that a task has erred on a particular worker """ * parent: SchedulerState = cast(SchedulerState, self) * logger.debug("Stimulus task erred %s, %s", key, worker) # <<<<<<<<<<<<<< * * ts: TaskState = parent._tasks.get(key) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Stimulus_task_erred_s_s, __pyx_v_key, __pyx_v_worker}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3993, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Stimulus_task_erred_s_s, __pyx_v_key, __pyx_v_worker}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3993, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Stimulus_task_erred_s_s); __Pyx_GIVEREF(__pyx_kp_u_Stimulus_task_erred_s_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_u_Stimulus_task_erred_s_s); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_key); __Pyx_INCREF(__pyx_v_worker); __Pyx_GIVEREF(__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_worker); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3995 * logger.debug("Stimulus task erred %s, %s", key, worker) * * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is None: * return {} */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 3995, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 3995, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":3996 * * ts: TaskState = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * return {} * */ __pyx_t_6 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":3997 * ts: TaskState = parent._tasks.get(key) * if ts is None: * return {} # <<<<<<<<<<<<<< * * recommendations: dict */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":3996 * * ts: TaskState = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * return {} * */ } /* "distributed/scheduler.py":4000 * * recommendations: dict * if ts._state == "processing": # <<<<<<<<<<<<<< * retries = ts._retries * if retries > 0: */ __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 4000, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":4001 * recommendations: dict * if ts._state == "processing": * retries = ts._retries # <<<<<<<<<<<<<< * if retries > 0: * ts._retries = retries - 1 */ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ts->_retries); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retries = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4002 * if ts._state == "processing": * retries = ts._retries * if retries > 0: # <<<<<<<<<<<<<< * ts._retries = retries - 1 * recommendations = self.transition(key, "waiting") */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_retries, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4002, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4002, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "distributed/scheduler.py":4003 * retries = ts._retries * if retries > 0: * ts._retries = retries - 1 # <<<<<<<<<<<<<< * recommendations = self.transition(key, "waiting") * else: */ __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_retries, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4003, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ts->_retries = __pyx_t_8; /* "distributed/scheduler.py":4004 * if retries > 0: * ts._retries = retries - 1 * recommendations = self.transition(key, "waiting") # <<<<<<<<<<<<<< * else: * recommendations = self.transition( */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_n_u_waiting}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4004, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_n_u_waiting}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4004, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_v_key); __Pyx_INCREF(__pyx_n_u_waiting); __Pyx_GIVEREF(__pyx_n_u_waiting); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_n_u_waiting); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4004, __pyx_L1_error) __pyx_v_recommendations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4002 * if ts._state == "processing": * retries = ts._retries * if retries > 0: # <<<<<<<<<<<<<< * ts._retries = retries - 1 * recommendations = self.transition(key, "waiting") */ goto __pyx_L5; } /* "distributed/scheduler.py":4006 * recommendations = self.transition(key, "waiting") * else: * recommendations = self.transition( # <<<<<<<<<<<<<< * key, * "erred", */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":4007 * else: * recommendations = self.transition( * key, # <<<<<<<<<<<<<< * "erred", * cause=key, */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __Pyx_INCREF(__pyx_n_u_erred); __Pyx_GIVEREF(__pyx_n_u_erred); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_erred); /* "distributed/scheduler.py":4009 * key, * "erred", * cause=key, # <<<<<<<<<<<<<< * exception=exception, * traceback=traceback, */ __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cause, __pyx_v_key) < 0) __PYX_ERR(0, 4009, __pyx_L1_error) /* "distributed/scheduler.py":4010 * "erred", * cause=key, * exception=exception, # <<<<<<<<<<<<<< * traceback=traceback, * worker=worker, */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_exception, __pyx_v_exception) < 0) __PYX_ERR(0, 4009, __pyx_L1_error) /* "distributed/scheduler.py":4011 * cause=key, * exception=exception, * traceback=traceback, # <<<<<<<<<<<<<< * worker=worker, * **kwargs, */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_traceback, __pyx_v_traceback) < 0) __PYX_ERR(0, 4009, __pyx_L1_error) /* "distributed/scheduler.py":4012 * exception=exception, * traceback=traceback, * worker=worker, # <<<<<<<<<<<<<< * **kwargs, * ) */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_worker, __pyx_v_worker) < 0) __PYX_ERR(0, 4009, __pyx_L1_error) __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":4013 * traceback=traceback, * worker=worker, * **kwargs, # <<<<<<<<<<<<<< * ) * else: */ if (__Pyx_MergeKeywords(__pyx_t_2, __pyx_v_kwargs) < 0) __PYX_ERR(0, 4013, __pyx_L1_error) /* "distributed/scheduler.py":4006 * recommendations = self.transition(key, "waiting") * else: * recommendations = self.transition( # <<<<<<<<<<<<<< * key, * "erred", */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyDict_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 4006, __pyx_L1_error) __pyx_v_recommendations = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; } __pyx_L5:; /* "distributed/scheduler.py":4000 * * recommendations: dict * if ts._state == "processing": # <<<<<<<<<<<<<< * retries = ts._retries * if retries > 0: */ goto __pyx_L4; } /* "distributed/scheduler.py":4016 * ) * else: * recommendations = {} # <<<<<<<<<<<<<< * * return recommendations */ /*else*/ { __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_recommendations = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; } __pyx_L4:; /* "distributed/scheduler.py":4018 * recommendations = {} * * return recommendations # <<<<<<<<<<<<<< * * def stimulus_missing_data( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_recommendations); __pyx_r = __pyx_v_recommendations; goto __pyx_L0; /* "distributed/scheduler.py":3988 * return recommendations * * def stimulus_task_erred( # <<<<<<<<<<<<<< * self, key=None, worker=None, exception=None, traceback=None, **kwargs * ): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_task_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_retries); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4020 * return recommendations * * def stimulus_missing_data( # <<<<<<<<<<<<<< * self, cause=None, key=None, worker=None, ensure=True, **kwargs * ): */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_33stimulus_missing_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_32stimulus_missing_data[] = " Mark that certain keys have gone missing. Recover. "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_33stimulus_missing_data = {"stimulus_missing_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_33stimulus_missing_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_32stimulus_missing_data}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_33stimulus_missing_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_cause = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_worker = 0; CYTHON_UNUSED PyObject *__pyx_v_ensure = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stimulus_missing_data (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_cause,&__pyx_n_s_key,&__pyx_n_s_worker,&__pyx_n_s_ensure,0}; PyObject* values[5] = {0,0,0,0,0}; /* "distributed/scheduler.py":4021 * * def stimulus_missing_data( * self, cause=None, key=None, worker=None, ensure=True, **kwargs # <<<<<<<<<<<<<< * ): * """ Mark that certain keys have gone missing. Recover. """ */ values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_True)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cause); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ensure); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "stimulus_missing_data") < 0)) __PYX_ERR(0, 4020, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_cause = values[1]; __pyx_v_key = values[2]; __pyx_v_worker = values[3]; __pyx_v_ensure = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stimulus_missing_data", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4020, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_missing_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_32stimulus_missing_data(__pyx_self, __pyx_v_self, __pyx_v_cause, __pyx_v_key, __pyx_v_worker, __pyx_v_ensure, __pyx_v_kwargs); /* "distributed/scheduler.py":4020 * return recommendations * * def stimulus_missing_data( # <<<<<<<<<<<<<< * self, cause=None, key=None, worker=None, ensure=True, **kwargs * ): */ /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_32stimulus_missing_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cause, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_ensure, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_cts = 0; PyObject *__pyx_v_recommendations = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; int __pyx_t_15; int __pyx_t_16; Py_ssize_t __pyx_t_17; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stimulus_missing_data", 0); /* "distributed/scheduler.py":4024 * ): * """ Mark that certain keys have gone missing. Recover. """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * with log_errors(): * logger.debug("Stimulus missing data %s, %s", key, worker) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4025 * """ Mark that certain keys have gone missing. Recover. """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * logger.debug("Stimulus missing data %s, %s", key, worker) * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4025, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4025, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":4026 * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): * logger.debug("Stimulus missing data %s, %s", key, worker) # <<<<<<<<<<<<<< * * ts: TaskState = parent._tasks.get(key) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4026, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4026, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Stimulus_missing_data_s_s, __pyx_v_key, __pyx_v_worker}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4026, __pyx_L7_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Stimulus_missing_data_s_s, __pyx_v_key, __pyx_v_worker}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4026, __pyx_L7_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4026, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Stimulus_missing_data_s_s); __Pyx_GIVEREF(__pyx_kp_u_Stimulus_missing_data_s_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_kp_u_Stimulus_missing_data_s_s); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_key); __Pyx_INCREF(__pyx_v_worker); __Pyx_GIVEREF(__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_9, __pyx_v_worker); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4026, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4028 * logger.debug("Stimulus missing data %s, %s", key, worker) * * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is None or ts._state == "memory": * return {} */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4028, __pyx_L7_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4028, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4028, __pyx_L7_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4029 * * ts: TaskState = parent._tasks.get(key) * if ts is None or ts._state == "memory": # <<<<<<<<<<<<<< * return {} * cts: TaskState = parent._tasks.get(cause) */ __pyx_t_11 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (!__pyx_t_12) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L14_bool_binop_done; } __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4029, __pyx_L7_error) __pyx_t_11 = (__pyx_t_12 != 0); __pyx_t_10 = __pyx_t_11; __pyx_L14_bool_binop_done:; if (__pyx_t_10) { /* "distributed/scheduler.py":4030 * ts: TaskState = parent._tasks.get(key) * if ts is None or ts._state == "memory": * return {} # <<<<<<<<<<<<<< * cts: TaskState = parent._tasks.get(cause) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4030, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "distributed/scheduler.py":4029 * * ts: TaskState = parent._tasks.get(key) * if ts is None or ts._state == "memory": # <<<<<<<<<<<<<< * return {} * cts: TaskState = parent._tasks.get(cause) */ } /* "distributed/scheduler.py":4031 * if ts is None or ts._state == "memory": * return {} * cts: TaskState = parent._tasks.get(cause) # <<<<<<<<<<<<<< * * recommendations: dict = {} */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4031, __pyx_L7_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_cause, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4031, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4031, __pyx_L7_error) __pyx_v_cts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4033 * cts: TaskState = parent._tasks.get(cause) * * recommendations: dict = {} # <<<<<<<<<<<<<< * * if cts is not None and cts._state == "memory": # couldn't find this */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4033, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_recommendations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4035 * recommendations: dict = {} * * if cts is not None and cts._state == "memory": # couldn't find this # <<<<<<<<<<<<<< * ws: WorkerState * for ws in cts._who_has: # TODO: this behavior is extreme */ __pyx_t_11 = (((PyObject *)__pyx_v_cts) != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L17_bool_binop_done; } __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_cts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4035, __pyx_L7_error) __pyx_t_11 = (__pyx_t_12 != 0); __pyx_t_10 = __pyx_t_11; __pyx_L17_bool_binop_done:; if (__pyx_t_10) { /* "distributed/scheduler.py":4037 * if cts is not None and cts._state == "memory": # couldn't find this * ws: WorkerState * for ws in cts._who_has: # TODO: this behavior is extreme # <<<<<<<<<<<<<< * ws._has_what.remove(cts) * ws._nbytes -= cts.get_nbytes() */ __pyx_t_13 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_v_cts->_who_has, 1, (&__pyx_t_14), (&__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4037, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_15 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_14, &__pyx_t_13, &__pyx_t_3, __pyx_t_9); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 4037, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4037, __pyx_L7_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":4038 * ws: WorkerState * for ws in cts._who_has: # TODO: this behavior is extreme * ws._has_what.remove(cts) # <<<<<<<<<<<<<< * ws._nbytes -= cts.get_nbytes() * cts._who_has.clear() */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 4038, __pyx_L7_error) } __pyx_t_16 = __Pyx_PySet_Remove(__pyx_v_ws->_has_what, ((PyObject *)__pyx_v_cts)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 4038, __pyx_L7_error) /* "distributed/scheduler.py":4039 * for ws in cts._who_has: # TODO: this behavior is extreme * ws._has_what.remove(cts) * ws._nbytes -= cts.get_nbytes() # <<<<<<<<<<<<<< * cts._who_has.clear() * recommendations[cause] = "released" */ __pyx_t_17 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_cts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4039, __pyx_L7_error) __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes - __pyx_t_17); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4040 * ws._has_what.remove(cts) * ws._nbytes -= cts.get_nbytes() * cts._who_has.clear() # <<<<<<<<<<<<<< * recommendations[cause] = "released" * */ if (unlikely(__pyx_v_cts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 4040, __pyx_L7_error) } __pyx_t_16 = PySet_Clear(__pyx_v_cts->_who_has); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 4040, __pyx_L7_error) /* "distributed/scheduler.py":4041 * ws._nbytes -= cts.get_nbytes() * cts._who_has.clear() * recommendations[cause] = "released" # <<<<<<<<<<<<<< * * if key: */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_cause, __pyx_n_u_released) < 0)) __PYX_ERR(0, 4041, __pyx_L7_error) /* "distributed/scheduler.py":4035 * recommendations: dict = {} * * if cts is not None and cts._state == "memory": # couldn't find this # <<<<<<<<<<<<<< * ws: WorkerState * for ws in cts._who_has: # TODO: this behavior is extreme */ } /* "distributed/scheduler.py":4043 * recommendations[cause] = "released" * * if key: # <<<<<<<<<<<<<< * recommendations[key] = "released" * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 4043, __pyx_L7_error) if (__pyx_t_10) { /* "distributed/scheduler.py":4044 * * if key: * recommendations[key] = "released" # <<<<<<<<<<<<<< * * self.transitions(recommendations) */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 4044, __pyx_L7_error) /* "distributed/scheduler.py":4043 * recommendations[cause] = "released" * * if key: # <<<<<<<<<<<<<< * recommendations[key] = "released" * */ } /* "distributed/scheduler.py":4046 * recommendations[key] = "released" * * self.transitions(recommendations) # <<<<<<<<<<<<<< * * if parent._validate: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4046, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_recommendations) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_recommendations); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4046, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4048 * self.transitions(recommendations) * * if parent._validate: # <<<<<<<<<<<<<< * assert cause not in self.who_has * */ __pyx_t_10 = (__pyx_v_parent->_validate != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":4049 * * if parent._validate: * assert cause not in self.who_has # <<<<<<<<<<<<<< * * return {} */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_who_has); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4049, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_cause, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 4049, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!(__pyx_t_10 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4049, __pyx_L7_error) } } #endif /* "distributed/scheduler.py":4048 * self.transitions(recommendations) * * if parent._validate: # <<<<<<<<<<<<<< * assert cause not in self.who_has * */ } /* "distributed/scheduler.py":4051 * assert cause not in self.who_has * * return {} # <<<<<<<<<<<<<< * * def stimulus_retry(self, comm=None, keys=None, client=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4051, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "distributed/scheduler.py":4025 * """ Mark that certain keys have gone missing. Recover. """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * logger.debug("Stimulus missing data %s, %s", key, worker) * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_missing_data", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 4025, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4025, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4025, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_18); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 4025, __pyx_L9_except_error) __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; __PYX_ERR(0, 4025, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_4) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L26; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L26:; } /* "distributed/scheduler.py":4020 * return recommendations * * def stimulus_missing_data( # <<<<<<<<<<<<<< * self, cause=None, key=None, worker=None, ensure=True, **kwargs * ): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_missing_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_cts); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4053 * return {} * * def stimulus_retry(self, comm=None, keys=None, client=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Client %s requests to retry %d keys", client, len(keys)) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_35stimulus_retry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_35stimulus_retry = {"stimulus_retry", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_35stimulus_retry, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_35stimulus_retry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_client = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stimulus_retry (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_client,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stimulus_retry") < 0)) __PYX_ERR(0, 4053, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_client = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stimulus_retry", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4053, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_retry", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_34stimulus_retry(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_client); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_34stimulus_retry(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_client) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_stack = NULL; PyObject *__pyx_v_seen = NULL; PyObject *__pyx_v_roots = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_erred_deps = NULL; PyObject *__pyx_v_recommendations = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr43__pyx_v_dts = NULL; PyObject *__pyx_9genexpr44__pyx_v_key = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stimulus_retry", 0); /* "distributed/scheduler.py":4054 * * def stimulus_retry(self, comm=None, keys=None, client=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * logger.info("Client %s requests to retry %d keys", client, len(keys)) * if client: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4055 * def stimulus_retry(self, comm=None, keys=None, client=None): * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Client %s requests to retry %d keys", client, len(keys)) # <<<<<<<<<<<<<< * if client: * self.log_event(client, {"action": "retry", "count": len(keys)}) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4055, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_kp_u_Client_s_requests_to_retry_d_key, __pyx_v_client, __pyx_t_2}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_kp_u_Client_s_requests_to_retry_d_key, __pyx_v_client, __pyx_t_2}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_kp_u_Client_s_requests_to_retry_d_key); __Pyx_GIVEREF(__pyx_kp_u_Client_s_requests_to_retry_d_key); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_Client_s_requests_to_retry_d_key); __Pyx_INCREF(__pyx_v_client); __Pyx_GIVEREF(__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_client); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4056 * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Client %s requests to retry %d keys", client, len(keys)) * if client: # <<<<<<<<<<<<<< * self.log_event(client, {"action": "retry", "count": len(keys)}) * */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_client); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4056, __pyx_L1_error) if (__pyx_t_8) { /* "distributed/scheduler.py":4057 * logger.info("Client %s requests to retry %d keys", client, len(keys)) * if client: * self.log_event(client, {"action": "retry", "count": len(keys)}) # <<<<<<<<<<<<<< * * stack = list(keys) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_action, __pyx_n_u_retry) < 0) __PYX_ERR(0, 4057, __pyx_L1_error) __pyx_t_4 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4057, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_count, __pyx_t_2) < 0) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_client, __pyx_t_7}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_client, __pyx_t_7}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_client); __Pyx_GIVEREF(__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_client); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4056 * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Client %s requests to retry %d keys", client, len(keys)) * if client: # <<<<<<<<<<<<<< * self.log_event(client, {"action": "retry", "count": len(keys)}) * */ } /* "distributed/scheduler.py":4059 * self.log_event(client, {"action": "retry", "count": len(keys)}) * * stack = list(keys) # <<<<<<<<<<<<<< * seen = set() * roots = [] */ __pyx_t_1 = PySequence_List(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_stack = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4060 * * stack = list(keys) * seen = set() # <<<<<<<<<<<<<< * roots = [] * ts: TaskState */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_seen = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4061 * stack = list(keys) * seen = set() * roots = [] # <<<<<<<<<<<<<< * ts: TaskState * dts: TaskState */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_roots = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4064 * ts: TaskState * dts: TaskState * while stack: # <<<<<<<<<<<<<< * key = stack.pop() * seen.add(key) */ while (1) { __pyx_t_8 = (PyList_GET_SIZE(__pyx_v_stack) != 0); if (!__pyx_t_8) break; /* "distributed/scheduler.py":4065 * dts: TaskState * while stack: * key = stack.pop() # <<<<<<<<<<<<<< * seen.add(key) * ts = parent._tasks[key] */ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_stack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4066 * while stack: * key = stack.pop() * seen.add(key) # <<<<<<<<<<<<<< * ts = parent._tasks[key] * erred_deps = [dts._key for dts in ts._dependencies if dts._state == "erred"] */ __pyx_t_9 = PySet_Add(__pyx_v_seen, __pyx_v_key); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4066, __pyx_L1_error) /* "distributed/scheduler.py":4067 * key = stack.pop() * seen.add(key) * ts = parent._tasks[key] # <<<<<<<<<<<<<< * erred_deps = [dts._key for dts in ts._dependencies if dts._state == "erred"] * if erred_deps: */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4067, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4067, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":4068 * seen.add(key) * ts = parent._tasks[key] * erred_deps = [dts._key for dts in ts._dependencies if dts._state == "erred"] # <<<<<<<<<<<<<< * if erred_deps: * stack.extend(erred_deps) */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4068, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_10), (&__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4068, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_10, &__pyx_t_4, &__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4068, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4068, __pyx_L8_error) __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_9genexpr43__pyx_v_dts->_state, __pyx_n_u_erred, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4068, __pyx_L8_error) __pyx_t_12 = (__pyx_t_8 != 0); if (__pyx_t_12) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr43__pyx_v_dts->_key))) __PYX_ERR(0, 4068, __pyx_L8_error) } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr43__pyx_v_dts); __pyx_9genexpr43__pyx_v_dts = 0; goto __pyx_L12_exit_scope; __pyx_L8_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr43__pyx_v_dts); __pyx_9genexpr43__pyx_v_dts = 0; goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_erred_deps, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":4069 * ts = parent._tasks[key] * erred_deps = [dts._key for dts in ts._dependencies if dts._state == "erred"] * if erred_deps: # <<<<<<<<<<<<<< * stack.extend(erred_deps) * else: */ __pyx_t_12 = (PyList_GET_SIZE(__pyx_v_erred_deps) != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":4070 * erred_deps = [dts._key for dts in ts._dependencies if dts._state == "erred"] * if erred_deps: * stack.extend(erred_deps) # <<<<<<<<<<<<<< * else: * roots.append(key) */ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_stack, __pyx_v_erred_deps); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4070, __pyx_L1_error) /* "distributed/scheduler.py":4069 * ts = parent._tasks[key] * erred_deps = [dts._key for dts in ts._dependencies if dts._state == "erred"] * if erred_deps: # <<<<<<<<<<<<<< * stack.extend(erred_deps) * else: */ goto __pyx_L13; } /* "distributed/scheduler.py":4072 * stack.extend(erred_deps) * else: * roots.append(key) # <<<<<<<<<<<<<< * * recommendations: dict = {key: "waiting" for key in roots} */ /*else*/ { __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_roots, __pyx_v_key); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4072, __pyx_L1_error) } __pyx_L13:; } /* "distributed/scheduler.py":4074 * roots.append(key) * * recommendations: dict = {key: "waiting" for key in roots} # <<<<<<<<<<<<<< * self.transitions(recommendations) * */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4074, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_roots; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; for (;;) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4074, __pyx_L16_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4074, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr44__pyx_v_key, (PyObject*)__pyx_n_u_waiting))) __PYX_ERR(0, 4074, __pyx_L16_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_key); __pyx_9genexpr44__pyx_v_key = 0; goto __pyx_L19_exit_scope; __pyx_L16_error:; __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_key); __pyx_9genexpr44__pyx_v_key = 0; goto __pyx_L1_error; __pyx_L19_exit_scope:; } /* exit inner scope */ __pyx_v_recommendations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4075 * * recommendations: dict = {key: "waiting" for key in roots} * self.transitions(recommendations) # <<<<<<<<<<<<<< * * if parent._validate: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_recommendations) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_recommendations); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4077 * self.transitions(recommendations) * * if parent._validate: # <<<<<<<<<<<<<< * for key in seen: * assert not parent._tasks[key].exception_blame */ __pyx_t_12 = (__pyx_v_parent->_validate != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":4078 * * if parent._validate: * for key in seen: # <<<<<<<<<<<<<< * assert not parent._tasks[key].exception_blame * */ __pyx_t_10 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_v_seen, 1, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_10, &__pyx_t_3, __pyx_t_6); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4079 * if parent._validate: * for key in seen: * assert not parent._tasks[key].exception_blame # <<<<<<<<<<<<<< * * return tuple(seen) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4079, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exception_blame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4079, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!((!__pyx_t_12) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4079, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4077 * self.transitions(recommendations) * * if parent._validate: # <<<<<<<<<<<<<< * for key in seen: * assert not parent._tasks[key].exception_blame */ } /* "distributed/scheduler.py":4081 * assert not parent._tasks[key].exception_blame * * return tuple(seen) # <<<<<<<<<<<<<< * * async def remove_worker(self, comm=None, address=None, safe=False, close=True): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PySequence_Tuple(__pyx_v_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":4053 * return {} * * def stimulus_retry(self, comm=None, keys=None, client=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Client %s requests to retry %d keys", client, len(keys)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_retry", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_stack); __Pyx_XDECREF(__pyx_v_seen); __Pyx_XDECREF(__pyx_v_roots); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_erred_deps); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF((PyObject *)__pyx_9genexpr43__pyx_v_dts); __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_38generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4083 * return tuple(seen) * * async def remove_worker(self, comm=None, address=None, safe=False, close=True): # <<<<<<<<<<<<<< * """ * Remove worker from cluster */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_37remove_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_36remove_worker[] = "\n Remove worker from cluster\n\n We do this when a worker reports that it plans to leave or when it\n appears to be unresponsive. This may send its tasks back to a released\n state.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_37remove_worker = {"remove_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_37remove_worker, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_36remove_worker}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_37remove_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_address = 0; PyObject *__pyx_v_safe = 0; PyObject *__pyx_v_close = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_worker (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_address,&__pyx_n_s_safe,&__pyx_n_s_close,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_False)); values[4] = ((PyObject *)((PyObject *)Py_True)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_address); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_worker") < 0)) __PYX_ERR(0, 4083, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_address = values[2]; __pyx_v_safe = values[3]; __pyx_v_close = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_worker", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4083, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_36remove_worker(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_address, __pyx_v_safe, __pyx_v_close); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_36remove_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_address, PyObject *__pyx_v_safe, PyObject *__pyx_v_close) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_worker", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_17_remove_worker(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_17_remove_worker, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4083, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_address = __pyx_v_address; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_address); __pyx_cur_scope->__pyx_v_safe = __pyx_v_safe; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_safe); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_safe); __pyx_cur_scope->__pyx_v_close = __pyx_v_close; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_close); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_close); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_38generator5, __pyx_codeobj__58, (PyObject *) __pyx_cur_scope, __pyx_n_s_remove_worker, __pyx_n_s_Scheduler_remove_worker, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4083, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4185 * self.bandwidth_workers.pop((w, address), None) * * def remove_worker_from_events(): # <<<<<<<<<<<<<< * # If the worker isn't registered anymore after the delay, remove from events * if address not in parent._workers_dv and address in self.events: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_13remove_worker_1remove_worker_from_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_13remove_worker_1remove_worker_from_events = {"remove_worker_from_events", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_13remove_worker_1remove_worker_from_events, METH_NOARGS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_13remove_worker_1remove_worker_from_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_worker_from_events (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_13remove_worker_remove_worker_from_events(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_13remove_worker_remove_worker_from_events(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_worker_from_events", 0); __pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "distributed/scheduler.py":4187 * def remove_worker_from_events(): * # If the worker isn't registered anymore after the delay, remove from events * if address not in parent._workers_dv and address in self.events: # <<<<<<<<<<<<<< * del self.events[address] * */ if (unlikely(!__pyx_cur_scope->__pyx_v_address)) { __Pyx_RaiseClosureNameError("address"); __PYX_ERR(0, 4187, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_v_parent)) { __Pyx_RaiseClosureNameError("parent"); __PYX_ERR(0, 4187, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4187, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_address, __pyx_cur_scope->__pyx_v_parent->_workers_dv, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4187, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } if (unlikely(!__pyx_cur_scope->__pyx_v_address)) { __Pyx_RaiseClosureNameError("address"); __PYX_ERR(0, 4187, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4187, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_events); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_address, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "distributed/scheduler.py":4188 * # If the worker isn't registered anymore after the delay, remove from events * if address not in parent._workers_dv and address in self.events: * del self.events[address] # <<<<<<<<<<<<<< * * cleanup_delay = parse_timedelta( */ if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4188, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_events); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_v_address)) { __Pyx_RaiseClosureNameError("address"); __PYX_ERR(0, 4188, __pyx_L1_error) } if (unlikely(PyObject_DelItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_address) < 0)) __PYX_ERR(0, 4188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4187 * def remove_worker_from_events(): * # If the worker isn't registered anymore after the delay, remove from events * if address not in parent._workers_dv and address in self.events: # <<<<<<<<<<<<<< * del self.events[address] * */ } /* "distributed/scheduler.py":4185 * self.bandwidth_workers.pop((w, address), None) * * def remove_worker_from_events(): # <<<<<<<<<<<<<< * # If the worker isn't registered anymore after the delay, remove from events * if address not in parent._workers_dv and address in self.events: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_worker.remove_worker_from_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4083 * return tuple(seen) * * async def remove_worker(self, comm=None, address=None, safe=False, close=True): # <<<<<<<<<<<<<< * """ * Remove worker from cluster */ static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_38generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_t_20; Py_ssize_t __pyx_t_21; struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_t_22 = NULL; Py_ssize_t __pyx_t_23; int __pyx_t_24; PyObject *(*__pyx_t_25)(PyObject *); PyObject *__pyx_t_26 = NULL; char const *__pyx_t_27; PyObject *__pyx_t_28 = NULL; PyObject *__pyx_t_29 = NULL; PyObject *__pyx_t_30 = NULL; PyObject *__pyx_t_31 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_worker", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L51_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4083, __pyx_L1_error) /* "distributed/scheduler.py":4091 * state. * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * with log_errors(): * if self.status == Status.closed: */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4092 * """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * if self.status == Status.closed: * return */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4092, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4092, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":4093 * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): * if self.status == Status.closed: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4093, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4093, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_closed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4093, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4093, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4093, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_9) { /* "distributed/scheduler.py":4094 * with log_errors(): * if self.status == Status.closed: * return # <<<<<<<<<<<<<< * * address = self.coerce_address(address) */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L12_try_return; /* "distributed/scheduler.py":4093 * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): * if self.status == Status.closed: # <<<<<<<<<<<<<< * return * */ } /* "distributed/scheduler.py":4096 * return * * address = self.coerce_address(address) # <<<<<<<<<<<<<< * * if address not in parent._workers_dv: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4096, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4096, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_address); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_address, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4098 * address = self.coerce_address(address) * * if address not in parent._workers_dv: # <<<<<<<<<<<<<< * return "already-removed" * */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4098, __pyx_L8_error) } __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_address, __pyx_cur_scope->__pyx_v_parent->_workers_dv, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4098, __pyx_L8_error) __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":4099 * * if address not in parent._workers_dv: * return "already-removed" # <<<<<<<<<<<<<< * * host = get_address_host(address) */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_kp_u_already_removed); goto __pyx_L12_try_return; /* "distributed/scheduler.py":4098 * address = self.coerce_address(address) * * if address not in parent._workers_dv: # <<<<<<<<<<<<<< * return "already-removed" * */ } /* "distributed/scheduler.py":4101 * return "already-removed" * * host = get_address_host(address) # <<<<<<<<<<<<<< * * ws: WorkerState = parent._workers_dv[address] */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_address_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4101, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4101, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_host = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":4103 * host = get_address_host(address) * * ws: WorkerState = parent._workers_dv[address] # <<<<<<<<<<<<<< * * self.log_event( */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4103, __pyx_L8_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_workers_dv, __pyx_cur_scope->__pyx_v_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4103, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4103, __pyx_L8_error) __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4105 * ws: WorkerState = parent._workers_dv[address] * * self.log_event( # <<<<<<<<<<<<<< * ["all", address], * { */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4105, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":4106 * * self.log_event( * ["all", address], # <<<<<<<<<<<<<< * { * "action": "remove-worker", */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4106, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_all); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_address); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_address); /* "distributed/scheduler.py":4108 * ["all", address], * { * "action": "remove-worker", # <<<<<<<<<<<<<< * "worker": address, * "processing-tasks": dict(ws._processing), */ __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4108, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_action, __pyx_kp_u_remove_worker_2) < 0) __PYX_ERR(0, 4108, __pyx_L8_error) /* "distributed/scheduler.py":4109 * { * "action": "remove-worker", * "worker": address, # <<<<<<<<<<<<<< * "processing-tasks": dict(ws._processing), * }, */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_worker, __pyx_cur_scope->__pyx_v_address) < 0) __PYX_ERR(0, 4108, __pyx_L8_error) /* "distributed/scheduler.py":4110 * "action": "remove-worker", * "worker": address, * "processing-tasks": dict(ws._processing), # <<<<<<<<<<<<<< * }, * ) */ if (unlikely(__pyx_cur_scope->__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); __PYX_ERR(0, 4110, __pyx_L8_error) } __pyx_t_11 = PyDict_Copy(__pyx_cur_scope->__pyx_v_ws->_processing); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4110, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_processing_tasks, __pyx_t_11) < 0) __PYX_ERR(0, 4108, __pyx_L8_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4105, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4105, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4105, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4105, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4113 * }, * ) * logger.info("Remove worker %s", ws) # <<<<<<<<<<<<<< * if close: * with suppress(AttributeError, CommClosedError): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4113, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4113, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_Remove_worker_s, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4113, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_Remove_worker_s, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4113, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4113, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_kp_u_Remove_worker_s); __Pyx_GIVEREF(__pyx_kp_u_Remove_worker_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_12, __pyx_kp_u_Remove_worker_s); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_12, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4113, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4114 * ) * logger.info("Remove worker %s", ws) * if close: # <<<<<<<<<<<<<< * with suppress(AttributeError, CommClosedError): * self.stream_comms[address].send({"op": "close", "report": False}) */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_close); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 4114, __pyx_L8_error) if (__pyx_t_10) { /* "distributed/scheduler.py":4115 * logger.info("Remove worker %s", ws) * if close: * with suppress(AttributeError, CommClosedError): # <<<<<<<<<<<<<< * self.stream_comms[address].send({"op": "close", "report": False}) * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_suppress); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4115, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4115, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_builtin_AttributeError, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4115, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_builtin_AttributeError, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4115, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4115, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_builtin_AttributeError); __Pyx_GIVEREF(__pyx_builtin_AttributeError); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_12, __pyx_builtin_AttributeError); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_12, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4115, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4115, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4115, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_13 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4115, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "distributed/scheduler.py":4116 * if close: * with suppress(AttributeError, CommClosedError): * self.stream_comms[address].send({"op": "close", "report": False}) # <<<<<<<<<<<<<< * * self.remove_resources(address) */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4116, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_13, __pyx_cur_scope->__pyx_v_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4116, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_send); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4116, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4116, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_op, __pyx_n_u_close) < 0) __PYX_ERR(0, 4116, __pyx_L21_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_report, Py_False) < 0) __PYX_ERR(0, 4116, __pyx_L21_error) __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4116, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4115 * logger.info("Remove worker %s", ws) * if close: * with suppress(AttributeError, CommClosedError): # <<<<<<<<<<<<<< * self.stream_comms[address].send({"op": "close", "report": False}) * */ } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L26_try_end; __pyx_L21_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_13, &__pyx_t_1) < 0) __PYX_ERR(0, 4115, __pyx_L23_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_13); __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4115, __pyx_L23_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4115, __pyx_L23_except_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_18); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 4115, __pyx_L23_except_error) __pyx_t_9 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_13, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_13 = 0; __pyx_t_1 = 0; __PYX_ERR(0, 4115, __pyx_L23_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L22_exception_handled; } __pyx_L23_except_error:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); goto __pyx_L8_error; __pyx_L22_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_L26_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_14) { __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 4115, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } goto __pyx_L20; } __pyx_L20:; } goto __pyx_L30; __pyx_L17_error:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L8_error; __pyx_L30:; } /* "distributed/scheduler.py":4114 * ) * logger.info("Remove worker %s", ws) * if close: # <<<<<<<<<<<<<< * with suppress(AttributeError, CommClosedError): * self.stream_comms[address].send({"op": "close", "report": False}) */ } /* "distributed/scheduler.py":4118 * self.stream_comms[address].send({"op": "close", "report": False}) * * self.remove_resources(address) # <<<<<<<<<<<<<< * * parent._host_info[host]["nthreads"] -= ws._nthreads */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_resources); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4118, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_2, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4118, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4120 * self.remove_resources(address) * * parent._host_info[host]["nthreads"] -= ws._nthreads # <<<<<<<<<<<<<< * parent._host_info[host]["addresses"].remove(address) * parent._total_nthreads -= ws._nthreads */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4120, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_u_nthreads); __pyx_t_19 = __pyx_n_u_nthreads; __pyx_t_13 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_t_19); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4120, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_2 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_ws->_nthreads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4120, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4120, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_19, __pyx_t_5) < 0)) __PYX_ERR(0, 4120, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4121 * * parent._host_info[host]["nthreads"] -= ws._nthreads * parent._host_info[host]["addresses"].remove(address) # <<<<<<<<<<<<<< * parent._total_nthreads -= ws._nthreads * */ __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4121, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_addresses); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4121, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4121, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4121, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4122 * parent._host_info[host]["nthreads"] -= ws._nthreads * parent._host_info[host]["addresses"].remove(address) * parent._total_nthreads -= ws._nthreads # <<<<<<<<<<<<<< * * if not parent._host_info[host]["addresses"]: */ __pyx_cur_scope->__pyx_v_parent->_total_nthreads = (__pyx_cur_scope->__pyx_v_parent->_total_nthreads - __pyx_cur_scope->__pyx_v_ws->_nthreads); /* "distributed/scheduler.py":4124 * parent._total_nthreads -= ws._nthreads * * if not parent._host_info[host]["addresses"]: # <<<<<<<<<<<<<< * del parent._host_info[host] * */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4124, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_addresses); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4124, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4124, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = ((!__pyx_t_9) != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":4125 * * if not parent._host_info[host]["addresses"]: * del parent._host_info[host] # <<<<<<<<<<<<<< * * self.rpc.remove(address) */ if (unlikely(PyObject_DelItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host) < 0)) __PYX_ERR(0, 4125, __pyx_L8_error) /* "distributed/scheduler.py":4124 * parent._total_nthreads -= ws._nthreads * * if not parent._host_info[host]["addresses"]: # <<<<<<<<<<<<<< * del parent._host_info[host] * */ } /* "distributed/scheduler.py":4127 * del parent._host_info[host] * * self.rpc.remove(address) # <<<<<<<<<<<<<< * del self.stream_comms[address] * del parent._aliases[ws._name] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4127, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4127, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_cur_scope->__pyx_v_address) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_address); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4127, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4128 * * self.rpc.remove(address) * del self.stream_comms[address] # <<<<<<<<<<<<<< * del parent._aliases[ws._name] * parent._idle.pop(ws._address, None) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4128, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyObject_DelItem(__pyx_t_5, __pyx_cur_scope->__pyx_v_address) < 0)) __PYX_ERR(0, 4128, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4129 * self.rpc.remove(address) * del self.stream_comms[address] * del parent._aliases[ws._name] # <<<<<<<<<<<<<< * parent._idle.pop(ws._address, None) * parent._saturated.discard(ws) */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_aliases == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4129, __pyx_L8_error) } if (unlikely(PyDict_DelItem(__pyx_cur_scope->__pyx_v_parent->_aliases, __pyx_cur_scope->__pyx_v_ws->_name) < 0)) __PYX_ERR(0, 4129, __pyx_L8_error) /* "distributed/scheduler.py":4130 * del self.stream_comms[address] * del parent._aliases[ws._name] * parent._idle.pop(ws._address, None) # <<<<<<<<<<<<<< * parent._saturated.discard(ws) * del parent._workers[address] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_parent->_idle, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4130, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_ws->_address, Py_None}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4130, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_ws->_address, Py_None}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4130, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4130, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ws->_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ws->_address); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_cur_scope->__pyx_v_ws->_address); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, Py_None); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4130, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4131 * del parent._aliases[ws._name] * parent._idle.pop(ws._address, None) * parent._saturated.discard(ws) # <<<<<<<<<<<<<< * del parent._workers[address] * ws.status = Status.closed */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_saturated == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 4131, __pyx_L8_error) } __pyx_t_20 = __Pyx_PySet_Discard(__pyx_cur_scope->__pyx_v_parent->_saturated, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 4131, __pyx_L8_error) /* "distributed/scheduler.py":4132 * parent._idle.pop(ws._address, None) * parent._saturated.discard(ws) * del parent._workers[address] # <<<<<<<<<<<<<< * ws.status = Status.closed * parent._total_occupancy -= ws._occupancy */ if (unlikely(PyObject_DelItem(__pyx_cur_scope->__pyx_v_parent->_workers, __pyx_cur_scope->__pyx_v_address) < 0)) __PYX_ERR(0, 4132, __pyx_L8_error) /* "distributed/scheduler.py":4133 * parent._saturated.discard(ws) * del parent._workers[address] * ws.status = Status.closed # <<<<<<<<<<<<<< * parent._total_occupancy -= ws._occupancy * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4133, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_closed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4133, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_ws), __pyx_n_s_status, __pyx_t_2) < 0) __PYX_ERR(0, 4133, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4134 * del parent._workers[address] * ws.status = Status.closed * parent._total_occupancy -= ws._occupancy # <<<<<<<<<<<<<< * * recommendations: dict = {} */ __pyx_cur_scope->__pyx_v_parent->_total_occupancy = (__pyx_cur_scope->__pyx_v_parent->_total_occupancy - __pyx_cur_scope->__pyx_v_ws->_occupancy); /* "distributed/scheduler.py":4136 * parent._total_occupancy -= ws._occupancy * * recommendations: dict = {} # <<<<<<<<<<<<<< * * ts: TaskState */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4136, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_recommendations = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4139 * * ts: TaskState * for ts in list(ws._processing): # <<<<<<<<<<<<<< * k = ts._key * recommendations[k] = "released" */ __pyx_t_2 = PySequence_List(__pyx_cur_scope->__pyx_v_ws->_processing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4139, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_21); __Pyx_INCREF(__pyx_t_2); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 4139, __pyx_L8_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4139, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4139, __pyx_L8_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4140 * ts: TaskState * for ts in list(ws._processing): * k = ts._key # <<<<<<<<<<<<<< * recommendations[k] = "released" * if not safe: */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_ts->_key; __Pyx_INCREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4141 * for ts in list(ws._processing): * k = ts._key * recommendations[k] = "released" # <<<<<<<<<<<<<< * if not safe: * ts._suspicious += 1 */ if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_recommendations, __pyx_cur_scope->__pyx_v_k, __pyx_n_u_released) < 0)) __PYX_ERR(0, 4141, __pyx_L8_error) /* "distributed/scheduler.py":4142 * k = ts._key * recommendations[k] = "released" * if not safe: # <<<<<<<<<<<<<< * ts._suspicious += 1 * ts._prefix._suspicious += 1 */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_safe); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 4142, __pyx_L8_error) __pyx_t_9 = ((!__pyx_t_10) != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":4143 * recommendations[k] = "released" * if not safe: * ts._suspicious += 1 # <<<<<<<<<<<<<< * ts._prefix._suspicious += 1 * if ts._suspicious > self.allowed_failures: */ __pyx_cur_scope->__pyx_v_ts->_suspicious = (__pyx_cur_scope->__pyx_v_ts->_suspicious + 1); /* "distributed/scheduler.py":4144 * if not safe: * ts._suspicious += 1 * ts._prefix._suspicious += 1 # <<<<<<<<<<<<<< * if ts._suspicious > self.allowed_failures: * del recommendations[k] */ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts->_prefix)); __pyx_t_22 = __pyx_cur_scope->__pyx_v_ts->_prefix; __pyx_t_22->_suspicious = (__pyx_t_22->_suspicious + 1); __Pyx_DECREF(((PyObject *)__pyx_t_22)); __pyx_t_22 = 0; /* "distributed/scheduler.py":4145 * ts._suspicious += 1 * ts._prefix._suspicious += 1 * if ts._suspicious > self.allowed_failures: # <<<<<<<<<<<<<< * del recommendations[k] * e = pickle.dumps( */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_ts->_suspicious); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4145, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_allowed_failures); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4145, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_13, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4145, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4145, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { /* "distributed/scheduler.py":4146 * ts._prefix._suspicious += 1 * if ts._suspicious > self.allowed_failures: * del recommendations[k] # <<<<<<<<<<<<<< * e = pickle.dumps( * KilledWorker(task=k, last_worker=ws.clean()), protocol=4 */ if (unlikely(PyDict_DelItem(__pyx_cur_scope->__pyx_v_recommendations, __pyx_cur_scope->__pyx_v_k) < 0)) __PYX_ERR(0, 4146, __pyx_L8_error) /* "distributed/scheduler.py":4147 * if ts._suspicious > self.allowed_failures: * del recommendations[k] * e = pickle.dumps( # <<<<<<<<<<<<<< * KilledWorker(task=k, last_worker=ws.clean()), protocol=4 * ) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4147, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dumps); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4147, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4148 * del recommendations[k] * e = pickle.dumps( * KilledWorker(task=k, last_worker=ws.clean()), protocol=4 # <<<<<<<<<<<<<< * ) * r = self.transition(k, "erred", exception=e, cause=k) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KilledWorker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4148, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4148, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_task, __pyx_cur_scope->__pyx_v_k) < 0) __PYX_ERR(0, 4148, __pyx_L8_error) __pyx_t_3 = __pyx_f_11distributed_9scheduler_11WorkerState_clean(__pyx_cur_scope->__pyx_v_ws, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4148, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_last_worker, __pyx_t_3) < 0) __PYX_ERR(0, 4148, __pyx_L8_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4148, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4147 * if ts._suspicious > self.allowed_failures: * del recommendations[k] * e = pickle.dumps( # <<<<<<<<<<<<<< * KilledWorker(task=k, last_worker=ws.clean()), protocol=4 * ) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4147, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4148 * del recommendations[k] * e = pickle.dumps( * KilledWorker(task=k, last_worker=ws.clean()), protocol=4 # <<<<<<<<<<<<<< * ) * r = self.transition(k, "erred", exception=e, cause=k) */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4148, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_protocol, __pyx_int_4) < 0) __PYX_ERR(0, 4148, __pyx_L8_error) /* "distributed/scheduler.py":4147 * if ts._suspicious > self.allowed_failures: * del recommendations[k] * e = pickle.dumps( # <<<<<<<<<<<<<< * KilledWorker(task=k, last_worker=ws.clean()), protocol=4 * ) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4147, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4150 * KilledWorker(task=k, last_worker=ws.clean()), protocol=4 * ) * r = self.transition(k, "erred", exception=e, cause=k) # <<<<<<<<<<<<<< * recommendations.update(r) * logger.info( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_transition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_k); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_k); __Pyx_INCREF(__pyx_n_u_erred); __Pyx_GIVEREF(__pyx_n_u_erred); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_erred); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_exception, __pyx_cur_scope->__pyx_v_e) < 0) __PYX_ERR(0, 4150, __pyx_L8_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cause, __pyx_cur_scope->__pyx_v_k) < 0) __PYX_ERR(0, 4150, __pyx_L8_error) __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4151 * ) * r = self.transition(k, "erred", exception=e, cause=k) * recommendations.update(r) # <<<<<<<<<<<<<< * logger.info( * "Task %s marked as failed because %d workers died" */ __pyx_t_13 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_cur_scope->__pyx_v_recommendations, __pyx_cur_scope->__pyx_v_r); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4151, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4152 * r = self.transition(k, "erred", exception=e, cause=k) * recommendations.update(r) * logger.info( # <<<<<<<<<<<<<< * "Task %s marked as failed because %d workers died" * " while trying to run it", */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4152, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4152, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4156 * " while trying to run it", * ts._key, * self.allowed_failures, # <<<<<<<<<<<<<< * ) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_allowed_failures); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4156, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_kp_u_Task_s_marked_as_failed_because, __pyx_cur_scope->__pyx_v_ts->_key, __pyx_t_2}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4152, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_kp_u_Task_s_marked_as_failed_because, __pyx_cur_scope->__pyx_v_ts->_key, __pyx_t_2}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4152, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_11 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4152, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Task_s_marked_as_failed_because); __Pyx_GIVEREF(__pyx_kp_u_Task_s_marked_as_failed_because); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_kp_u_Task_s_marked_as_failed_because); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ts->_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ts->_key); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_cur_scope->__pyx_v_ts->_key); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_12, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4152, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4145 * ts._suspicious += 1 * ts._prefix._suspicious += 1 * if ts._suspicious > self.allowed_failures: # <<<<<<<<<<<<<< * del recommendations[k] * e = pickle.dumps( */ } /* "distributed/scheduler.py":4142 * k = ts._key * recommendations[k] = "released" * if not safe: # <<<<<<<<<<<<<< * ts._suspicious += 1 * ts._prefix._suspicious += 1 */ } /* "distributed/scheduler.py":4139 * * ts: TaskState * for ts in list(ws._processing): # <<<<<<<<<<<<<< * k = ts._key * recommendations[k] = "released" */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4159 * ) * * for ts in ws._has_what: # <<<<<<<<<<<<<< * ts._who_has.remove(ws) * if not ts._who_has: */ __pyx_t_21 = 0; __pyx_t_13 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_ws->_has_what, 1, (&__pyx_t_23), (&__pyx_t_12)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4159, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_13; __pyx_t_13 = 0; while (1) { __pyx_t_24 = __Pyx_set_iter_next(__pyx_t_5, __pyx_t_23, &__pyx_t_21, &__pyx_t_13, __pyx_t_12); if (unlikely(__pyx_t_24 == 0)) break; if (unlikely(__pyx_t_24 == -1)) __PYX_ERR(0, 4159, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4159, __pyx_L8_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4160 * * for ts in ws._has_what: * ts._who_has.remove(ws) # <<<<<<<<<<<<<< * if not ts._who_has: * if ts._run_spec: */ if (unlikely(__pyx_cur_scope->__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 4160, __pyx_L8_error) } __pyx_t_20 = __Pyx_PySet_Remove(__pyx_cur_scope->__pyx_v_ts->_who_has, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 4160, __pyx_L8_error) /* "distributed/scheduler.py":4161 * for ts in ws._has_what: * ts._who_has.remove(ws) * if not ts._who_has: # <<<<<<<<<<<<<< * if ts._run_spec: * recommendations[ts._key] = "released" */ __pyx_t_9 = (__pyx_cur_scope->__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_cur_scope->__pyx_v_ts->_who_has) != 0); __pyx_t_10 = ((!__pyx_t_9) != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":4162 * ts._who_has.remove(ws) * if not ts._who_has: * if ts._run_spec: # <<<<<<<<<<<<<< * recommendations[ts._key] = "released" * else: # pure data */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 4162, __pyx_L8_error) if (__pyx_t_10) { /* "distributed/scheduler.py":4163 * if not ts._who_has: * if ts._run_spec: * recommendations[ts._key] = "released" # <<<<<<<<<<<<<< * else: # pure data * recommendations[ts._key] = "forgotten" */ if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_recommendations, __pyx_cur_scope->__pyx_v_ts->_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 4163, __pyx_L8_error) /* "distributed/scheduler.py":4162 * ts._who_has.remove(ws) * if not ts._who_has: * if ts._run_spec: # <<<<<<<<<<<<<< * recommendations[ts._key] = "released" * else: # pure data */ goto __pyx_L39; } /* "distributed/scheduler.py":4165 * recommendations[ts._key] = "released" * else: # pure data * recommendations[ts._key] = "forgotten" # <<<<<<<<<<<<<< * ws._has_what.clear() * */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_recommendations, __pyx_cur_scope->__pyx_v_ts->_key, __pyx_n_u_forgotten) < 0)) __PYX_ERR(0, 4165, __pyx_L8_error) } __pyx_L39:; /* "distributed/scheduler.py":4161 * for ts in ws._has_what: * ts._who_has.remove(ws) * if not ts._who_has: # <<<<<<<<<<<<<< * if ts._run_spec: * recommendations[ts._key] = "released" */ } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4166 * else: # pure data * recommendations[ts._key] = "forgotten" * ws._has_what.clear() # <<<<<<<<<<<<<< * * self.transitions(recommendations) */ if (unlikely(__pyx_cur_scope->__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 4166, __pyx_L8_error) } __pyx_t_20 = PySet_Clear(__pyx_cur_scope->__pyx_v_ws->_has_what); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 4166, __pyx_L8_error) /* "distributed/scheduler.py":4168 * ws._has_what.clear() * * self.transitions(recommendations) # <<<<<<<<<<<<<< * * for plugin in self.plugins[:]: */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4168, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_3, __pyx_cur_scope->__pyx_v_recommendations) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_cur_scope->__pyx_v_recommendations); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4168, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4170 * self.transitions(recommendations) * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * result = plugin.remove_worker(scheduler=self, worker=address) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4170, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, NULL, NULL, &__pyx_slice__57, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4170, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) { __pyx_t_5 = __pyx_t_13; __Pyx_INCREF(__pyx_t_5); __pyx_t_23 = 0; __pyx_t_25 = NULL; } else { __pyx_t_23 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4170, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_25 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 4170, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; for (;;) { if (likely(!__pyx_t_25)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_23); __Pyx_INCREF(__pyx_t_13); __pyx_t_23++; if (unlikely(0 < 0)) __PYX_ERR(0, 4170, __pyx_L8_error) #else __pyx_t_13 = PySequence_ITEM(__pyx_t_5, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4170, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); #endif } else { if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_23); __Pyx_INCREF(__pyx_t_13); __pyx_t_23++; if (unlikely(0 < 0)) __PYX_ERR(0, 4170, __pyx_L8_error) #else __pyx_t_13 = PySequence_ITEM(__pyx_t_5, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4170, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); #endif } } else { __pyx_t_13 = __pyx_t_25(__pyx_t_5); if (unlikely(!__pyx_t_13)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4170, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_13); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_plugin); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_plugin, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4171 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * result = plugin.remove_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): */ { __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_17, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_16); /*try:*/ { /* "distributed/scheduler.py":4172 * for plugin in self.plugins[:]: * try: * result = plugin.remove_worker(scheduler=self, worker=address) # <<<<<<<<<<<<<< * if inspect.isawaitable(result): * await result */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_plugin, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4172, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4172, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scheduler, __pyx_cur_scope->__pyx_v_self) < 0) __PYX_ERR(0, 4172, __pyx_L42_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_worker, __pyx_cur_scope->__pyx_v_address) < 0) __PYX_ERR(0, 4172, __pyx_L42_error) __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4172, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_result); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_result, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4173 * try: * result = plugin.remove_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): # <<<<<<<<<<<<<< * await result * except Exception as e: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_inspect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4173, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isawaitable); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4173, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_3, __pyx_cur_scope->__pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_cur_scope->__pyx_v_result); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4173, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 4173, __pyx_L42_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10) { /* "distributed/scheduler.py":4174 * result = plugin.remove_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): * await result # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_result); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_14); __pyx_cur_scope->__pyx_t_5 = __pyx_t_14; __Pyx_XGIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_t_6 = __pyx_t_16; __Pyx_XGIVEREF(__pyx_t_17); __pyx_cur_scope->__pyx_t_7 = __pyx_t_17; __pyx_cur_scope->__pyx_t_8 = __pyx_t_23; __pyx_cur_scope->__pyx_t_9 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L51_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_14 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_14); __pyx_t_16 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_16); __pyx_t_17 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_17); __pyx_t_23 = __pyx_cur_scope->__pyx_t_8; __pyx_t_25 = __pyx_cur_scope->__pyx_t_9; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4174, __pyx_L42_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4174, __pyx_L42_error) } } /* "distributed/scheduler.py":4173 * try: * result = plugin.remove_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): # <<<<<<<<<<<<<< * await result * except Exception as e: */ } /* "distributed/scheduler.py":4171 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * result = plugin.remove_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): */ } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L49_try_end; __pyx_L42_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(((PyObject *)__pyx_t_22)); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4175 * if inspect.isawaitable(result): * await result * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_12) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_13, &__pyx_t_3) < 0) __PYX_ERR(0, 4175, __pyx_L44_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_13); __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); /*try:*/ { /* "distributed/scheduler.py":4176 * await result * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * * if not parent._workers_dv: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4176, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_exception); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4176, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_26))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_26); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_26); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_26, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_26, __pyx_t_1, __pyx_cur_scope->__pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_26, __pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4176, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "distributed/scheduler.py":4175 * if inspect.isawaitable(result): * await result * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; goto __pyx_L58; } __pyx_L57_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_18 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(((PyObject *)__pyx_t_22)); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_18, &__pyx_t_28) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_18, &__pyx_t_28); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_29); __Pyx_XGOTREF(__pyx_t_30); __Pyx_XGOTREF(__pyx_t_31); __pyx_t_12 = __pyx_lineno; __pyx_t_24 = __pyx_clineno; __pyx_t_27 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_29); __Pyx_XGIVEREF(__pyx_t_30); __Pyx_XGIVEREF(__pyx_t_31); __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_30, __pyx_t_31); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_18, __pyx_t_28); __pyx_t_15 = 0; __pyx_t_18 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_24; __pyx_filename = __pyx_t_27; goto __pyx_L44_except_error; } __pyx_L58:; } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L43_exception_handled; } goto __pyx_L44_except_error; __pyx_L44_except_error:; /* "distributed/scheduler.py":4171 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * result = plugin.remove_worker(scheduler=self, worker=address) * if inspect.isawaitable(result): */ __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_17, __pyx_t_16); goto __pyx_L8_error; __pyx_L43_exception_handled:; __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_17, __pyx_t_16); __pyx_L49_try_end:; } /* "distributed/scheduler.py":4170 * self.transitions(recommendations) * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * result = plugin.remove_worker(scheduler=self, worker=address) */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4178 * logger.exception(e) * * if not parent._workers_dv: # <<<<<<<<<<<<<< * logger.info("Lost all workers") * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_parent->_workers_dv); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 4178, __pyx_L8_error) __pyx_t_9 = ((!__pyx_t_10) != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":4179 * * if not parent._workers_dv: * logger.info("Lost all workers") # <<<<<<<<<<<<<< * * for w in parent._workers_dv: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4179, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4179, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_3, __pyx_kp_u_Lost_all_workers) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_u_Lost_all_workers); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4179, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4178 * logger.exception(e) * * if not parent._workers_dv: # <<<<<<<<<<<<<< * logger.info("Lost all workers") * */ } /* "distributed/scheduler.py":4181 * logger.info("Lost all workers") * * for w in parent._workers_dv: # <<<<<<<<<<<<<< * self.bandwidth_workers.pop((address, w), None) * self.bandwidth_workers.pop((w, address), None) */ __pyx_t_23 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4181, __pyx_L8_error) } __pyx_t_13 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, ((PyObject *)NULL), (&__pyx_t_21), (&__pyx_t_24)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4181, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_13; __pyx_t_13 = 0; while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_21, &__pyx_t_23, &__pyx_t_13, NULL, NULL, __pyx_t_24); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 4181, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_w, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4182 * * for w in parent._workers_dv: * self.bandwidth_workers.pop((address, w), None) # <<<<<<<<<<<<<< * self.bandwidth_workers.pop((w, address), None) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_bandwidth_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4182, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4182, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4182, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_address); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_w); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_w); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_w); __pyx_t_2 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, Py_None}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4182, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, Py_None}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4182, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_26 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4182, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_26); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_26, 0+__pyx_t_12, __pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_26, 1+__pyx_t_12, Py_None); __pyx_t_3 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_26, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4182, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4183 * for w in parent._workers_dv: * self.bandwidth_workers.pop((address, w), None) * self.bandwidth_workers.pop((w, address), None) # <<<<<<<<<<<<<< * * def remove_worker_from_events(): */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_bandwidth_workers); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4183, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_pop); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4183, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4183, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_w); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_w); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_w); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_address); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_cur_scope->__pyx_v_address); __pyx_t_3 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_26))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_26); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_26); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_26, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_26)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_11, Py_None}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_26, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4183, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_26)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_11, Py_None}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_26, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4183, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4183, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_12, __pyx_t_11); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_12, Py_None); __pyx_t_11 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_2, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4183, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4185 * self.bandwidth_workers.pop((w, address), None) * * def remove_worker_from_events(): # <<<<<<<<<<<<<< * # If the worker isn't registered anymore after the delay, remove from events * if address not in parent._workers_dv and address in self.events: */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_13remove_worker_1remove_worker_from_events, 0, __pyx_n_s_Scheduler_remove_worker_locals_r, ((PyObject*)__pyx_cur_scope), __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4185, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_remove_worker_from_events = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":4190 * del self.events[address] * * cleanup_delay = parse_timedelta( # <<<<<<<<<<<<<< * dask.config.get("distributed.scheduler.events-cleanup-delay") * ) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4190, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); /* "distributed/scheduler.py":4191 * * cleanup_delay = parse_timedelta( * dask.config.get("distributed.scheduler.events-cleanup-delay") # <<<<<<<<<<<<<< * ) * self.loop.call_later(cleanup_delay, remove_worker_from_events) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4191, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4191, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4191, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_26 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_11, __pyx_kp_u_distributed_scheduler_events_cle) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_events_cle); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4191, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_2, __pyx_t_26) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_26); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4190, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_cleanup_delay = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":4193 * dask.config.get("distributed.scheduler.events-cleanup-delay") * ) * self.loop.call_later(cleanup_delay, remove_worker_from_events) # <<<<<<<<<<<<<< * logger.debug("Removed worker %s", ws) * */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4193, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_call_later); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4193, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; __pyx_t_24 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_26))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_26); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_26); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_26, function); __pyx_t_24 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_26)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_cur_scope->__pyx_v_cleanup_delay, __pyx_cur_scope->__pyx_v_remove_worker_from_events}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_26, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4193, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_26)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_cur_scope->__pyx_v_cleanup_delay, __pyx_cur_scope->__pyx_v_remove_worker_from_events}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_26, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4193, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4193, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cleanup_delay); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cleanup_delay); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_24, __pyx_cur_scope->__pyx_v_cleanup_delay); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_remove_worker_from_events); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_remove_worker_from_events); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_24, __pyx_cur_scope->__pyx_v_remove_worker_from_events); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4193, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4194 * ) * self.loop.call_later(cleanup_delay, remove_worker_from_events) * logger.debug("Removed worker %s", ws) # <<<<<<<<<<<<<< * * return "OK" */ __Pyx_GetModuleGlobalName(__pyx_t_26, __pyx_n_s_logger); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4194, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_26); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_26, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4194, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_t_26 = NULL; __pyx_t_24 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_26)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_26); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_24 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_26, __pyx_kp_u_Removed_worker_s, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4194, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_26, __pyx_kp_u_Removed_worker_s, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4194, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_24); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4194, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_26) { __Pyx_GIVEREF(__pyx_t_26); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_26); __pyx_t_26 = NULL; } __Pyx_INCREF(__pyx_kp_u_Removed_worker_s); __Pyx_GIVEREF(__pyx_kp_u_Removed_worker_s); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_24, __pyx_kp_u_Removed_worker_s); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_24, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4194, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4092 * """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * if self.status == Status.closed: * return */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(((PyObject *)__pyx_t_22)); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_13) < 0) __PYX_ERR(0, 4092, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_13); __pyx_t_26 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_13); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4092, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_26); __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_26, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4092, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_16); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (__pyx_t_9 < 0) __PYX_ERR(0, 4092, __pyx_L10_except_error) __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_2, __pyx_t_13); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_13 = 0; __PYX_ERR(0, 4092, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L12_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L5_return; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L7; } __pyx_L5_return: { __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_14 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_14); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_14); __pyx_t_31 = __pyx_r; __pyx_r = 0; if (__pyx_t_4) { __pyx_t_30 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 4092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_30); __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; } __pyx_r = __pyx_t_31; __pyx_t_31 = 0; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_14); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_14 = 0; goto __pyx_L0; } __pyx_L7:; } goto __pyx_L69; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L69:; } /* "distributed/scheduler.py":4196 * logger.debug("Removed worker %s", ws) * * return "OK" # <<<<<<<<<<<<<< * * def stimulus_cancel(self, comm, keys=None, client=None, force=False): */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_n_u_OK); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4083 * return tuple(seen) * * async def remove_worker(self, comm=None, address=None, safe=False, close=True): # <<<<<<<<<<<<<< * """ * Remove worker from cluster */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(((PyObject *)__pyx_t_22)); __Pyx_XDECREF(__pyx_t_26); __Pyx_AddTraceback("remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4198 * return "OK" * * def stimulus_cancel(self, comm, keys=None, client=None, force=False): # <<<<<<<<<<<<<< * """ Stop execution on a list of keys """ * logger.info("Client %s requests to cancel %d keys", client, len(keys)) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_40stimulus_cancel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_39stimulus_cancel[] = " Stop execution on a list of keys "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_40stimulus_cancel = {"stimulus_cancel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_40stimulus_cancel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_39stimulus_cancel}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_40stimulus_cancel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_client = 0; PyObject *__pyx_v_force = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stimulus_cancel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_client,&__pyx_n_s_force,0}; PyObject* values[5] = {0,0,0,0,0}; values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_False)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("stimulus_cancel", 0, 2, 5, 1); __PYX_ERR(0, 4198, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_force); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stimulus_cancel") < 0)) __PYX_ERR(0, 4198, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_client = values[3]; __pyx_v_force = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stimulus_cancel", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4198, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_39stimulus_cancel(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_client, __pyx_v_force); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_39stimulus_cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_client, PyObject *__pyx_v_force) { PyObject *__pyx_v_key = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stimulus_cancel", 0); /* "distributed/scheduler.py":4200 * def stimulus_cancel(self, comm, keys=None, client=None, force=False): * """ Stop execution on a list of keys """ * logger.info("Client %s requests to cancel %d keys", client, len(keys)) # <<<<<<<<<<<<<< * if client: * self.log_event( */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4200, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_kp_u_Client_s_requests_to_cancel_d_ke, __pyx_v_client, __pyx_t_2}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_kp_u_Client_s_requests_to_cancel_d_ke, __pyx_v_client, __pyx_t_2}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_kp_u_Client_s_requests_to_cancel_d_ke); __Pyx_GIVEREF(__pyx_kp_u_Client_s_requests_to_cancel_d_ke); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_Client_s_requests_to_cancel_d_ke); __Pyx_INCREF(__pyx_v_client); __Pyx_GIVEREF(__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_client); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4201 * """ Stop execution on a list of keys """ * logger.info("Client %s requests to cancel %d keys", client, len(keys)) * if client: # <<<<<<<<<<<<<< * self.log_event( * client, {"action": "cancel", "count": len(keys), "force": force} */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_client); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4201, __pyx_L1_error) if (__pyx_t_8) { /* "distributed/scheduler.py":4202 * logger.info("Client %s requests to cancel %d keys", client, len(keys)) * if client: * self.log_event( # <<<<<<<<<<<<<< * client, {"action": "cancel", "count": len(keys), "force": force} * ) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":4203 * if client: * self.log_event( * client, {"action": "cancel", "count": len(keys), "force": force} # <<<<<<<<<<<<<< * ) * for key in keys: */ __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_action, __pyx_n_u_cancel) < 0) __PYX_ERR(0, 4203, __pyx_L1_error) __pyx_t_4 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4203, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_count, __pyx_t_2) < 0) __PYX_ERR(0, 4203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_force, __pyx_v_force) < 0) __PYX_ERR(0, 4203, __pyx_L1_error) __pyx_t_2 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_client, __pyx_t_7}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_client, __pyx_t_7}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_client); __Pyx_GIVEREF(__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_client); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4201 * """ Stop execution on a list of keys """ * logger.info("Client %s requests to cancel %d keys", client, len(keys)) * if client: # <<<<<<<<<<<<<< * self.log_event( * client, {"action": "cancel", "count": len(keys), "force": force} */ } /* "distributed/scheduler.py":4205 * client, {"action": "cancel", "count": len(keys), "force": force} * ) * for key in keys: # <<<<<<<<<<<<<< * self.cancel_key(key, client, force=force) * */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_1 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_9 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4205, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 4205, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 4205, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4205, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4206 * ) * for key in keys: * self.cancel_key(key, client, force=force) # <<<<<<<<<<<<<< * * def cancel_key(self, key, client, retries=5, force=False): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cancel_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_client); __Pyx_GIVEREF(__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_client); __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_force, __pyx_v_force) < 0) __PYX_ERR(0, 4206, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4205 * client, {"action": "cancel", "count": len(keys), "force": force} * ) * for key in keys: # <<<<<<<<<<<<<< * self.cancel_key(key, client, force=force) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4198 * return "OK" * * def stimulus_cancel(self, comm, keys=None, client=None, force=False): # <<<<<<<<<<<<<< * """ Stop execution on a list of keys """ * logger.info("Client %s requests to cancel %d keys", client, len(keys)) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.Scheduler.stimulus_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4208 * self.cancel_key(key, client, force=force) * * def cancel_key(self, key, client, retries=5, force=False): # <<<<<<<<<<<<<< * """ Cancel a particular key and all dependents """ * # TODO: this should be converted to use the transition mechanism */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_42cancel_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_41cancel_key[] = " Cancel a particular key and all dependents "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_42cancel_key = {"cancel_key", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_42cancel_key, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_41cancel_key}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_42cancel_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_client = 0; PyObject *__pyx_v_retries = 0; PyObject *__pyx_v_force = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cancel_key (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_client,&__pyx_n_s_retries,&__pyx_n_s_force,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)((PyObject *)__pyx_int_5)); values[4] = ((PyObject *)((PyObject *)Py_False)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("cancel_key", 0, 3, 5, 1); __PYX_ERR(0, 4208, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("cancel_key", 0, 3, 5, 2); __PYX_ERR(0, 4208, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_retries); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_force); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cancel_key") < 0)) __PYX_ERR(0, 4208, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_client = values[2]; __pyx_v_retries = values[3]; __pyx_v_force = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("cancel_key", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4208, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.cancel_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_41cancel_key(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_client, __pyx_v_retries, __pyx_v_force); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4221 * if retries: * self.loop.call_later( * 0.2, lambda: self.cancel_key(key, client, retries - 1) # <<<<<<<<<<<<<< * ) * return */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_10cancel_key_lambda9(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_10cancel_key_lambda9 = {"lambda9", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_10cancel_key_lambda9, METH_NOARGS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_10cancel_key_lambda9(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda9(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda9(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda9", 0); __pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4221, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_cancel_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 4221, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_v_client)) { __Pyx_RaiseClosureNameError("client"); __PYX_ERR(0, 4221, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_v_retries)) { __Pyx_RaiseClosureNameError("retries"); __PYX_ERR(0, 4221, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_retries, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_client, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4221, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_client, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4221, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_cur_scope->__pyx_v_key); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.cancel_key.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4208 * self.cancel_key(key, client, force=force) * * def cancel_key(self, key, client, retries=5, force=False): # <<<<<<<<<<<<<< * """ Cancel a particular key and all dependents """ * # TODO: this should be converted to use the transition mechanism */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_41cancel_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_client, PyObject *__pyx_v_retries, PyObject *__pyx_v_force) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_v_clients = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; Py_ssize_t __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("cancel_key", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_18_cancel_key(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_18_cancel_key, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4208, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_key = __pyx_v_key; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); __pyx_cur_scope->__pyx_v_client = __pyx_v_client; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); __pyx_cur_scope->__pyx_v_retries = __pyx_v_retries; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_retries); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_retries); /* "distributed/scheduler.py":4211 * """ Cancel a particular key and all dependents """ * # TODO: this should be converted to use the transition mechanism * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks.get(key) * dts: TaskState */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4212 * # TODO: this should be converted to use the transition mechanism * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * dts: TaskState * try: */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4212, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_cur_scope->__pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4212, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4214 * ts: TaskState = parent._tasks.get(key) * dts: TaskState * try: # <<<<<<<<<<<<<< * cs: ClientState = parent._clients[client] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":4215 * dts: TaskState * try: * cs: ClientState = parent._clients[client] # <<<<<<<<<<<<<< * except KeyError: * return */ if (unlikely(__pyx_v_parent->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4215, __pyx_L3_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_clients, __pyx_cur_scope->__pyx_v_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4215, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4215, __pyx_L3_error) __pyx_v_cs = ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4214 * ts: TaskState = parent._tasks.get(key) * dts: TaskState * try: # <<<<<<<<<<<<<< * cs: ClientState = parent._clients[client] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4216 * try: * cs: ClientState = parent._clients[client] * except KeyError: # <<<<<<<<<<<<<< * return * if ts is None or not ts._who_wants: # no key yet, lets try again in a moment */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.cancel_key", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 4216, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); /* "distributed/scheduler.py":4217 * cs: ClientState = parent._clients[client] * except KeyError: * return # <<<<<<<<<<<<<< * if ts is None or not ts._who_wants: # no key yet, lets try again in a moment * if retries: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":4214 * ts: TaskState = parent._tasks.get(key) * dts: TaskState * try: # <<<<<<<<<<<<<< * cs: ClientState = parent._clients[client] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "distributed/scheduler.py":4218 * except KeyError: * return * if ts is None or not ts._who_wants: # no key yet, lets try again in a moment # <<<<<<<<<<<<<< * if retries: * self.loop.call_later( */ __pyx_t_9 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_10 = (__pyx_t_9 != 0); if (!__pyx_t_10) { } else { __pyx_t_8 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_10 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); __pyx_t_9 = ((!__pyx_t_10) != 0); __pyx_t_8 = __pyx_t_9; __pyx_L12_bool_binop_done:; if (__pyx_t_8) { /* "distributed/scheduler.py":4219 * return * if ts is None or not ts._who_wants: # no key yet, lets try again in a moment * if retries: # <<<<<<<<<<<<<< * self.loop.call_later( * 0.2, lambda: self.cancel_key(key, client, retries - 1) */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_retries); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4219, __pyx_L1_error) if (__pyx_t_8) { /* "distributed/scheduler.py":4220 * if ts is None or not ts._who_wants: # no key yet, lets try again in a moment * if retries: * self.loop.call_later( # <<<<<<<<<<<<<< * 0.2, lambda: self.cancel_key(key, client, retries - 1) * ) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_call_later); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4221 * if retries: * self.loop.call_later( * 0.2, lambda: self.cancel_key(key, client, retries - 1) # <<<<<<<<<<<<<< * ) * return */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_10cancel_key_lambda9, 0, __pyx_n_s_Scheduler_cancel_key_locals_lamb, ((PyObject*)__pyx_cur_scope), __pyx_n_s_distributed_scheduler, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_float_0_2, __pyx_t_6}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_float_0_2, __pyx_t_6}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_float_0_2); __Pyx_GIVEREF(__pyx_float_0_2); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_float_0_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4219 * return * if ts is None or not ts._who_wants: # no key yet, lets try again in a moment * if retries: # <<<<<<<<<<<<<< * self.loop.call_later( * 0.2, lambda: self.cancel_key(key, client, retries - 1) */ } /* "distributed/scheduler.py":4223 * 0.2, lambda: self.cancel_key(key, client, retries - 1) * ) * return # <<<<<<<<<<<<<< * if force or ts._who_wants == {cs}: # no one else wants this key * for dts in list(ts._dependents): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":4218 * except KeyError: * return * if ts is None or not ts._who_wants: # no key yet, lets try again in a moment # <<<<<<<<<<<<<< * if retries: * self.loop.call_later( */ } /* "distributed/scheduler.py":4224 * ) * return * if force or ts._who_wants == {cs}: # no one else wants this key # <<<<<<<<<<<<<< * for dts in list(ts._dependents): * self.cancel_key(dts._key, client, force=force) */ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4224, __pyx_L1_error) if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L16_bool_binop_done; } __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PySet_Add(__pyx_t_7, ((PyObject *)__pyx_v_cs)) < 0) __PYX_ERR(0, 4224, __pyx_L1_error) __pyx_t_1 = PyObject_RichCompare(__pyx_v_ts->_who_wants, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __pyx_t_9; __pyx_L16_bool_binop_done:; if (__pyx_t_8) { /* "distributed/scheduler.py":4225 * return * if force or ts._who_wants == {cs}: # no one else wants this key * for dts in list(ts._dependents): # <<<<<<<<<<<<<< * self.cancel_key(dts._key, client, force=force) * logger.info("Scheduler cancels key %s. Force=%s", key, force) */ __pyx_t_1 = PySequence_List(__pyx_v_ts->_dependents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 4225, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4225, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":4226 * if force or ts._who_wants == {cs}: # no one else wants this key * for dts in list(ts._dependents): * self.cancel_key(dts._key, client, force=force) # <<<<<<<<<<<<<< * logger.info("Scheduler cancels key %s. Force=%s", key, force) * self.report({"op": "cancelled-key", "key": key}) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_cancel_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_dts->_key); __Pyx_GIVEREF(__pyx_v_dts->_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_dts->_key); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_cur_scope->__pyx_v_client); __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_force, __pyx_v_force) < 0) __PYX_ERR(0, 4226, __pyx_L1_error) __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4225 * return * if force or ts._who_wants == {cs}: # no one else wants this key * for dts in list(ts._dependents): # <<<<<<<<<<<<<< * self.cancel_key(dts._key, client, force=force) * logger.info("Scheduler cancels key %s. Force=%s", key, force) */ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4224 * ) * return * if force or ts._who_wants == {cs}: # no one else wants this key # <<<<<<<<<<<<<< * for dts in list(ts._dependents): * self.cancel_key(dts._key, client, force=force) */ } /* "distributed/scheduler.py":4227 * for dts in list(ts._dependents): * self.cancel_key(dts._key, client, force=force) * logger.info("Scheduler cancels key %s. Force=%s", key, force) # <<<<<<<<<<<<<< * self.report({"op": "cancelled-key", "key": key}) * clients = list(ts._who_wants) if force else [cs] */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_info); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_kp_u_Scheduler_cancels_key_s_Force_s, __pyx_cur_scope->__pyx_v_key, __pyx_v_force}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4227, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_kp_u_Scheduler_cancels_key_s_Force_s, __pyx_cur_scope->__pyx_v_key, __pyx_v_force}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4227, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); } else #endif { __pyx_t_12 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_kp_u_Scheduler_cancels_key_s_Force_s); __Pyx_GIVEREF(__pyx_kp_u_Scheduler_cancels_key_s_Force_s); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_kp_u_Scheduler_cancels_key_s_Force_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_key); __Pyx_INCREF(__pyx_v_force); __Pyx_GIVEREF(__pyx_v_force); PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_5, __pyx_v_force); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4228 * self.cancel_key(dts._key, client, force=force) * logger.info("Scheduler cancels key %s. Force=%s", key, force) * self.report({"op": "cancelled-key", "key": key}) # <<<<<<<<<<<<<< * clients = list(ts._who_wants) if force else [cs] * for cs in clients: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_report); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_op, __pyx_kp_u_cancelled_key) < 0) __PYX_ERR(0, 4228, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_key, __pyx_cur_scope->__pyx_v_key) < 0) __PYX_ERR(0, 4228, __pyx_L1_error) __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_7 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4229 * logger.info("Scheduler cancels key %s. Force=%s", key, force) * self.report({"op": "cancelled-key", "key": key}) * clients = list(ts._who_wants) if force else [cs] # <<<<<<<<<<<<<< * for cs in clients: * self.client_releases_keys(keys=[key], client=cs._client_key) */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4229, __pyx_L1_error) if (__pyx_t_8) { __pyx_t_6 = PySequence_List(__pyx_v_ts->_who_wants); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; } else { __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_cs)); __Pyx_GIVEREF(((PyObject *)__pyx_v_cs)); PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_cs)); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; } __pyx_v_clients = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4230 * self.report({"op": "cancelled-key", "key": key}) * clients = list(ts._who_wants) if force else [cs] * for cs in clients: # <<<<<<<<<<<<<< * self.client_releases_keys(keys=[key], client=cs._client_key) * */ if (unlikely(__pyx_v_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4230, __pyx_L1_error) } __pyx_t_7 = __pyx_v_clients; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 4230, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4230, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":4231 * clients = list(ts._who_wants) if force else [cs] * for cs in clients: * self.client_releases_keys(keys=[key], client=cs._client_key) # <<<<<<<<<<<<<< * * def client_desires_keys(self, keys=None, client=None): */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_releases_keys_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); PyList_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_key); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_keys, __pyx_t_11) < 0) __PYX_ERR(0, 4231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_client, __pyx_v_cs->_client_key) < 0) __PYX_ERR(0, 4231, __pyx_L1_error) __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4230 * self.report({"op": "cancelled-key", "key": key}) * clients = list(ts._who_wants) if force else [cs] * for cs in clients: # <<<<<<<<<<<<<< * self.client_releases_keys(keys=[key], client=cs._client_key) * */ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4208 * self.cancel_key(key, client, force=force) * * def cancel_key(self, key, client, retries=5, force=False): # <<<<<<<<<<<<<< * """ Cancel a particular key and all dependents """ * # TODO: this should be converted to use the transition mechanism */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("distributed.scheduler.Scheduler.cancel_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF(__pyx_v_clients); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4233 * self.client_releases_keys(keys=[key], client=cs._client_key) * * def client_desires_keys(self, keys=None, client=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients.get(client) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_44client_desires_keys(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_44client_desires_keys = {"client_desires_keys", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_44client_desires_keys, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_44client_desires_keys(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_client = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("client_desires_keys (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_keys,&__pyx_n_s_client,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "client_desires_keys") < 0)) __PYX_ERR(0, 4233, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_keys = values[1]; __pyx_v_client = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("client_desires_keys", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4233, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_desires_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_43client_desires_keys(__pyx_self, __pyx_v_self, __pyx_v_keys, __pyx_v_client); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_43client_desires_keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_client) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_k = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("client_desires_keys", 0); /* "distributed/scheduler.py":4234 * * def client_desires_keys(self, keys=None, client=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * cs: ClientState = parent._clients.get(client) * if cs is None: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4235 * def client_desires_keys(self, keys=None, client=None): * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients.get(client) # <<<<<<<<<<<<<< * if cs is None: * # For publish, queues etc. */ if (unlikely(__pyx_v_parent->_clients == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4235, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_clients, __pyx_v_client, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4235, __pyx_L1_error) __pyx_v_cs = ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4236 * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients.get(client) * if cs is None: # <<<<<<<<<<<<<< * # For publish, queues etc. * parent._clients[client] = cs = ClientState(client) */ __pyx_t_2 = (((PyObject *)__pyx_v_cs) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4238 * if cs is None: * # For publish, queues etc. * parent._clients[client] = cs = ClientState(client) # <<<<<<<<<<<<<< * ts: TaskState * for k in keys: */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11distributed_9scheduler_ClientState), __pyx_v_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_parent->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4238, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_parent->_clients, __pyx_v_client, __pyx_t_1) < 0)) __PYX_ERR(0, 4238, __pyx_L1_error) __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_1)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4236 * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients.get(client) * if cs is None: # <<<<<<<<<<<<<< * # For publish, queues etc. * parent._clients[client] = cs = ClientState(client) */ } /* "distributed/scheduler.py":4240 * parent._clients[client] = cs = ClientState(client) * ts: TaskState * for k in keys: # <<<<<<<<<<<<<< * ts = parent._tasks.get(k) * if ts is None: */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_1 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4240, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 4240, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 4240, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4240, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4241 * ts: TaskState * for k in keys: * ts = parent._tasks.get(k) # <<<<<<<<<<<<<< * if ts is None: * # For publish, queues etc. */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4241, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_k, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4241, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":4242 * for k in keys: * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * # For publish, queues etc. * ts = self.new_task(k, None, "released") */ __pyx_t_3 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4244 * if ts is None: * # For publish, queues etc. * ts = self.new_task(k, None, "released") # <<<<<<<<<<<<<< * ts._who_wants.add(cs) * cs._wants_what.add(ts) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_new_task); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_k, Py_None, __pyx_n_u_released}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4244, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_k, Py_None, __pyx_n_u_released}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4244, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_k); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, Py_None); __Pyx_INCREF(__pyx_n_u_released); __Pyx_GIVEREF(__pyx_n_u_released); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_n_u_released); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4244, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":4242 * for k in keys: * ts = parent._tasks.get(k) * if ts is None: # <<<<<<<<<<<<<< * # For publish, queues etc. * ts = self.new_task(k, None, "released") */ } /* "distributed/scheduler.py":4245 * # For publish, queues etc. * ts = self.new_task(k, None, "released") * ts._who_wants.add(cs) # <<<<<<<<<<<<<< * cs._wants_what.add(ts) * */ if (unlikely(__pyx_v_ts->_who_wants == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 4245, __pyx_L1_error) } __pyx_t_11 = PySet_Add(__pyx_v_ts->_who_wants, ((PyObject *)__pyx_v_cs)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 4245, __pyx_L1_error) /* "distributed/scheduler.py":4246 * ts = self.new_task(k, None, "released") * ts._who_wants.add(cs) * cs._wants_what.add(ts) # <<<<<<<<<<<<<< * * if ts._state in ("memory", "erred"): */ if (unlikely(__pyx_v_cs->_wants_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 4246, __pyx_L1_error) } __pyx_t_11 = PySet_Add(__pyx_v_cs->_wants_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 4246, __pyx_L1_error) /* "distributed/scheduler.py":4248 * cs._wants_what.add(ts) * * if ts._state in ("memory", "erred"): # <<<<<<<<<<<<<< * self.report_on_key(ts=ts, client=client) * */ __Pyx_INCREF(__pyx_v_ts->_state); __pyx_t_12 = __pyx_v_ts->_state; __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4248, __pyx_L1_error) __pyx_t_13 = (__pyx_t_3 != 0); if (!__pyx_t_13) { } else { __pyx_t_2 = __pyx_t_13; goto __pyx_L8_bool_binop_done; } __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_erred, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 4248, __pyx_L1_error) __pyx_t_3 = (__pyx_t_13 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4249 * * if ts._state in ("memory", "erred"): * self.report_on_key(ts=ts, client=client) # <<<<<<<<<<<<<< * * def client_releases_keys(self, keys=None, client=None): */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_report_on_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ts, ((PyObject *)__pyx_v_ts)) < 0) __PYX_ERR(0, 4249, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 4249, __pyx_L1_error) __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "distributed/scheduler.py":4248 * cs._wants_what.add(ts) * * if ts._state in ("memory", "erred"): # <<<<<<<<<<<<<< * self.report_on_key(ts=ts, client=client) * */ } /* "distributed/scheduler.py":4240 * parent._clients[client] = cs = ClientState(client) * ts: TaskState * for k in keys: # <<<<<<<<<<<<<< * ts = parent._tasks.get(k) * if ts is None: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4233 * self.client_releases_keys(keys=[key], client=cs._client_key) * * def client_desires_keys(self, keys=None, client=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients.get(client) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_desires_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_k); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4251 * self.report_on_key(ts=ts, client=client) * * def client_releases_keys(self, keys=None, client=None): # <<<<<<<<<<<<<< * """ Remove keys from client desired list """ * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_46client_releases_keys(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_45client_releases_keys[] = " Remove keys from client desired list "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_46client_releases_keys = {"client_releases_keys", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_46client_releases_keys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_45client_releases_keys}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_46client_releases_keys(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_client = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("client_releases_keys (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_keys,&__pyx_n_s_client,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "client_releases_keys") < 0)) __PYX_ERR(0, 4251, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_keys = values[1]; __pyx_v_client = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("client_releases_keys", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4251, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_releases_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_45client_releases_keys(__pyx_self, __pyx_v_self, __pyx_v_keys, __pyx_v_client); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_45client_releases_keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_client) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("client_releases_keys", 0); __Pyx_INCREF(__pyx_v_keys); /* "distributed/scheduler.py":4254 * """ Remove keys from client desired list """ * * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if not isinstance(keys, list): * keys = list(keys) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4255 * * parent: SchedulerState = cast(SchedulerState, self) * if not isinstance(keys, list): # <<<<<<<<<<<<<< * keys = list(keys) * cs: ClientState = parent._clients[client] */ __pyx_t_2 = PyList_Check(__pyx_v_keys); __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4256 * parent: SchedulerState = cast(SchedulerState, self) * if not isinstance(keys, list): * keys = list(keys) # <<<<<<<<<<<<<< * cs: ClientState = parent._clients[client] * recommendations: dict = {} */ __pyx_t_1 = PySequence_List(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4255 * * parent: SchedulerState = cast(SchedulerState, self) * if not isinstance(keys, list): # <<<<<<<<<<<<<< * keys = list(keys) * cs: ClientState = parent._clients[client] */ } /* "distributed/scheduler.py":4257 * if not isinstance(keys, list): * keys = list(keys) * cs: ClientState = parent._clients[client] # <<<<<<<<<<<<<< * recommendations: dict = {} * */ if (unlikely(__pyx_v_parent->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4257, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_clients, __pyx_v_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4257, __pyx_L1_error) __pyx_v_cs = ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4258 * keys = list(keys) * cs: ClientState = parent._clients[client] * recommendations: dict = {} # <<<<<<<<<<<<<< * * _client_releases_keys(parent, keys=keys, cs=cs, recommendations=recommendations) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_recommendations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4260 * recommendations: dict = {} * * _client_releases_keys(parent, keys=keys, cs=cs, recommendations=recommendations) # <<<<<<<<<<<<<< * self.transitions(recommendations) * */ if (!(likely(PyList_CheckExact(__pyx_v_keys))||((__pyx_v_keys) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_keys)->tp_name), 0))) __PYX_ERR(0, 4260, __pyx_L1_error) __pyx_t_1 = __pyx_f_11distributed_9scheduler__client_releases_keys(__pyx_v_parent, ((PyObject*)__pyx_v_keys), __pyx_v_cs, __pyx_v_recommendations); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4261 * * _client_releases_keys(parent, keys=keys, cs=cs, recommendations=recommendations) * self.transitions(recommendations) # <<<<<<<<<<<<<< * * def client_heartbeat(self, client=None): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_recommendations) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_recommendations); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4251 * self.report_on_key(ts=ts, client=client) * * def client_releases_keys(self, keys=None, client=None): # <<<<<<<<<<<<<< * """ Remove keys from client desired list """ * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_releases_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_keys); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4263 * self.transitions(recommendations) * * def client_heartbeat(self, client=None): # <<<<<<<<<<<<<< * """ Handle heartbeats from Client """ * parent: SchedulerState = cast(SchedulerState, self) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_48client_heartbeat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_47client_heartbeat[] = " Handle heartbeats from Client "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_48client_heartbeat = {"client_heartbeat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_48client_heartbeat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_47client_heartbeat}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_48client_heartbeat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_client = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("client_heartbeat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "client_heartbeat") < 0)) __PYX_ERR(0, 4263, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_client = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("client_heartbeat", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4263, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_heartbeat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_47client_heartbeat(__pyx_self, __pyx_v_self, __pyx_v_client); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_47client_heartbeat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; double __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("client_heartbeat", 0); /* "distributed/scheduler.py":4265 * def client_heartbeat(self, client=None): * """ Handle heartbeats from Client """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * cs: ClientState = parent._clients[client] * cs._last_seen = time() */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4266 * """ Handle heartbeats from Client """ * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients[client] # <<<<<<<<<<<<<< * cs._last_seen = time() * */ if (unlikely(__pyx_v_parent->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4266, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_clients, __pyx_v_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4266, __pyx_L1_error) __pyx_v_cs = ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4267 * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients[client] * cs._last_seen = time() # <<<<<<<<<<<<<< * * ################### */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cs->_last_seen = __pyx_t_4; /* "distributed/scheduler.py":4263 * self.transitions(recommendations) * * def client_heartbeat(self, client=None): # <<<<<<<<<<<<<< * """ Handle heartbeats from Client """ * parent: SchedulerState = cast(SchedulerState, self) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_heartbeat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4273 * ################### * * def validate_released(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_50validate_released(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_50validate_released = {"validate_released", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_50validate_released, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_50validate_released(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_released (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_released", 1, 2, 2, 1); __PYX_ERR(0, 4273, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_released") < 0)) __PYX_ERR(0, 4273, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_released", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4273, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_released", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_49validate_released(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_49validate_released(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr45__pyx_v_dts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_released", 0); /* "distributed/scheduler.py":4274 * * def validate_released(self, key): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks[key] * dts: TaskState */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4275 * def validate_released(self, key): * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * assert ts._state == "released" */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4275, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4275, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4277 * ts: TaskState = parent._tasks[key] * dts: TaskState * assert ts._state == "released" # <<<<<<<<<<<<<< * assert not ts._waiters * assert not ts._waiting_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_released, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4277, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4277, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4278 * dts: TaskState * assert ts._state == "released" * assert not ts._waiters # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert not ts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4278, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4279 * assert ts._state == "released" * assert not ts._waiters * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._processing_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4279, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4280 * assert not ts._waiters * assert not ts._waiting_on * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not any([ts in dts._waiters for dts in ts._dependencies]) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4280, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4281 * assert not ts._waiting_on * assert not ts._who_has * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not any([ts in dts._waiters for dts in ts._dependencies]) * assert ts not in parent._unrunnable */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4281, __pyx_L1_error) if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4281, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4282 * assert not ts._who_has * assert not ts._processing_on * assert not any([ts in dts._waiters for dts in ts._dependencies]) # <<<<<<<<<<<<<< * assert ts not in parent._unrunnable * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4282, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4282, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, __pyx_t_6); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 4282, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4282, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_7)); __pyx_t_7 = 0; if (unlikely(__pyx_9genexpr45__pyx_v_dts->_waiters == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4282, __pyx_L5_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_9genexpr45__pyx_v_dts->_waiters, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4282, __pyx_L5_error) __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4282, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 4282, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr45__pyx_v_dts); __pyx_9genexpr45__pyx_v_dts = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr45__pyx_v_dts); __pyx_9genexpr45__pyx_v_dts = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4282, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4283 * assert not ts._processing_on * assert not any([ts in dts._waiters for dts in ts._dependencies]) * assert ts not in parent._unrunnable # <<<<<<<<<<<<<< * * def validate_waiting(self, key): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_parent->_unrunnable == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4283, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_parent->_unrunnable, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4283, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4283, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4273 * ################### * * def validate_released(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_released", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_9genexpr45__pyx_v_dts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4285 * assert ts not in parent._unrunnable * * def validate_waiting(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_52validate_waiting(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_52validate_waiting = {"validate_waiting", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_52validate_waiting, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_52validate_waiting(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_waiting (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_waiting", 1, 2, 2, 1); __PYX_ERR(0, 4285, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_waiting") < 0)) __PYX_ERR(0, 4285, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_waiting", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4285, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_waiting", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_51validate_waiting(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_51validate_waiting(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_waiting", 0); /* "distributed/scheduler.py":4286 * * def validate_waiting(self, key): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks[key] * dts: TaskState */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4287 * def validate_waiting(self, key): * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * assert ts._waiting_on */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4287, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4287, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4289 * ts: TaskState = parent._tasks[key] * dts: TaskState * assert ts._waiting_on # <<<<<<<<<<<<<< * assert not ts._who_has * assert not ts._processing_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4289, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4290 * dts: TaskState * assert ts._waiting_on * assert not ts._who_has # <<<<<<<<<<<<<< * assert not ts._processing_on * assert ts not in parent._unrunnable */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4290, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4291 * assert ts._waiting_on * assert not ts._who_has * assert not ts._processing_on # <<<<<<<<<<<<<< * assert ts not in parent._unrunnable * for dts in ts._dependencies: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4291, __pyx_L1_error) if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4291, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4292 * assert not ts._who_has * assert not ts._processing_on * assert ts not in parent._unrunnable # <<<<<<<<<<<<<< * for dts in ts._dependencies: * # We are waiting on a dependency iff it's not stored */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_parent->_unrunnable == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4292, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_parent->_unrunnable, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4292, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4292, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4293 * assert not ts._processing_on * assert ts not in parent._unrunnable * for dts in ts._dependencies: # <<<<<<<<<<<<<< * # We are waiting on a dependency iff it's not stored * assert (not not dts._who_has) != (dts in ts._waiting_on) */ __pyx_t_3 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4293, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":4295 * for dts in ts._dependencies: * # We are waiting on a dependency iff it's not stored * assert (not not dts._who_has) != (dts in ts._waiting_on) # <<<<<<<<<<<<<< * assert ts in dts._waiters # XXX even if dts._who_has? * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_dts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_has) != 0); if (unlikely(__pyx_v_ts->_waiting_on == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4295, __pyx_L1_error) } __pyx_t_8 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_dts), __pyx_v_ts->_waiting_on, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4295, __pyx_L1_error) if (unlikely(!(((!((!__pyx_t_2) != 0)) != __pyx_t_8) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4295, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4296 * # We are waiting on a dependency iff it's not stored * assert (not not dts._who_has) != (dts in ts._waiting_on) * assert ts in dts._waiters # XXX even if dts._who_has? # <<<<<<<<<<<<<< * * def validate_processing(self, key): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_dts->_waiters == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4296, __pyx_L1_error) } __pyx_t_8 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_dts->_waiters, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4296, __pyx_L1_error) if (unlikely(!(__pyx_t_8 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4296, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4285 * assert ts not in parent._unrunnable * * def validate_waiting(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_waiting", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4298 * assert ts in dts._waiters # XXX even if dts._who_has? * * def validate_processing(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_54validate_processing(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_54validate_processing = {"validate_processing", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_54validate_processing, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_54validate_processing(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_processing (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_processing", 1, 2, 2, 1); __PYX_ERR(0, 4298, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_processing") < 0)) __PYX_ERR(0, 4298, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_processing", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4298, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_processing", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_53validate_processing(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_53validate_processing(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_processing", 0); /* "distributed/scheduler.py":4299 * * def validate_processing(self, key): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks[key] * dts: TaskState */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4300 * def validate_processing(self, key): * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * assert not ts._waiting_on */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4300, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4300, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4302 * ts: TaskState = parent._tasks[key] * dts: TaskState * assert not ts._waiting_on # <<<<<<<<<<<<<< * ws: WorkerState = ts._processing_on * assert ws */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4302, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4303 * dts: TaskState * assert not ts._waiting_on * ws: WorkerState = ts._processing_on # <<<<<<<<<<<<<< * assert ws * assert ts in ws._processing */ __pyx_t_1 = ((PyObject *)__pyx_v_ts->_processing_on); __Pyx_INCREF(__pyx_t_1); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4304 * assert not ts._waiting_on * ws: WorkerState = ts._processing_on * assert ws # <<<<<<<<<<<<<< * assert ts in ws._processing * assert not ts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4304, __pyx_L1_error) if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4304, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4305 * ws: WorkerState = ts._processing_on * assert ws * assert ts in ws._processing # <<<<<<<<<<<<<< * assert not ts._who_has * for dts in ts._dependencies: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4305, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_ws->_processing, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4305, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4305, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4306 * assert ws * assert ts in ws._processing * assert not ts._who_has # <<<<<<<<<<<<<< * for dts in ts._dependencies: * assert dts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4306, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4307 * assert ts in ws._processing * assert not ts._who_has * for dts in ts._dependencies: # <<<<<<<<<<<<<< * assert dts._who_has * assert ts in dts._waiters */ __pyx_t_3 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4307, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":4308 * assert not ts._who_has * for dts in ts._dependencies: * assert dts._who_has # <<<<<<<<<<<<<< * assert ts in dts._waiters * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_dts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_has) != 0); if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4308, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4309 * for dts in ts._dependencies: * assert dts._who_has * assert ts in dts._waiters # <<<<<<<<<<<<<< * * def validate_memory(self, key): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_dts->_waiters == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4309, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_dts->_waiters, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4309, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4309, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4298 * assert ts in dts._waiters # XXX even if dts._who_has? * * def validate_processing(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_processing", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4311 * assert ts in dts._waiters * * def validate_memory(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_56validate_memory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_56validate_memory = {"validate_memory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_56validate_memory, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_56validate_memory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_memory (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_memory", 1, 2, 2, 1); __PYX_ERR(0, 4311, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_memory") < 0)) __PYX_ERR(0, 4311, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_memory", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4311, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_55validate_memory(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_55validate_memory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_memory", 0); /* "distributed/scheduler.py":4312 * * def validate_memory(self, key): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks[key] * dts: TaskState */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4313 * def validate_memory(self, key): * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * assert ts._who_has */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4313, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4313, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4315 * ts: TaskState = parent._tasks[key] * dts: TaskState * assert ts._who_has # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._waiting_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4315, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4316 * dts: TaskState * assert ts._who_has * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert ts not in parent._unrunnable */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4316, __pyx_L1_error) if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4316, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4317 * assert ts._who_has * assert not ts._processing_on * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert ts not in parent._unrunnable * for dts in ts._dependents: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4317, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4318 * assert not ts._processing_on * assert not ts._waiting_on * assert ts not in parent._unrunnable # <<<<<<<<<<<<<< * for dts in ts._dependents: * assert (dts in ts._waiters) == (dts._state in ("waiting", "processing")) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_parent->_unrunnable == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4318, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_parent->_unrunnable, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4318, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4318, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4319 * assert not ts._waiting_on * assert ts not in parent._unrunnable * for dts in ts._dependents: # <<<<<<<<<<<<<< * assert (dts in ts._waiters) == (dts._state in ("waiting", "processing")) * assert ts not in dts._waiting_on */ __pyx_t_3 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_dependents, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4319, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":4320 * assert ts not in parent._unrunnable * for dts in ts._dependents: * assert (dts in ts._waiters) == (dts._state in ("waiting", "processing")) # <<<<<<<<<<<<<< * assert ts not in dts._waiting_on * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ts->_waiters == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4320, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_dts), __pyx_v_ts->_waiters, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4320, __pyx_L1_error) __Pyx_INCREF(__pyx_v_dts->_state); __pyx_t_8 = __pyx_v_dts->_state; __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_n_u_waiting, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 4320, __pyx_L1_error) __pyx_t_11 = (__pyx_t_10 != 0); if (!__pyx_t_11) { } else { __pyx_t_9 = __pyx_t_11; goto __pyx_L5_bool_binop_done; } __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 4320, __pyx_L1_error) __pyx_t_10 = (__pyx_t_11 != 0); __pyx_t_9 = __pyx_t_10; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!((__pyx_t_2 == __pyx_t_9) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4320, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4321 * for dts in ts._dependents: * assert (dts in ts._waiters) == (dts._state in ("waiting", "processing")) * assert ts not in dts._waiting_on # <<<<<<<<<<<<<< * * def validate_no_worker(self, key): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_dts->_waiting_on == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4321, __pyx_L1_error) } __pyx_t_9 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_dts->_waiting_on, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4321, __pyx_L1_error) if (unlikely(!(__pyx_t_9 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4321, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4311 * assert ts in dts._waiters * * def validate_memory(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4323 * assert ts not in dts._waiting_on * * def validate_no_worker(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_58validate_no_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_58validate_no_worker = {"validate_no_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_58validate_no_worker, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_58validate_no_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_no_worker (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_no_worker", 1, 2, 2, 1); __PYX_ERR(0, 4323, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_no_worker") < 0)) __PYX_ERR(0, 4323, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_no_worker", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4323, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_no_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_57validate_no_worker(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_57validate_no_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_no_worker", 0); /* "distributed/scheduler.py":4324 * * def validate_no_worker(self, key): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks[key] * dts: TaskState */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4325 * def validate_no_worker(self, key): * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] # <<<<<<<<<<<<<< * dts: TaskState * assert ts in parent._unrunnable */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4325, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4325, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4327 * ts: TaskState = parent._tasks[key] * dts: TaskState * assert ts in parent._unrunnable # <<<<<<<<<<<<<< * assert not ts._waiting_on * assert ts in parent._unrunnable */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_parent->_unrunnable == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4327, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_parent->_unrunnable, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4327, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4327, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4328 * dts: TaskState * assert ts in parent._unrunnable * assert not ts._waiting_on # <<<<<<<<<<<<<< * assert ts in parent._unrunnable * assert not ts._processing_on */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4328, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4329 * assert ts in parent._unrunnable * assert not ts._waiting_on * assert ts in parent._unrunnable # <<<<<<<<<<<<<< * assert not ts._processing_on * assert not ts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_parent->_unrunnable == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4329, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_parent->_unrunnable, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4329, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4329, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4330 * assert not ts._waiting_on * assert ts in parent._unrunnable * assert not ts._processing_on # <<<<<<<<<<<<<< * assert not ts._who_has * for dts in ts._dependencies: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4330, __pyx_L1_error) if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4330, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4331 * assert ts in parent._unrunnable * assert not ts._processing_on * assert not ts._who_has # <<<<<<<<<<<<<< * for dts in ts._dependencies: * assert dts._who_has */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4331, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4332 * assert not ts._processing_on * assert not ts._who_has * for dts in ts._dependencies: # <<<<<<<<<<<<<< * assert dts._who_has * */ __pyx_t_3 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4332, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":4333 * assert not ts._who_has * for dts in ts._dependencies: * assert dts._who_has # <<<<<<<<<<<<<< * * def validate_erred(self, key): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_dts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_has) != 0); if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4333, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4323 * assert ts not in dts._waiting_on * * def validate_no_worker(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_no_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4335 * assert dts._who_has * * def validate_erred(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_60validate_erred(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_60validate_erred = {"validate_erred", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_60validate_erred, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_60validate_erred(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_erred (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_erred", 1, 2, 2, 1); __PYX_ERR(0, 4335, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_erred") < 0)) __PYX_ERR(0, 4335, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_erred", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4335, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_59validate_erred(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_59validate_erred(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_erred", 0); /* "distributed/scheduler.py":4336 * * def validate_erred(self, key): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks[key] * assert ts._exception_blame */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4337 * def validate_erred(self, key): * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] # <<<<<<<<<<<<<< * assert ts._exception_blame * assert not ts._who_has */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4337, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4337, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4338 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] * assert ts._exception_blame # <<<<<<<<<<<<<< * assert not ts._who_has * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_exception_blame); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4338, __pyx_L1_error) if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4338, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4339 * ts: TaskState = parent._tasks[key] * assert ts._exception_blame * assert not ts._who_has # <<<<<<<<<<<<<< * * def validate_key(self, key, ts: TaskState = None): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (unlikely(!((!__pyx_t_2) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4339, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4335 * assert dts._who_has * * def validate_erred(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4341 * assert not ts._who_has * * def validate_key(self, key, ts: TaskState = None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * try: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_62validate_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_62validate_key = {"validate_key", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_62validate_key, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_62validate_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_key (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_ts,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct __pyx_obj_11distributed_9scheduler_TaskState *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_key", 0, 2, 3, 1); __PYX_ERR(0, 4341, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_key") < 0)) __PYX_ERR(0, 4341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_key", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 4341, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_61validate_key(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_ts); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_61validate_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_func = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; char const *__pyx_t_19; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_key", 0); __Pyx_INCREF((PyObject *)__pyx_v_ts); /* "distributed/scheduler.py":4342 * * def validate_key(self, key, ts: TaskState = None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * try: * if ts is None: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4343 * def validate_key(self, key, ts: TaskState = None): * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * if ts is None: * ts = parent._tasks.get(key) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":4344 * parent: SchedulerState = cast(SchedulerState, self) * try: * if ts is None: # <<<<<<<<<<<<<< * ts = parent._tasks.get(key) * if ts is None: */ __pyx_t_5 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":4345 * try: * if ts is None: * ts = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is None: * logger.debug("Key lost: %s", key) */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4345, __pyx_L3_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4345, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4345, __pyx_L3_error) __Pyx_DECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":4344 * parent: SchedulerState = cast(SchedulerState, self) * try: * if ts is None: # <<<<<<<<<<<<<< * ts = parent._tasks.get(key) * if ts is None: */ } /* "distributed/scheduler.py":4346 * if ts is None: * ts = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * logger.debug("Key lost: %s", key) * else: */ __pyx_t_6 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":4347 * ts = parent._tasks.get(key) * if ts is None: * logger.debug("Key lost: %s", key) # <<<<<<<<<<<<<< * else: * ts.validate() */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4347, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_debug); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4347, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_u_Key_lost_s, __pyx_v_key}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4347, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_u_Key_lost_s, __pyx_v_key}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4347, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4347, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_kp_u_Key_lost_s); __Pyx_GIVEREF(__pyx_kp_u_Key_lost_s); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_kp_u_Key_lost_s); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_key); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4347, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4346 * if ts is None: * ts = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * logger.debug("Key lost: %s", key) * else: */ goto __pyx_L10; } /* "distributed/scheduler.py":4349 * logger.debug("Key lost: %s", key) * else: * ts.validate() # <<<<<<<<<<<<<< * try: * func = getattr(self, "validate_" + ts._state.replace("-", "_")) */ /*else*/ { __pyx_t_1 = __pyx_f_11distributed_9scheduler_9TaskState_validate(__pyx_v_ts, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4349, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4350 * else: * ts.validate() * try: # <<<<<<<<<<<<<< * func = getattr(self, "validate_" + ts._state.replace("-", "_")) * except AttributeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "distributed/scheduler.py":4351 * ts.validate() * try: * func = getattr(self, "validate_" + ts._state.replace("-", "_")) # <<<<<<<<<<<<<< * except AttributeError: * logger.error( */ if (unlikely(__pyx_v_ts->_state == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace"); __PYX_ERR(0, 4351, __pyx_L11_error) } __pyx_t_1 = PyUnicode_Replace(__pyx_v_ts->_state, __pyx_kp_u__60, __pyx_n_u__61, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_n_u_validate_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetAttr(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4350 * else: * ts.validate() * try: # <<<<<<<<<<<<<< * func = getattr(self, "validate_" + ts._state.replace("-", "_")) * except AttributeError: */ } /* "distributed/scheduler.py":4357 * ) * else: * func(key) # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ /*else:*/ { __Pyx_INCREF(__pyx_v_func); __pyx_t_8 = __pyx_v_func; __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_key); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4357, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4352 * try: * func = getattr(self, "validate_" + ts._state.replace("-", "_")) * except AttributeError: # <<<<<<<<<<<<<< * logger.error( * "self.validate_%s not found", ts._state.replace("-", "_") */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_9) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_key", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_10) < 0) __PYX_ERR(0, 4352, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_10); /* "distributed/scheduler.py":4353 * func = getattr(self, "validate_" + ts._state.replace("-", "_")) * except AttributeError: * logger.error( # <<<<<<<<<<<<<< * "self.validate_%s not found", ts._state.replace("-", "_") * ) */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4353, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_error); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4353, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":4354 * except AttributeError: * logger.error( * "self.validate_%s not found", ts._state.replace("-", "_") # <<<<<<<<<<<<<< * ) * else: */ if (unlikely(__pyx_v_ts->_state == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace"); __PYX_ERR(0, 4354, __pyx_L13_except_error) } __pyx_t_14 = PyUnicode_Replace(__pyx_v_ts->_state, __pyx_kp_u__60, __pyx_n_u__61, -1L); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4354, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_kp_u_self_validate__s_not_found, __pyx_t_14}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4353, __pyx_L13_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_kp_u_self_validate__s_not_found, __pyx_t_14}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4353, __pyx_L13_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { __pyx_t_17 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 4353, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_17); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_kp_u_self_validate__s_not_found); __Pyx_GIVEREF(__pyx_kp_u_self_validate__s_not_found); PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_9, __pyx_kp_u_self_validate__s_not_found); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_9, __pyx_t_14); __pyx_t_14 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4353, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "distributed/scheduler.py":4350 * else: * ts.validate() * try: # <<<<<<<<<<<<<< * func = getattr(self, "validate_" + ts._state.replace("-", "_")) * except AttributeError: */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L3_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L16_try_end:; } } __pyx_L10:; /* "distributed/scheduler.py":4343 * def validate_key(self, key, ts: TaskState = None): * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * if ts is None: * ts = parent._tasks.get(key) */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4358 * else: * func(key) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_key", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_8, &__pyx_t_1) < 0) __PYX_ERR(0, 4358, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_v_e = __pyx_t_8; /*try:*/ { /* "distributed/scheduler.py":4359 * func(key) * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_logger); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4359, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_exception); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 4359, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_7 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_15, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_e); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4359, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4360 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4360, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4360, __pyx_L24_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":4361 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_7 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4361, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_pdb = __pyx_t_7; __pyx_t_7 = 0; /* "distributed/scheduler.py":4363 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 4363, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_7 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_17); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4363, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4360 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":4364 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def validate_state(self, allow_overlap=False): */ __Pyx_GIVEREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_10, __pyx_t_8, __pyx_t_1); __pyx_t_10 = 0; __pyx_t_8 = 0; __pyx_t_1 = 0; __PYX_ERR(0, 4364, __pyx_L24_error) } /* "distributed/scheduler.py":4358 * else: * func(key) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L24_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_9 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_12, __pyx_t_11); __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":4343 * def validate_key(self, key, ts: TaskState = None): * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * if ts is None: * ts = parent._tasks.get(key) */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "distributed/scheduler.py":4341 * assert not ts._who_has * * def validate_key(self, key, ts: TaskState = None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * try: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4366 * raise * * def validate_state(self, allow_overlap=False): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * validate_state(parent._tasks, parent._workers, parent._clients) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_64validate_state(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_64validate_state = {"validate_state", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_64validate_state, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_64validate_state(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_allow_overlap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_state (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_allow_overlap,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_False)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_overlap); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_state") < 0)) __PYX_ERR(0, 4366, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_allow_overlap = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_state", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4366, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_63validate_state(__pyx_self, __pyx_v_self, __pyx_v_allow_overlap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_14validate_state_9genexpr47_2generator32(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4398 * a = {w: ws._nbytes for w, ws in parent._workers_dv.items()} * b = { * w: sum(ts.get_nbytes() for ts in ws._has_what) # <<<<<<<<<<<<<< * for w, ws in parent._workers_dv.items() * } */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_14validate_state_9genexpr47_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_20_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_20_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4398, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_14validate_state_9genexpr47_2generator32, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_validate_state_locals, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4398, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_state.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_14validate_state_9genexpr47_2generator32(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4398, __pyx_L1_error) __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr47__pyx_v_ws)) { __Pyx_RaiseClosureNameError("ws"); __PYX_ERR(0, 4398, __pyx_L1_error) } __pyx_t_5 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr47__pyx_v_ws->_has_what, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 4398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ts); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ts, __pyx_n_s_get_nbytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4398, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4366 * raise * * def validate_state(self, allow_overlap=False): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * validate_state(parent._tasks, parent._workers, parent._clients) */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_63validate_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_allow_overlap) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_w = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_c = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_v_a = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_actual_total_occupancy = NULL; CYTHON_UNUSED PyObject *__pyx_v_worker = NULL; PyObject *__pyx_9genexpr46__pyx_v_w = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr46__pyx_v_ws = NULL; PyObject *__pyx_9genexpr47__pyx_v_w = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_state", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_19_validate_state(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_19_validate_state, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4366, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } /* "distributed/scheduler.py":4367 * * def validate_state(self, allow_overlap=False): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * validate_state(parent._tasks, parent._workers, parent._clients) * */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4368 * def validate_state(self, allow_overlap=False): * parent: SchedulerState = cast(SchedulerState, self) * validate_state(parent._tasks, parent._workers, parent._clients) # <<<<<<<<<<<<<< * * if not (set(parent._workers_dv) == set(self.stream_comms)): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_validate_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_parent->_tasks, __pyx_v_parent->_workers, __pyx_v_parent->_clients}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4368, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_parent->_tasks, __pyx_v_parent->_workers, __pyx_v_parent->_clients}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4368, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_parent->_tasks); __Pyx_GIVEREF(__pyx_v_parent->_tasks); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_parent->_tasks); __Pyx_INCREF(__pyx_v_parent->_workers); __Pyx_GIVEREF(__pyx_v_parent->_workers); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_parent->_workers); __Pyx_INCREF(__pyx_v_parent->_clients); __Pyx_GIVEREF(__pyx_v_parent->_clients); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_parent->_clients); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4370 * validate_state(parent._tasks, parent._workers, parent._clients) * * if not (set(parent._workers_dv) == set(self.stream_comms)): # <<<<<<<<<<<<<< * raise ValueError("Workers not the same in all collections") * */ __pyx_t_1 = PySet_New(__pyx_v_parent->_workers_dv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = ((!__pyx_t_6) != 0); if (unlikely(__pyx_t_7)) { /* "distributed/scheduler.py":4371 * * if not (set(parent._workers_dv) == set(self.stream_comms)): * raise ValueError("Workers not the same in all collections") # <<<<<<<<<<<<<< * * ws: WorkerState */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 4371, __pyx_L1_error) /* "distributed/scheduler.py":4370 * validate_state(parent._tasks, parent._workers, parent._clients) * * if not (set(parent._workers_dv) == set(self.stream_comms)): # <<<<<<<<<<<<<< * raise ValueError("Workers not the same in all collections") * */ } /* "distributed/scheduler.py":4374 * * ws: WorkerState * for w, ws in parent._workers_dv.items(): # <<<<<<<<<<<<<< * assert isinstance(w, str), (type(w), w) * assert isinstance(ws, WorkerState), (type(ws), ws) */ __pyx_t_8 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4374, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_9, &__pyx_t_8, &__pyx_t_5, &__pyx_t_1, NULL, __pyx_t_4); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 4374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4374, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":4375 * ws: WorkerState * for w, ws in parent._workers_dv.items(): * assert isinstance(w, str), (type(w), w) # <<<<<<<<<<<<<< * assert isinstance(ws, WorkerState), (type(ws), ws) * assert ws._address == w */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = PyUnicode_Check(__pyx_v_w); if (unlikely(!(__pyx_t_7 != 0))) { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_w))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_w))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(__pyx_v_w))); __Pyx_INCREF(__pyx_v_w); __Pyx_GIVEREF(__pyx_v_w); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_w); __pyx_t_5 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 4375, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4376 * for w, ws in parent._workers_dv.items(): * assert isinstance(w, str), (type(w), w) * assert isinstance(ws, WorkerState), (type(ws), ws) # <<<<<<<<<<<<<< * assert ws._address == w * if not ws._processing: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = __Pyx_TypeCheck(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState); if (unlikely(!(__pyx_t_7 != 0))) { __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ws)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ws)))); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ws)))); __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_ws)); __pyx_t_1 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 4376, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4377 * assert isinstance(w, str), (type(w), w) * assert isinstance(ws, WorkerState), (type(ws), ws) * assert ws._address == w # <<<<<<<<<<<<<< * if not ws._processing: * assert not ws._occupancy */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_ws->_address, __pyx_v_w, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 4377, __pyx_L1_error) if (unlikely(!__pyx_t_7)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4377, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4378 * assert isinstance(ws, WorkerState), (type(ws), ws) * assert ws._address == w * if not ws._processing: # <<<<<<<<<<<<<< * assert not ws._occupancy * assert ws._address in parent._idle_dv */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_ws->_processing); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 4378, __pyx_L1_error) __pyx_t_6 = ((!__pyx_t_7) != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":4379 * assert ws._address == w * if not ws._processing: * assert not ws._occupancy # <<<<<<<<<<<<<< * assert ws._address in parent._idle_dv * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((!(__pyx_v_ws->_occupancy != 0)) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4379, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4380 * if not ws._processing: * assert not ws._occupancy * assert ws._address in parent._idle_dv # <<<<<<<<<<<<<< * * ts: TaskState */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_parent->_idle_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4380, __pyx_L1_error) } __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_ws->_address, __pyx_v_parent->_idle_dv, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4380, __pyx_L1_error) if (unlikely(!(__pyx_t_6 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4380, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4378 * assert isinstance(ws, WorkerState), (type(ws), ws) * assert ws._address == w * if not ws._processing: # <<<<<<<<<<<<<< * assert not ws._occupancy * assert ws._address in parent._idle_dv */ } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4383 * * ts: TaskState * for k, ts in parent._tasks.items(): # <<<<<<<<<<<<<< * assert isinstance(ts, TaskState), (type(ts), ts) * assert ts._key == k */ __pyx_t_9 = 0; if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4383, __pyx_L1_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_parent->_tasks, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_9, &__pyx_t_1, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 4383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4383, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":4384 * ts: TaskState * for k, ts in parent._tasks.items(): * assert isinstance(ts, TaskState), (type(ts), ts) # <<<<<<<<<<<<<< * assert ts._key == k * self.validate_key(k, ts) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = __Pyx_TypeCheck(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState); if (unlikely(!(__pyx_t_6 != 0))) { __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ts)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ts)))); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_ts)))); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_ts)); __pyx_t_1 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 4384, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4385 * for k, ts in parent._tasks.items(): * assert isinstance(ts, TaskState), (type(ts), ts) * assert ts._key == k # <<<<<<<<<<<<<< * self.validate_key(k, ts) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_key, __pyx_v_k, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4385, __pyx_L1_error) if (unlikely(!__pyx_t_6)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4385, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4386 * assert isinstance(ts, TaskState), (type(ts), ts) * assert ts._key == k * self.validate_key(k, ts) # <<<<<<<<<<<<<< * * c: str */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_validate_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_k, ((PyObject *)__pyx_v_ts)}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4386, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_k, ((PyObject *)__pyx_v_ts)}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4386, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_k); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, ((PyObject *)__pyx_v_ts)); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4390 * c: str * cs: ClientState * for c, cs in parent._clients.items(): # <<<<<<<<<<<<<< * # client=None is often used in tests... * assert c is None or type(c) == str, (type(c), c) */ __pyx_t_8 = 0; if (unlikely(__pyx_v_parent->_clients == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4390, __pyx_L1_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_parent->_clients, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_9, &__pyx_t_8, &__pyx_t_1, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 4390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4390, __pyx_L1_error) if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4390, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":4392 * for c, cs in parent._clients.items(): * # client=None is often used in tests... * assert c is None or type(c) == str, (type(c), c) # <<<<<<<<<<<<<< * assert type(cs) == ClientState, (type(cs), cs) * assert cs._client_key == c */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = (__pyx_v_c == ((PyObject*)Py_None)); __pyx_t_12 = (__pyx_t_7 != 0); if (!__pyx_t_12) { } else { __pyx_t_6 = __pyx_t_12; goto __pyx_L11_bool_binop_done; } __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_c)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4392, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __pyx_t_12; __pyx_L11_bool_binop_done:; if (unlikely(!__pyx_t_6)) { __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_c))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_c))); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(__pyx_v_c))); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_c); __pyx_t_1 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 4392, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4393 * # client=None is often used in tests... * assert c is None or type(c) == str, (type(c), c) * assert type(cs) == ClientState, (type(cs), cs) # <<<<<<<<<<<<<< * assert cs._client_key == c * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cs))), ((PyObject *)__pyx_ptype_11distributed_9scheduler_ClientState), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4393, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4393, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cs)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cs)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cs)))); __Pyx_INCREF(((PyObject *)__pyx_v_cs)); __Pyx_GIVEREF(((PyObject *)__pyx_v_cs)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cs)); __pyx_t_5 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 4393, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4394 * assert c is None or type(c) == str, (type(c), c) * assert type(cs) == ClientState, (type(cs), cs) * assert cs._client_key == c # <<<<<<<<<<<<<< * * a = {w: ws._nbytes for w, ws in parent._workers_dv.items()} */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_cs->_client_key, __pyx_v_c, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4394, __pyx_L1_error) if (unlikely(!(__pyx_t_6 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4394, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4396 * assert cs._client_key == c * * a = {w: ws._nbytes for w, ws in parent._workers_dv.items()} # <<<<<<<<<<<<<< * b = { * w: sum(ts.get_nbytes() for ts in ws._has_what) */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4396, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4396, __pyx_L15_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4396, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_8, &__pyx_t_9, &__pyx_t_1, &__pyx_t_11, NULL, __pyx_t_4); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 4396, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4396, __pyx_L15_error) __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_w, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_11)); __pyx_t_11 = 0; __pyx_t_11 = PyInt_FromSsize_t(__pyx_9genexpr46__pyx_v_ws->_nbytes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4396, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_11); if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr46__pyx_v_w, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 4396, __pyx_L15_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_w); __pyx_9genexpr46__pyx_v_w = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr46__pyx_v_ws); __pyx_9genexpr46__pyx_v_ws = 0; goto __pyx_L18_exit_scope; __pyx_L15_error:; __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_w); __pyx_9genexpr46__pyx_v_w = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr46__pyx_v_ws); __pyx_9genexpr46__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L18_exit_scope:; } /* exit inner scope */ __pyx_v_a = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4397 * * a = {w: ws._nbytes for w, ws in parent._workers_dv.items()} * b = { # <<<<<<<<<<<<<< * w: sum(ts.get_nbytes() for ts in ws._has_what) * for w, ws in parent._workers_dv.items() */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4397, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":4399 * b = { * w: sum(ts.get_nbytes() for ts in ws._has_what) * for w, ws in parent._workers_dv.items() # <<<<<<<<<<<<<< * } * assert a == b, (a, b) */ __pyx_t_8 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4399, __pyx_L21_error) } __pyx_t_11 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_4)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4399, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_9, &__pyx_t_8, &__pyx_t_11, &__pyx_t_1, NULL, __pyx_t_4); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 4399, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4399, __pyx_L21_error) __Pyx_XDECREF_SET(__pyx_9genexpr47__pyx_v_w, __pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr47__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr47__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4398 * a = {w: ws._nbytes for w, ws in parent._workers_dv.items()} * b = { * w: sum(ts.get_nbytes() for ts in ws._has_what) # <<<<<<<<<<<<<< * for w, ws in parent._workers_dv.items() * } */ __pyx_t_1 = __pyx_pf_11distributed_9scheduler_9Scheduler_14validate_state_9genexpr47_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4398, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4398, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr47__pyx_v_w, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 4398, __pyx_L21_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_w); __pyx_9genexpr47__pyx_v_w = 0; goto __pyx_L24_exit_scope; __pyx_L21_error:; __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_w); __pyx_9genexpr47__pyx_v_w = 0; goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ __pyx_v_b = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4401 * for w, ws in parent._workers_dv.items() * } * assert a == b, (a, b) # <<<<<<<<<<<<<< * * actual_total_occupancy = 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4401, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4401, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) { __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_a); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_b); __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 4401, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4403 * assert a == b, (a, b) * * actual_total_occupancy = 0 # <<<<<<<<<<<<<< * for worker, ws in parent._workers_dv.items(): * assert abs(sum(ws._processing.values()) - ws._occupancy) < 1e-8 */ __Pyx_INCREF(__pyx_int_0); __pyx_v_actual_total_occupancy = __pyx_int_0; /* "distributed/scheduler.py":4404 * * actual_total_occupancy = 0 * for worker, ws in parent._workers_dv.items(): # <<<<<<<<<<<<<< * assert abs(sum(ws._processing.values()) - ws._occupancy) < 1e-8 * actual_total_occupancy += ws._occupancy */ __pyx_t_9 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4404, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_8, &__pyx_t_9, &__pyx_t_2, &__pyx_t_11, NULL, __pyx_t_4); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 4404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4404, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_worker, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_11)); __pyx_t_11 = 0; /* "distributed/scheduler.py":4405 * actual_total_occupancy = 0 * for worker, ws in parent._workers_dv.items(): * assert abs(sum(ws._processing.values()) - ws._occupancy) < 1e-8 # <<<<<<<<<<<<<< * actual_total_occupancy += ws._occupancy * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 4405, __pyx_L1_error) } __pyx_t_11 = __Pyx_PyDict_Values(__pyx_v_ws->_processing); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyFloat_FromDouble(__pyx_v_ws->_occupancy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_float_1eneg_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4405, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4406 * for worker, ws in parent._workers_dv.items(): * assert abs(sum(ws._processing.values()) - ws._occupancy) < 1e-8 * actual_total_occupancy += ws._occupancy # <<<<<<<<<<<<<< * * assert abs(actual_total_occupancy - parent._total_occupancy) < 1e-8, ( */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ws->_occupancy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_actual_total_occupancy, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_actual_total_occupancy, __pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4408 * actual_total_occupancy += ws._occupancy * * assert abs(actual_total_occupancy - parent._total_occupancy) < 1e-8, ( # <<<<<<<<<<<<<< * actual_total_occupancy, * parent._total_occupancy, */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = PyFloat_FromDouble(__pyx_v_parent->_total_occupancy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PyNumber_Subtract(__pyx_v_actual_total_occupancy, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyObject_RichCompare(__pyx_t_5, __pyx_float_1eneg_8, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_6)) { /* "distributed/scheduler.py":4410 * assert abs(actual_total_occupancy - parent._total_occupancy) < 1e-8, ( * actual_total_occupancy, * parent._total_occupancy, # <<<<<<<<<<<<<< * ) * */ __pyx_t_11 = PyFloat_FromDouble(__pyx_v_parent->_total_occupancy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); /* "distributed/scheduler.py":4409 * * assert abs(actual_total_occupancy - parent._total_occupancy) < 1e-8, ( * actual_total_occupancy, # <<<<<<<<<<<<<< * parent._total_occupancy, * ) */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_actual_total_occupancy); __Pyx_GIVEREF(__pyx_v_actual_total_occupancy); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_actual_total_occupancy); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(0, 4408, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4366 * raise * * def validate_state(self, allow_overlap=False): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * validate_state(parent._tasks, parent._workers, parent._clients) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.Scheduler.validate_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_actual_total_occupancy); __Pyx_XDECREF(__pyx_v_worker); __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_w); __Pyx_XDECREF((PyObject *)__pyx_9genexpr46__pyx_v_ws); __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_w); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4417 * ################### * * def report(self, msg: dict, ts: TaskState = None, client: str = None): # <<<<<<<<<<<<<< * """ * Publish updates to all listening Queues and Comms */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_66report(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_65report[] = "\n Publish updates to all listening Queues and Comms\n\n If the message contains a key then we only send the message to those\n comms that care about the key.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_66report = {"report", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_66report, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_65report}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_66report(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_msg = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_client = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("report (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_msg,&__pyx_n_s_ts,&__pyx_n_s_client,0}; PyObject* values[4] = {0,0,0,0}; values[2] = (PyObject *)((struct __pyx_obj_11distributed_9scheduler_TaskState *)((PyObject *)Py_None)); values[3] = ((PyObject*)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("report", 0, 2, 4, 1); __PYX_ERR(0, 4417, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "report") < 0)) __PYX_ERR(0, 4417, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_msg = ((PyObject*)values[1]); __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[2]); __pyx_v_client = ((PyObject*)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("report", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4417, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.report", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_msg), (&PyDict_Type), 1, "msg", 1))) __PYX_ERR(0, 4417, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 4417, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), (&PyUnicode_Type), 1, "client", 1))) __PYX_ERR(0, 4417, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_65report(__pyx_self, __pyx_v_self, __pyx_v_msg, __pyx_v_ts, __pyx_v_client); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_65report(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_msg, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, PyObject *__pyx_v_client) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_msg_key = NULL; PyObject *__pyx_v_tasks = 0; PyObject *__pyx_v_client_comms = 0; PyObject *__pyx_v_client_keys = 0; PyObject *__pyx_v_k = 0; PyObject *__pyx_v_c = NULL; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_9genexpr49__pyx_v_cs = NULL; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_9genexpr50__pyx_v_cs = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("report", 0); __Pyx_INCREF((PyObject *)__pyx_v_ts); /* "distributed/scheduler.py":4424 * comms that care about the key. * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if ts is None: * msg_key = msg.get("key") */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4425 * """ * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: # <<<<<<<<<<<<<< * msg_key = msg.get("key") * if msg_key is not None: */ __pyx_t_2 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4426 * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: * msg_key = msg.get("key") # <<<<<<<<<<<<<< * if msg_key is not None: * tasks: dict = parent._tasks */ if (unlikely(__pyx_v_msg == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4426, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_msg, __pyx_n_u_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg_key = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4427 * if ts is None: * msg_key = msg.get("key") * if msg_key is not None: # <<<<<<<<<<<<<< * tasks: dict = parent._tasks * ts = tasks.get(msg_key) */ __pyx_t_3 = (__pyx_v_msg_key != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4428 * msg_key = msg.get("key") * if msg_key is not None: * tasks: dict = parent._tasks # <<<<<<<<<<<<<< * ts = tasks.get(msg_key) * */ __pyx_t_1 = __pyx_v_parent->_tasks; __Pyx_INCREF(__pyx_t_1); __pyx_v_tasks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4429 * if msg_key is not None: * tasks: dict = parent._tasks * ts = tasks.get(msg_key) # <<<<<<<<<<<<<< * * cs: ClientState */ if (unlikely(__pyx_v_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4429, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_tasks, __pyx_v_msg_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4429, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":4427 * if ts is None: * msg_key = msg.get("key") * if msg_key is not None: # <<<<<<<<<<<<<< * tasks: dict = parent._tasks * ts = tasks.get(msg_key) */ } /* "distributed/scheduler.py":4425 * """ * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: # <<<<<<<<<<<<<< * msg_key = msg.get("key") * if msg_key is not None: */ } /* "distributed/scheduler.py":4432 * * cs: ClientState * client_comms: dict = self.client_comms # <<<<<<<<<<<<<< * client_keys: list * if ts is None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4432, __pyx_L1_error) __pyx_v_client_comms = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4434 * client_comms: dict = self.client_comms * client_keys: list * if ts is None: # <<<<<<<<<<<<<< * # Notify all clients * client_keys = list(client_comms) */ __pyx_t_2 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4436 * if ts is None: * # Notify all clients * client_keys = list(client_comms) # <<<<<<<<<<<<<< * elif client is None: * # Notify clients interested in key */ __pyx_t_1 = PySequence_List(__pyx_v_client_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_client_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4434 * client_comms: dict = self.client_comms * client_keys: list * if ts is None: # <<<<<<<<<<<<<< * # Notify all clients * client_keys = list(client_comms) */ goto __pyx_L5; } /* "distributed/scheduler.py":4437 * # Notify all clients * client_keys = list(client_comms) * elif client is None: # <<<<<<<<<<<<<< * # Notify clients interested in key * client_keys = [cs._client_key for cs in ts._who_wants] */ __pyx_t_3 = (__pyx_v_client == ((PyObject*)Py_None)); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4439 * elif client is None: * # Notify clients interested in key * client_keys = [cs._client_key for cs in ts._who_wants] # <<<<<<<<<<<<<< * else: * # Notify clients interested in key (including `client`) */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4439, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4439, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 4439, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4439, __pyx_L8_error) __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_8)); __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr49__pyx_v_cs->_client_key))) __PYX_ERR(0, 4439, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr49__pyx_v_cs); __pyx_9genexpr49__pyx_v_cs = 0; goto __pyx_L11_exit_scope; __pyx_L8_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr49__pyx_v_cs); __pyx_9genexpr49__pyx_v_cs = 0; goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ __pyx_v_client_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4437 * # Notify all clients * client_keys = list(client_comms) * elif client is None: # <<<<<<<<<<<<<< * # Notify clients interested in key * client_keys = [cs._client_key for cs in ts._who_wants] */ goto __pyx_L5; } /* "distributed/scheduler.py":4442 * else: * # Notify clients interested in key (including `client`) * client_keys = [ # <<<<<<<<<<<<<< * cs._client_key for cs in ts._who_wants if cs._client_key != client * ] */ /*else*/ { { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4442, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":4443 * # Notify clients interested in key (including `client`) * client_keys = [ * cs._client_key for cs in ts._who_wants if cs._client_key != client # <<<<<<<<<<<<<< * ] * client_keys.append(client) */ __pyx_t_6 = 0; __pyx_t_8 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_5), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4443, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_5, &__pyx_t_6, &__pyx_t_8, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 4443, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4443, __pyx_L14_error) __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_8)); __pyx_t_8 = 0; __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_9genexpr50__pyx_v_cs->_client_key, __pyx_v_client, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4443, __pyx_L14_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr50__pyx_v_cs->_client_key))) __PYX_ERR(0, 4442, __pyx_L14_error) } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr50__pyx_v_cs); __pyx_9genexpr50__pyx_v_cs = 0; goto __pyx_L18_exit_scope; __pyx_L14_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr50__pyx_v_cs); __pyx_9genexpr50__pyx_v_cs = 0; goto __pyx_L1_error; __pyx_L18_exit_scope:; } /* exit inner scope */ __pyx_v_client_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4445 * cs._client_key for cs in ts._who_wants if cs._client_key != client * ] * client_keys.append(client) # <<<<<<<<<<<<<< * * k: str */ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_client_keys, __pyx_v_client); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 4445, __pyx_L1_error) } __pyx_L5:; /* "distributed/scheduler.py":4448 * * k: str * for k in client_keys: # <<<<<<<<<<<<<< * c = client_comms.get(k) * if c is None: */ __pyx_t_1 = __pyx_v_client_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4448, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 4448, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":4449 * k: str * for k in client_keys: * c = client_comms.get(k) # <<<<<<<<<<<<<< * if c is None: * continue */ if (unlikely(__pyx_v_client_comms == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4449, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_client_comms, __pyx_v_k, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4450 * for k in client_keys: * c = client_comms.get(k) * if c is None: # <<<<<<<<<<<<<< * continue * try: */ __pyx_t_3 = (__pyx_v_c == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4451 * c = client_comms.get(k) * if c is None: * continue # <<<<<<<<<<<<<< * try: * c.send(msg) */ goto __pyx_L19_continue; /* "distributed/scheduler.py":4450 * for k in client_keys: * c = client_comms.get(k) * if c is None: # <<<<<<<<<<<<<< * continue * try: */ } /* "distributed/scheduler.py":4452 * if c is None: * continue * try: # <<<<<<<<<<<<<< * c.send(msg) * # logger.debug("Scheduler sends message to client %s", msg) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "distributed/scheduler.py":4453 * continue * try: * c.send(msg) # <<<<<<<<<<<<<< * # logger.debug("Scheduler sends message to client %s", msg) * except CommClosedError: */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_send); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4453, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_4 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_14, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4453, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4452 * if c is None: * continue * try: # <<<<<<<<<<<<<< * c.send(msg) * # logger.debug("Scheduler sends message to client %s", msg) */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L29_try_end; __pyx_L22_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4455 * c.send(msg) * # logger.debug("Scheduler sends message to client %s", msg) * except CommClosedError: # <<<<<<<<<<<<<< * if self.status == Status.running: * logger.critical("Tried writing to closed comm: %s", msg) */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_8, &__pyx_t_14); __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4455, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_7 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_8, __pyx_t_14); __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_14 = 0; if (__pyx_t_7) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.report", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_8, &__pyx_t_4) < 0) __PYX_ERR(0, 4455, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":4456 * # logger.debug("Scheduler sends message to client %s", msg) * except CommClosedError: * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.critical("Tried writing to closed comm: %s", msg) * */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4456, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_Status); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4456, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_running); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 4456, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyObject_RichCompare(__pyx_t_15, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4456, __pyx_L24_except_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4456, __pyx_L24_except_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":4457 * except CommClosedError: * if self.status == Status.running: * logger.critical("Tried writing to closed comm: %s", msg) # <<<<<<<<<<<<<< * * async def add_client(self, comm, client=None, versions=None): */ __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_logger); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 4457, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_critical); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4457, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_u_Tried_writing_to_closed_comm_s, __pyx_v_msg}; __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4457, __pyx_L24_except_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_16); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_u_Tried_writing_to_closed_comm_s, __pyx_v_msg}; __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4457, __pyx_L24_except_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_16); } else #endif { __pyx_t_18 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4457, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_18); if (__pyx_t_17) { __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); __pyx_t_17 = NULL; } __Pyx_INCREF(__pyx_kp_u_Tried_writing_to_closed_comm_s); __Pyx_GIVEREF(__pyx_kp_u_Tried_writing_to_closed_comm_s); PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_7, __pyx_kp_u_Tried_writing_to_closed_comm_s); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_7, __pyx_v_msg); __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_18, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4457, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":4456 * # logger.debug("Scheduler sends message to client %s", msg) * except CommClosedError: * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.critical("Tried writing to closed comm: %s", msg) * */ } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L23_exception_handled; } goto __pyx_L24_except_error; __pyx_L24_except_error:; /* "distributed/scheduler.py":4452 * if c is None: * continue * try: # <<<<<<<<<<<<<< * c.send(msg) * # logger.debug("Scheduler sends message to client %s", msg) */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L23_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L29_try_end:; } /* "distributed/scheduler.py":4448 * * k: str * for k in client_keys: # <<<<<<<<<<<<<< * c = client_comms.get(k) * if c is None: */ __pyx_L19_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4417 * ################### * * def report(self, msg: dict, ts: TaskState = None, client: str = None): # <<<<<<<<<<<<<< * """ * Publish updates to all listening Queues and Comms */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_AddTraceback("distributed.scheduler.Scheduler.report", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_msg_key); __Pyx_XDECREF(__pyx_v_tasks); __Pyx_XDECREF(__pyx_v_client_comms); __Pyx_XDECREF(__pyx_v_client_keys); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF((PyObject *)__pyx_9genexpr49__pyx_v_cs); __Pyx_XDECREF((PyObject *)__pyx_9genexpr50__pyx_v_cs); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_69generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4459 * logger.critical("Tried writing to closed comm: %s", msg) * * async def add_client(self, comm, client=None, versions=None): # <<<<<<<<<<<<<< * """Add client to network * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_68add_client(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_67add_client[] = "Add client to network\n\n We listen to all future messages from this Comm.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_68add_client = {"add_client", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_68add_client, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_67add_client}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_68add_client(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_client = 0; PyObject *__pyx_v_versions = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_client (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_client,&__pyx_n_s_versions,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_client", 0, 2, 4, 1); __PYX_ERR(0, 4459, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_versions); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_client") < 0)) __PYX_ERR(0, 4459, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_client = values[2]; __pyx_v_versions = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_client", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4459, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_client", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_67add_client(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_client, __pyx_v_versions); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_67add_client(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_client, PyObject *__pyx_v_versions) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_client", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_21_add_client(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_21_add_client, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4459, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_client = __pyx_v_client; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); __pyx_cur_scope->__pyx_v_versions = __pyx_v_versions; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_69generator6, __pyx_codeobj__63, (PyObject *) __pyx_cur_scope, __pyx_n_s_add_client, __pyx_n_s_Scheduler_add_client, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4459, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_client", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_69generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; Py_ssize_t __pyx_t_23; char const *__pyx_t_24; int __pyx_t_25; int __pyx_t_26; char const *__pyx_t_27; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_client", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L33_resume_from_await; case 2: goto __pyx_L44_resume_from_await; case 3: goto __pyx_L56_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4459, __pyx_L1_error) /* "distributed/scheduler.py":4464 * We listen to all future messages from this Comm. * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * assert client is not None * comm.name = "Scheduler->Client" */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4465 * """ * parent: SchedulerState = cast(SchedulerState, self) * assert client is not None # <<<<<<<<<<<<<< * comm.name = "Scheduler->Client" * logger.info("Receive client connection: %s", client) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_cur_scope->__pyx_v_client != Py_None); if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4465, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4466 * parent: SchedulerState = cast(SchedulerState, self) * assert client is not None * comm.name = "Scheduler->Client" # <<<<<<<<<<<<<< * logger.info("Receive client connection: %s", client) * self.log_event(["all", client], {"action": "add-client", "client": client}) */ if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_name, __pyx_kp_u_Scheduler_Client) < 0) __PYX_ERR(0, 4466, __pyx_L1_error) /* "distributed/scheduler.py":4467 * assert client is not None * comm.name = "Scheduler->Client" * logger.info("Receive client connection: %s", client) # <<<<<<<<<<<<<< * self.log_event(["all", client], {"action": "add-client", "client": client}) * parent._clients[client] = ClientState(client, versions=versions) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_Receive_client_connection_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4467, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_Receive_client_connection_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4467, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_kp_u_Receive_client_connection_s); __Pyx_GIVEREF(__pyx_kp_u_Receive_client_connection_s); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_u_Receive_client_connection_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_client); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4468 * comm.name = "Scheduler->Client" * logger.info("Receive client connection: %s", client) * self.log_event(["all", client], {"action": "add-client", "client": client}) # <<<<<<<<<<<<<< * parent._clients[client] = ClientState(client, versions=versions) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_all); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyList_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_v_client); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_action, __pyx_kp_u_add_client_2) < 0) __PYX_ERR(0, 4468, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4468, __pyx_L1_error) __pyx_t_7 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4468, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4468, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_t_3); __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4469 * logger.info("Receive client connection: %s", client) * self.log_event(["all", client], {"action": "add-client", "client": client}) * parent._clients[client] = ClientState(client, versions=versions) # <<<<<<<<<<<<<< * * for plugin in self.plugins[:]: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_client); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_versions, __pyx_cur_scope->__pyx_v_versions) < 0) __PYX_ERR(0, 4469, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11distributed_9scheduler_ClientState), __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4469, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_parent->_clients, __pyx_cur_scope->__pyx_v_client, __pyx_t_8) < 0)) __PYX_ERR(0, 4469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4471 * parent._clients[client] = ClientState(client, versions=versions) * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * plugin.add_client(scheduler=self, client=client) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, NULL, &__pyx_slice__57, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4471, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 4471, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 4471, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4471, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_plugin); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_plugin, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4472 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.add_client(scheduler=self, client=client) * except Exception as e: */ { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "distributed/scheduler.py":4473 * for plugin in self.plugins[:]: * try: * plugin.add_client(scheduler=self, client=client) # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_plugin, __pyx_n_s_add_client); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4473, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4473, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scheduler, __pyx_cur_scope->__pyx_v_self) < 0) __PYX_ERR(0, 4473, __pyx_L6_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4473, __pyx_L6_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4473, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4472 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.add_client(scheduler=self, client=client) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L13_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4474 * try: * plugin.add_client(scheduler=self, client=client) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_5) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_client", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 4474, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_e = __pyx_t_1; /*try:*/ { /* "distributed/scheduler.py":4475 * plugin.add_client(scheduler=self, client=client) * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * * try: */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exception); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); } } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_7, __pyx_cur_scope->__pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "distributed/scheduler.py":4474 * try: * plugin.add_client(scheduler=self, client=client) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; goto __pyx_L20; } __pyx_L19_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_5 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L8_except_error; } __pyx_L20:; } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_exception_handled; } goto __pyx_L8_except_error; __pyx_L8_except_error:; /* "distributed/scheduler.py":4472 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.add_client(scheduler=self, client=client) * except Exception as e: */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L7_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L13_try_end:; } /* "distributed/scheduler.py":4471 * parent._clients[client] = ClientState(client, versions=versions) * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * plugin.add_client(scheduler=self, client=client) */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4477 * logger.exception(e) * * try: # <<<<<<<<<<<<<< * bcomm = BatchedSend(interval="2ms", loop=self.loop) * bcomm.start(comm) */ /*try:*/ { /* "distributed/scheduler.py":4478 * * try: * bcomm = BatchedSend(interval="2ms", loop=self.loop) # <<<<<<<<<<<<<< * bcomm.start(comm) * self.client_comms[client] = bcomm */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BatchedSend); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4478, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4478, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_interval, __pyx_kp_u_2ms) < 0) __PYX_ERR(0, 4478, __pyx_L26_error) __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4478, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_loop, __pyx_t_1) < 0) __PYX_ERR(0, 4478, __pyx_L26_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4478, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_bcomm = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4479 * try: * bcomm = BatchedSend(interval="2ms", loop=self.loop) * bcomm.start(comm) # <<<<<<<<<<<<<< * self.client_comms[client] = bcomm * msg = {"op": "stream-start"} */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_bcomm, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4479, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_cur_scope->__pyx_v_comm) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_comm); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4479, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4480 * bcomm = BatchedSend(interval="2ms", loop=self.loop) * bcomm.start(comm) * self.client_comms[client] = bcomm # <<<<<<<<<<<<<< * msg = {"op": "stream-start"} * ws: WorkerState */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4480, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_client, __pyx_cur_scope->__pyx_v_bcomm) < 0)) __PYX_ERR(0, 4480, __pyx_L26_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4481 * bcomm.start(comm) * self.client_comms[client] = bcomm * msg = {"op": "stream-start"} # <<<<<<<<<<<<<< * ws: WorkerState * version_warning = version_module.error_message( */ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4481, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_op, __pyx_kp_u_stream_start) < 0) __PYX_ERR(0, 4481, __pyx_L26_error) __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4483 * msg = {"op": "stream-start"} * ws: WorkerState * version_warning = version_module.error_message( # <<<<<<<<<<<<<< * version_module.get_versions(), * {w: ws._versions for w, ws in parent._workers_dv.items()}, */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_version_module); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4483, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error_message); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4483, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4484 * ws: WorkerState * version_warning = version_module.error_message( * version_module.get_versions(), # <<<<<<<<<<<<<< * {w: ws._versions for w, ws in parent._workers_dv.items()}, * versions, */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_version_module); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4484, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_versions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4484, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4484, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; { /* enter inner scope */ /* "distributed/scheduler.py":4485 * version_warning = version_module.error_message( * version_module.get_versions(), * {w: ws._versions for w, ws in parent._workers_dv.items()}, # <<<<<<<<<<<<<< * versions, * ) */ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4485, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4485, __pyx_L26_error) } __pyx_t_14 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_23), (&__pyx_t_15)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4485, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_14; __pyx_t_14 = 0; while (1) { __pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_23, &__pyx_t_9, &__pyx_t_14, &__pyx_t_7, NULL, __pyx_t_15); if (unlikely(__pyx_t_5 == 0)) break; if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 4485, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4485, __pyx_L26_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr51__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr51__pyx_v_w, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr51__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr51__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_7)); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_cur_scope->__pyx_9genexpr51__pyx_v_w, (PyObject*)__pyx_cur_scope->__pyx_9genexpr51__pyx_v_ws->_versions))) __PYX_ERR(0, 4485, __pyx_L26_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ /* "distributed/scheduler.py":4486 * version_module.get_versions(), * {w: ws._versions for w, ws in parent._workers_dv.items()}, * versions, # <<<<<<<<<<<<<< * ) * msg.update(version_warning) */ __pyx_t_3 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_4, __pyx_t_6, __pyx_cur_scope->__pyx_v_versions}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_15, 3+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4483, __pyx_L26_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_4, __pyx_t_6, __pyx_cur_scope->__pyx_v_versions}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_15, 3+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4483, __pyx_L26_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_7 = PyTuple_New(3+__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4483, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_15, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_15, __pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_15, __pyx_cur_scope->__pyx_v_versions); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4483, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_version_warning = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4488 * versions, * ) * msg.update(version_warning) # <<<<<<<<<<<<<< * bcomm.send(msg) * */ __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_cur_scope->__pyx_v_msg, __pyx_cur_scope->__pyx_v_version_warning); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4488, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4489 * ) * msg.update(version_warning) * bcomm.send(msg) # <<<<<<<<<<<<<< * * try: */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_bcomm, __pyx_n_s_send); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4489, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_cur_scope->__pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_cur_scope->__pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4489, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4491 * bcomm.send(msg) * * try: # <<<<<<<<<<<<<< * await self.handle_stream(comm=comm, extra={"client": client}) * finally: */ /*try:*/ { /* "distributed/scheduler.py":4492 * * try: * await self.handle_stream(comm=comm, extra={"client": client}) # <<<<<<<<<<<<<< * finally: * self.remove_client(client=client) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_handle_stream); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4492, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_comm, __pyx_cur_scope->__pyx_v_comm) < 0) __PYX_ERR(0, 4492, __pyx_L31_error) __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4492, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4492, __pyx_L31_error) if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_extra, __pyx_t_7) < 0) __PYX_ERR(0, 4492, __pyx_L31_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4492, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L33_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4492, __pyx_L31_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4492, __pyx_L31_error) } } } /* "distributed/scheduler.py":4494 * await self.handle_stream(comm=comm, extra={"client": client}) * finally: * self.remove_client(client=client) # <<<<<<<<<<<<<< * logger.debug("Finished handling client %s", client) * finally: */ /*finally:*/ { /*normal exit:*/{ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4494, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4494, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4494, __pyx_L26_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4494, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4495 * finally: * self.remove_client(client=client) * logger.debug("Finished handling client %s", client) # <<<<<<<<<<<<<< * finally: * if not comm.closed(): */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4495, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_debug); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4495, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_Finished_handling_client_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __pyx_L26_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_Finished_handling_client_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __pyx_L26_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4495, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_kp_u_Finished_handling_client_s); __Pyx_GIVEREF(__pyx_kp_u_Finished_handling_client_s); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_15, __pyx_kp_u_Finished_handling_client_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_15, __pyx_cur_scope->__pyx_v_client); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L32; } __pyx_L31_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_15 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_24 = __pyx_filename; { /* "distributed/scheduler.py":4494 * await self.handle_stream(comm=comm, extra={"client": client}) * finally: * self.remove_client(client=client) # <<<<<<<<<<<<<< * logger.debug("Finished handling client %s", client) * finally: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4494, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4494, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4494, __pyx_L35_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4494, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4495 * finally: * self.remove_client(client=client) * logger.debug("Finished handling client %s", client) # <<<<<<<<<<<<<< * finally: * if not comm.closed(): */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4495, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_25 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_25 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_u_Finished_handling_client_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_25, 2+__pyx_t_25); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4495, __pyx_L35_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_u_Finished_handling_client_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_25, 2+__pyx_t_25); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4495, __pyx_L35_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_25); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4495, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_kp_u_Finished_handling_client_s); __Pyx_GIVEREF(__pyx_kp_u_Finished_handling_client_s); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_25, __pyx_kp_u_Finished_handling_client_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_25, __pyx_cur_scope->__pyx_v_client); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4495, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_12, __pyx_t_11); __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_24; goto __pyx_L26_error; __pyx_L35_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20); } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; goto __pyx_L26_error; } __pyx_L32:; } } /* "distributed/scheduler.py":4497 * logger.debug("Finished handling client %s", client) * finally: * if not comm.closed(): # <<<<<<<<<<<<<< * self.client_comms[client].send({"op": "stream-closed"}) * try: */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_26 = ((!__pyx_t_2) != 0); if (__pyx_t_26) { /* "distributed/scheduler.py":4498 * finally: * if not comm.closed(): * self.client_comms[client].send({"op": "stream-closed"}) # <<<<<<<<<<<<<< * try: * if not shutting_down(): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_client); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_send); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_op, __pyx_kp_u_stream_closed) < 0) __PYX_ERR(0, 4498, __pyx_L1_error) __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4497 * logger.debug("Finished handling client %s", client) * finally: * if not comm.closed(): # <<<<<<<<<<<<<< * self.client_comms[client].send({"op": "stream-closed"}) * try: */ } /* "distributed/scheduler.py":4499 * if not comm.closed(): * self.client_comms[client].send({"op": "stream-closed"}) * try: # <<<<<<<<<<<<<< * if not shutting_down(): * await self.client_comms[client].close() */ { __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); /*try:*/ { /* "distributed/scheduler.py":4500 * self.client_comms[client].send({"op": "stream-closed"}) * try: * if not shutting_down(): # <<<<<<<<<<<<<< * await self.client_comms[client].close() * del self.client_comms[client] */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shutting_down); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4500, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4500, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_26 < 0)) __PYX_ERR(0, 4500, __pyx_L37_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((!__pyx_t_26) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4501 * try: * if not shutting_down(): * await self.client_comms[client].close() # <<<<<<<<<<<<<< * del self.client_comms[client] * if self.status == Status.running: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4501, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_client); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4501, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4501, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4501, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_0 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_1 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_2 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L44_resume_from_await:; __pyx_t_20 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_22); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4501, __pyx_L37_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4501, __pyx_L37_error) } } /* "distributed/scheduler.py":4502 * if not shutting_down(): * await self.client_comms[client].close() * del self.client_comms[client] # <<<<<<<<<<<<<< * if self.status == Status.running: * logger.info("Close client connection: %s", client) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4502, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(PyObject_DelItem(__pyx_t_6, __pyx_cur_scope->__pyx_v_client) < 0)) __PYX_ERR(0, 4502, __pyx_L37_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4503 * await self.client_comms[client].close() * del self.client_comms[client] * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.info("Close client connection: %s", client) * except TypeError: # comm becomes None during GC */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4503, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_running); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4503, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L37_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4503, __pyx_L37_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":4504 * del self.client_comms[client] * if self.status == Status.running: * logger.info("Close client connection: %s", client) # <<<<<<<<<<<<<< * except TypeError: # comm becomes None during GC * pass */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4504, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_info); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4504, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_Close_client_connection_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L37_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_Close_client_connection_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L37_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4504, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_kp_u_Close_client_connection_s); __Pyx_GIVEREF(__pyx_kp_u_Close_client_connection_s); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, __pyx_kp_u_Close_client_connection_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_client); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4503 * await self.client_comms[client].close() * del self.client_comms[client] * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.info("Close client connection: %s", client) * except TypeError: # comm becomes None during GC */ } /* "distributed/scheduler.py":4500 * self.client_comms[client].send({"op": "stream-closed"}) * try: * if not shutting_down(): # <<<<<<<<<<<<<< * await self.client_comms[client].close() * del self.client_comms[client] */ } /* "distributed/scheduler.py":4499 * if not comm.closed(): * self.client_comms[client].send({"op": "stream-closed"}) * try: # <<<<<<<<<<<<<< * if not shutting_down(): * await self.client_comms[client].close() */ } __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; goto __pyx_L42_try_end; __pyx_L37_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4505 * if self.status == Status.running: * logger.info("Close client connection: %s", client) * except TypeError: # comm becomes None during GC # <<<<<<<<<<<<<< * pass * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_5) { __Pyx_ErrRestore(0,0,0); goto __pyx_L38_exception_handled; } goto __pyx_L39_except_error; __pyx_L39_except_error:; /* "distributed/scheduler.py":4499 * if not comm.closed(): * self.client_comms[client].send({"op": "stream-closed"}) * try: # <<<<<<<<<<<<<< * if not shutting_down(): * await self.client_comms[client].close() */ __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); goto __pyx_L1_error; __pyx_L38_exception_handled:; __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); __pyx_L42_try_end:; } goto __pyx_L27; } __pyx_L26_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_27 = __pyx_filename; { /* "distributed/scheduler.py":4497 * logger.debug("Finished handling client %s", client) * finally: * if not comm.closed(): # <<<<<<<<<<<<<< * self.client_comms[client].send({"op": "stream-closed"}) * try: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_closed); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4497, __pyx_L47_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4497, __pyx_L47_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4497, __pyx_L47_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_26 = ((!__pyx_t_2) != 0); if (__pyx_t_26) { /* "distributed/scheduler.py":4498 * finally: * if not comm.closed(): * self.client_comms[client].send({"op": "stream-closed"}) # <<<<<<<<<<<<<< * try: * if not shutting_down(): */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4498, __pyx_L47_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_cur_scope->__pyx_v_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4498, __pyx_L47_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_send); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4498, __pyx_L47_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4498, __pyx_L47_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_op, __pyx_kp_u_stream_closed) < 0) __PYX_ERR(0, 4498, __pyx_L47_error) __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4498, __pyx_L47_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4497 * logger.debug("Finished handling client %s", client) * finally: * if not comm.closed(): # <<<<<<<<<<<<<< * self.client_comms[client].send({"op": "stream-closed"}) * try: */ } /* "distributed/scheduler.py":4499 * if not comm.closed(): * self.client_comms[client].send({"op": "stream-closed"}) * try: # <<<<<<<<<<<<<< * if not shutting_down(): * await self.client_comms[client].close() */ { __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "distributed/scheduler.py":4500 * self.client_comms[client].send({"op": "stream-closed"}) * try: * if not shutting_down(): # <<<<<<<<<<<<<< * await self.client_comms[client].close() * del self.client_comms[client] */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_shutting_down); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4500, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4500, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_26 < 0)) __PYX_ERR(0, 4500, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = ((!__pyx_t_26) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4501 * try: * if not shutting_down(): * await self.client_comms[client].close() # <<<<<<<<<<<<<< * del self.client_comms[client] * if self.status == Status.running: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4501, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_cur_scope->__pyx_v_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4501, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4501, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4501, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __pyx_cur_scope->__pyx_t_3 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_0 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_1 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_2 = __pyx_t_13; __pyx_cur_scope->__pyx_t_4 = __pyx_t_15; __Pyx_XGIVEREF(__pyx_t_17); __pyx_cur_scope->__pyx_t_5 = __pyx_t_17; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_6 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_7 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_8 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_9 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_10 = __pyx_t_22; __pyx_cur_scope->__pyx_t_11 = __pyx_t_27; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L56_resume_from_await:; __pyx_t_5 = __pyx_cur_scope->__pyx_t_3; __pyx_t_11 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_13); __pyx_t_15 = __pyx_cur_scope->__pyx_t_4; __pyx_t_17 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_17); __pyx_t_18 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_27 = __pyx_cur_scope->__pyx_t_11; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4501, __pyx_L49_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4501, __pyx_L49_error) } } /* "distributed/scheduler.py":4502 * if not shutting_down(): * await self.client_comms[client].close() * del self.client_comms[client] # <<<<<<<<<<<<<< * if self.status == Status.running: * logger.info("Close client connection: %s", client) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4502, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_client) < 0)) __PYX_ERR(0, 4502, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4503 * await self.client_comms[client].close() * del self.client_comms[client] * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.info("Close client connection: %s", client) * except TypeError: # comm becomes None during GC */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4503, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_running); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4503, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4503, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4503, __pyx_L49_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":4504 * del self.client_comms[client] * if self.status == Status.running: * logger.info("Close client connection: %s", client) # <<<<<<<<<<<<<< * except TypeError: # comm becomes None during GC * pass */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4504, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_25 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_25 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_u_Close_client_connection_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_25, 2+__pyx_t_25); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4504, __pyx_L49_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_u_Close_client_connection_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_25, 2+__pyx_t_25); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4504, __pyx_L49_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_25); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4504, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_kp_u_Close_client_connection_s); __Pyx_GIVEREF(__pyx_kp_u_Close_client_connection_s); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_25, __pyx_kp_u_Close_client_connection_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_25, __pyx_cur_scope->__pyx_v_client); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4504, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4503 * await self.client_comms[client].close() * del self.client_comms[client] * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.info("Close client connection: %s", client) * except TypeError: # comm becomes None during GC */ } /* "distributed/scheduler.py":4500 * self.client_comms[client].send({"op": "stream-closed"}) * try: * if not shutting_down(): # <<<<<<<<<<<<<< * await self.client_comms[client].close() * del self.client_comms[client] */ } /* "distributed/scheduler.py":4499 * if not comm.closed(): * self.client_comms[client].send({"op": "stream-closed"}) * try: # <<<<<<<<<<<<<< * if not shutting_down(): * await self.client_comms[client].close() */ } __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L54_try_end; __pyx_L49_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4505 * if self.status == Status.running: * logger.info("Close client connection: %s", client) * except TypeError: # comm becomes None during GC # <<<<<<<<<<<<<< * pass * */ __pyx_t_25 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_25) { __Pyx_ErrRestore(0,0,0); goto __pyx_L50_exception_handled; } goto __pyx_L51_except_error; __pyx_L51_except_error:; /* "distributed/scheduler.py":4499 * if not comm.closed(): * self.client_comms[client].send({"op": "stream-closed"}) * try: # <<<<<<<<<<<<<< * if not shutting_down(): * await self.client_comms[client].close() */ __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17); goto __pyx_L47_error; __pyx_L50_exception_handled:; __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17); __pyx_L54_try_end:; } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20); __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_27; goto __pyx_L1_error; __pyx_L47_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L27:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4459 * logger.critical("Tried writing to closed comm: %s", msg) * * async def add_client(self, comm, client=None, versions=None): # <<<<<<<<<<<<<< * """Add client to network * */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("add_client", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4508 * pass * * def remove_client(self, client=None): # <<<<<<<<<<<<<< * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_71remove_client(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_70remove_client[] = " Remove client from network "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_71remove_client = {"remove_client", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_71remove_client, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_70remove_client}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_71remove_client(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_client = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_client (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_client") < 0)) __PYX_ERR(0, 4508, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_client = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_client", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4508, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_client", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_70remove_client(__pyx_self, __pyx_v_self, __pyx_v_client); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4532 * logger.exception(e) * * def remove_client_from_events(): # <<<<<<<<<<<<<< * # If the client isn't registered anymore after the delay, remove from events * if client not in parent._clients and client in self.events: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_13remove_client_1remove_client_from_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_13remove_client_1remove_client_from_events = {"remove_client_from_events", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_13remove_client_1remove_client_from_events, METH_NOARGS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_13remove_client_1remove_client_from_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_client_from_events (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_13remove_client_remove_client_from_events(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_13remove_client_remove_client_from_events(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_client_from_events", 0); __pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "distributed/scheduler.py":4534 * def remove_client_from_events(): * # If the client isn't registered anymore after the delay, remove from events * if client not in parent._clients and client in self.events: # <<<<<<<<<<<<<< * del self.events[client] * */ if (unlikely(!__pyx_cur_scope->__pyx_v_client)) { __Pyx_RaiseClosureNameError("client"); __PYX_ERR(0, 4534, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_v_parent)) { __Pyx_RaiseClosureNameError("parent"); __PYX_ERR(0, 4534, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_parent->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4534, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_client, __pyx_cur_scope->__pyx_v_parent->_clients, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4534, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } if (unlikely(!__pyx_cur_scope->__pyx_v_client)) { __Pyx_RaiseClosureNameError("client"); __PYX_ERR(0, 4534, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4534, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_events); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_client, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "distributed/scheduler.py":4535 * # If the client isn't registered anymore after the delay, remove from events * if client not in parent._clients and client in self.events: * del self.events[client] # <<<<<<<<<<<<<< * * cleanup_delay = parse_timedelta( */ if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4535, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_events); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_v_client)) { __Pyx_RaiseClosureNameError("client"); __PYX_ERR(0, 4535, __pyx_L1_error) } if (unlikely(PyObject_DelItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_client) < 0)) __PYX_ERR(0, 4535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4534 * def remove_client_from_events(): * # If the client isn't registered anymore after the delay, remove from events * if client not in parent._clients and client in self.events: # <<<<<<<<<<<<<< * del self.events[client] * */ } /* "distributed/scheduler.py":4532 * logger.exception(e) * * def remove_client_from_events(): # <<<<<<<<<<<<<< * # If the client isn't registered anymore after the delay, remove from events * if client not in parent._clients and client in self.events: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_client.remove_client_from_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4508 * pass * * def remove_client(self, client=None): # <<<<<<<<<<<<<< * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_70remove_client(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_v_plugin = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_remove_client_from_events = 0; PyObject *__pyx_v_cleanup_delay = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_9genexpr52__pyx_v_ts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; Py_ssize_t __pyx_t_13; int __pyx_t_14; PyObject *(*__pyx_t_15)(PyObject *); PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; char const *__pyx_t_20; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_client", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_22_remove_client(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_22_remove_client, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4508, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_client = __pyx_v_client; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); /* "distributed/scheduler.py":4510 * def remove_client(self, client=None): * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if self.status == Status.running: * logger.info("Remove client %s", client) */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4511 * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.info("Remove client %s", client) * self.log_event(["all", client], {"action": "remove-client", "client": client}) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_running); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "distributed/scheduler.py":4512 * parent: SchedulerState = cast(SchedulerState, self) * if self.status == Status.running: * logger.info("Remove client %s", client) # <<<<<<<<<<<<<< * self.log_event(["all", client], {"action": "remove-client", "client": client}) * try: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_Remove_client_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4512, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_Remove_client_s, __pyx_cur_scope->__pyx_v_client}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4512, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_kp_u_Remove_client_s); __Pyx_GIVEREF(__pyx_kp_u_Remove_client_s); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_u_Remove_client_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_client); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4511 * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.info("Remove client %s", client) * self.log_event(["all", client], {"action": "remove-client", "client": client}) */ } /* "distributed/scheduler.py":4513 * if self.status == Status.running: * logger.info("Remove client %s", client) * self.log_event(["all", client], {"action": "remove-client", "client": client}) # <<<<<<<<<<<<<< * try: * cs: ClientState = parent._clients[client] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_all); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyList_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_v_client); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_action, __pyx_kp_u_remove_client_2) < 0) __PYX_ERR(0, 4513, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4513, __pyx_L1_error) __pyx_t_7 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_3}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4513, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_3}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4513, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_t_3); __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4514 * logger.info("Remove client %s", client) * self.log_event(["all", client], {"action": "remove-client", "client": client}) * try: # <<<<<<<<<<<<<< * cs: ClientState = parent._clients[client] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "distributed/scheduler.py":4515 * self.log_event(["all", client], {"action": "remove-client", "client": client}) * try: * cs: ClientState = parent._clients[client] # <<<<<<<<<<<<<< * except KeyError: * # XXX is this a legitimate condition? */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4515, __pyx_L4_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_clients, __pyx_cur_scope->__pyx_v_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4515, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4515, __pyx_L4_error) __pyx_v_cs = ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4514 * logger.info("Remove client %s", client) * self.log_event(["all", client], {"action": "remove-client", "client": client}) * try: # <<<<<<<<<<<<<< * cs: ClientState = parent._clients[client] * except KeyError: */ } /* "distributed/scheduler.py":4520 * pass * else: * ts: TaskState # <<<<<<<<<<<<<< * self.client_releases_keys( * keys=[ts._key for ts in cs._wants_what], client=cs._client_key */ /*else:*/ { /* "distributed/scheduler.py":4521 * else: * ts: TaskState * self.client_releases_keys( # <<<<<<<<<<<<<< * keys=[ts._key for ts in cs._wants_what], client=cs._client_key * ) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_releases_keys_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4521, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":4522 * ts: TaskState * self.client_releases_keys( * keys=[ts._key for ts in cs._wants_what], client=cs._client_key # <<<<<<<<<<<<<< * ) * del parent._clients[client] */ __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4522, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); { /* enter inner scope */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4522, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_cs->_wants_what, 1, (&__pyx_t_13), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4522, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_14 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_13, &__pyx_t_12, &__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 4522, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4522, __pyx_L12_error) __Pyx_XDECREF_SET(__pyx_9genexpr52__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_9genexpr52__pyx_v_ts->_key))) __PYX_ERR(0, 4522, __pyx_L12_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr52__pyx_v_ts); __pyx_9genexpr52__pyx_v_ts = 0; goto __pyx_L15_exit_scope; __pyx_L12_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr52__pyx_v_ts); __pyx_9genexpr52__pyx_v_ts = 0; goto __pyx_L6_except_error; __pyx_L15_exit_scope:; } /* exit inner scope */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_keys, __pyx_t_8) < 0) __PYX_ERR(0, 4522, __pyx_L6_except_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_client, __pyx_v_cs->_client_key) < 0) __PYX_ERR(0, 4522, __pyx_L6_except_error) /* "distributed/scheduler.py":4521 * else: * ts: TaskState * self.client_releases_keys( # <<<<<<<<<<<<<< * keys=[ts._key for ts in cs._wants_what], client=cs._client_key * ) */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4521, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4524 * keys=[ts._key for ts in cs._wants_what], client=cs._client_key * ) * del parent._clients[client] # <<<<<<<<<<<<<< * * for plugin in self.plugins[:]: */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4524, __pyx_L6_except_error) } if (unlikely(PyDict_DelItem(__pyx_cur_scope->__pyx_v_parent->_clients, __pyx_cur_scope->__pyx_v_client) < 0)) __PYX_ERR(0, 4524, __pyx_L6_except_error) /* "distributed/scheduler.py":4526 * del parent._clients[client] * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * plugin.remove_client(scheduler=self, client=client) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4526, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, NULL, &__pyx_slice__57, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0; __pyx_t_15 = NULL; } else { __pyx_t_13 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4526, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_15 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4526, __pyx_L6_except_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 4526, __pyx_L6_except_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 4526, __pyx_L6_except_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_15(__pyx_t_8); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4526, __pyx_L6_except_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_plugin, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4527 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.remove_client(scheduler=self, client=client) * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); /*try:*/ { /* "distributed/scheduler.py":4528 * for plugin in self.plugins[:]: * try: * plugin.remove_client(scheduler=self, client=client) # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_plugin, __pyx_n_s_remove_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4528, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4528, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_scheduler, __pyx_cur_scope->__pyx_v_self) < 0) __PYX_ERR(0, 4528, __pyx_L18_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4528, __pyx_L18_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4528, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4527 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.remove_client(scheduler=self, client=client) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L25_try_end; __pyx_L18_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4529 * try: * plugin.remove_client(scheduler=self, client=client) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_5) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_client", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 4529, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_v_e = __pyx_t_2; /*try:*/ { /* "distributed/scheduler.py":4530 * plugin.remove_client(scheduler=self, client=client) * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * * def remove_client_from_events(): */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4530, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exception); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4530, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_19, function); } } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_e); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4530, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "distributed/scheduler.py":4529 * try: * plugin.remove_client(scheduler=self, client=client) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; goto __pyx_L32; } __pyx_L31_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __pyx_t_5 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_20 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26); } __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23); __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_20; goto __pyx_L20_except_error; } __pyx_L32:; } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L19_exception_handled; } goto __pyx_L20_except_error; __pyx_L20_except_error:; /* "distributed/scheduler.py":4527 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.remove_client(scheduler=self, client=client) * except Exception as e: */ __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); goto __pyx_L6_except_error; __pyx_L19_exception_handled:; __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_L25_try_end:; } /* "distributed/scheduler.py":4526 * del parent._clients[client] * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * plugin.remove_client(scheduler=self, client=client) */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4516 * try: * cs: ClientState = parent._clients[client] * except KeyError: # <<<<<<<<<<<<<< * # XXX is this a legitimate condition? * pass */ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_14) { __Pyx_ErrRestore(0,0,0); goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "distributed/scheduler.py":4514 * logger.info("Remove client %s", client) * self.log_event(["all", client], {"action": "remove-client", "client": client}) * try: # <<<<<<<<<<<<<< * cs: ClientState = parent._clients[client] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_L9_try_end:; } /* "distributed/scheduler.py":4532 * logger.exception(e) * * def remove_client_from_events(): # <<<<<<<<<<<<<< * # If the client isn't registered anymore after the delay, remove from events * if client not in parent._clients and client in self.events: */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_13remove_client_1remove_client_from_events, 0, __pyx_n_s_Scheduler_remove_client_locals_r, ((PyObject*)__pyx_cur_scope), __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_remove_client_from_events = __pyx_t_8; __pyx_t_8 = 0; /* "distributed/scheduler.py":4537 * del self.events[client] * * cleanup_delay = parse_timedelta( # <<<<<<<<<<<<<< * dask.config.get("distributed.scheduler.events-cleanup-delay") * ) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":4538 * * cleanup_delay = parse_timedelta( * dask.config.get("distributed.scheduler.events-cleanup-delay") # <<<<<<<<<<<<<< * ) * self.loop.call_later(cleanup_delay, remove_client_from_events) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_dask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_kp_u_distributed_scheduler_events_cle) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_distributed_scheduler_events_cle); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cleanup_delay = __pyx_t_8; __pyx_t_8 = 0; /* "distributed/scheduler.py":4540 * dask.config.get("distributed.scheduler.events-cleanup-delay") * ) * self.loop.call_later(cleanup_delay, remove_client_from_events) # <<<<<<<<<<<<<< * * def send_task_to_worker(self, worker, ts: TaskState, duration=None): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_call_later); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_cleanup_delay, __pyx_v_remove_client_from_events}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4540, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_cleanup_delay, __pyx_v_remove_client_from_events}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4540, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_cleanup_delay); __Pyx_GIVEREF(__pyx_v_cleanup_delay); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_14, __pyx_v_cleanup_delay); __Pyx_INCREF(__pyx_v_remove_client_from_events); __Pyx_GIVEREF(__pyx_v_remove_client_from_events); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_14, __pyx_v_remove_client_from_events); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4508 * pass * * def remove_client(self, client=None): # <<<<<<<<<<<<<< * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_19); __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_client", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF(__pyx_v_plugin); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_remove_client_from_events); __Pyx_XDECREF(__pyx_v_cleanup_delay); __Pyx_XDECREF((PyObject *)__pyx_9genexpr52__pyx_v_ts); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4542 * self.loop.call_later(cleanup_delay, remove_client_from_events) * * def send_task_to_worker(self, worker, ts: TaskState, duration=None): # <<<<<<<<<<<<<< * """ Send a single computational task to a worker """ * parent: SchedulerState = cast(SchedulerState, self) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_73send_task_to_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_72send_task_to_worker[] = " Send a single computational task to a worker "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_73send_task_to_worker = {"send_task_to_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_73send_task_to_worker, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_72send_task_to_worker}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_73send_task_to_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_worker = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_duration = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("send_task_to_worker (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker,&__pyx_n_s_ts,&__pyx_n_s_duration,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("send_task_to_worker", 0, 3, 4, 1); __PYX_ERR(0, 4542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("send_task_to_worker", 0, 3, 4, 2); __PYX_ERR(0, 4542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_duration); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "send_task_to_worker") < 0)) __PYX_ERR(0, 4542, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_worker = values[1]; __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[2]); __pyx_v_duration = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("send_task_to_worker", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4542, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.send_task_to_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 4542, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_72send_task_to_worker(__pyx_self, __pyx_v_self, __pyx_v_worker, __pyx_v_ts, __pyx_v_duration); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_72send_task_to_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, PyObject *__pyx_v_duration) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_msg = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; struct __pyx_opt_args_11distributed_9scheduler__task_to_msg __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("send_task_to_worker", 0); /* "distributed/scheduler.py":4544 * def send_task_to_worker(self, worker, ts: TaskState, duration=None): * """ Send a single computational task to a worker """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * try: * msg: dict = _task_to_msg(parent, ts, duration) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4545 * """ Send a single computational task to a worker """ * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * msg: dict = _task_to_msg(parent, ts, duration) * self.worker_send(worker, msg) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":4546 * parent: SchedulerState = cast(SchedulerState, self) * try: * msg: dict = _task_to_msg(parent, ts, duration) # <<<<<<<<<<<<<< * self.worker_send(worker, msg) * except Exception as e: */ __pyx_t_5.__pyx_n = 1; __pyx_t_5.duration = __pyx_v_duration; __pyx_t_1 = __pyx_f_11distributed_9scheduler__task_to_msg(__pyx_v_parent, __pyx_v_ts, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4546, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4547 * try: * msg: dict = _task_to_msg(parent, ts, duration) * self.worker_send(worker, msg) # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_worker_send); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4547, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_worker, __pyx_v_msg}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4547, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_worker, __pyx_v_msg}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4547, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4547, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_worker); __Pyx_GIVEREF(__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_worker); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_msg); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4547, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4545 * """ Send a single computational task to a worker """ * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * msg: dict = _task_to_msg(parent, ts, duration) * self.worker_send(worker, msg) */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":4548 * msg: dict = _task_to_msg(parent, ts, duration) * self.worker_send(worker, msg) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.send_task_to_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4548, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "distributed/scheduler.py":4549 * self.worker_send(worker, msg) * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4549, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4549, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_e); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4549, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4550 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4550, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4550, __pyx_L14_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_12) { /* "distributed/scheduler.py":4551 * logger.exception(e) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_7 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4551, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_pdb = __pyx_t_7; __pyx_t_7 = 0; /* "distributed/scheduler.py":4553 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4553, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4553, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4550 * except Exception as e: * logger.exception(e) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":4554 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def handle_uncaught_error(self, **msg): */ __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_6, __pyx_t_9); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_9 = 0; __PYX_ERR(0, 4554, __pyx_L14_error) } /* "distributed/scheduler.py":4548 * msg: dict = _task_to_msg(parent, ts, duration) * self.worker_send(worker, msg) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * if LOG_PDB: */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":4545 * """ Send a single computational task to a worker """ * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * msg: dict = _task_to_msg(parent, ts, duration) * self.worker_send(worker, msg) */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "distributed/scheduler.py":4542 * self.loop.call_later(cleanup_delay, remove_client_from_events) * * def send_task_to_worker(self, worker, ts: TaskState, duration=None): # <<<<<<<<<<<<<< * """ Send a single computational task to a worker """ * parent: SchedulerState = cast(SchedulerState, self) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.Scheduler.send_task_to_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4556 * raise * * def handle_uncaught_error(self, **msg): # <<<<<<<<<<<<<< * logger.exception(clean_exception(**msg)[1]) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_75handle_uncaught_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_75handle_uncaught_error = {"handle_uncaught_error", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_75handle_uncaught_error, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_75handle_uncaught_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_uncaught_error (wrapper)", 0); __pyx_v_msg = PyDict_New(); if (unlikely(!__pyx_v_msg)) return NULL; __Pyx_GOTREF(__pyx_v_msg); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_msg, values, pos_args, "handle_uncaught_error") < 0)) __PYX_ERR(0, 4556, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("handle_uncaught_error", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4556, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_msg); __pyx_v_msg = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_uncaught_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_74handle_uncaught_error(__pyx_self, __pyx_v_self, __pyx_v_msg); /* function exit code */ __Pyx_XDECREF(__pyx_v_msg); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_74handle_uncaught_error(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_msg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_uncaught_error", 0); /* "distributed/scheduler.py":4557 * * def handle_uncaught_error(self, **msg): * logger.exception(clean_exception(**msg)[1]) # <<<<<<<<<<<<<< * * def handle_task_finished(self, key=None, worker=None, **msg): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_clean_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_v_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4556 * raise * * def handle_uncaught_error(self, **msg): # <<<<<<<<<<<<<< * logger.exception(clean_exception(**msg)[1]) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_uncaught_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4559 * logger.exception(clean_exception(**msg)[1]) * * def handle_task_finished(self, key=None, worker=None, **msg): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_77handle_task_finished(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_77handle_task_finished = {"handle_task_finished", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_77handle_task_finished, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_77handle_task_finished(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_task_finished (wrapper)", 0); __pyx_v_msg = PyDict_New(); if (unlikely(!__pyx_v_msg)) return NULL; __Pyx_GOTREF(__pyx_v_msg); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_worker,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_msg, values, pos_args, "handle_task_finished") < 0)) __PYX_ERR(0, 4559, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_worker = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("handle_task_finished", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4559, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_msg); __pyx_v_msg = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_task_finished", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_76handle_task_finished(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_worker, __pyx_v_msg); /* function exit code */ __Pyx_XDECREF(__pyx_v_msg); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_76handle_task_finished(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, PyObject *__pyx_v_msg) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_task_finished", 0); /* "distributed/scheduler.py":4560 * * def handle_task_finished(self, key=None, worker=None, **msg): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if worker not in parent._workers_dv: * return */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4561 * def handle_task_finished(self, key=None, worker=None, **msg): * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: # <<<<<<<<<<<<<< * return * validate_key(key) */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4561, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_worker, __pyx_v_parent->_workers_dv, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4561, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4562 * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: * return # <<<<<<<<<<<<<< * validate_key(key) * r = self.stimulus_task_finished(key=key, worker=worker, **msg) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":4561 * def handle_task_finished(self, key=None, worker=None, **msg): * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: # <<<<<<<<<<<<<< * return * validate_key(key) */ } /* "distributed/scheduler.py":4563 * if worker not in parent._workers_dv: * return * validate_key(key) # <<<<<<<<<<<<<< * r = self.stimulus_task_finished(key=key, worker=worker, **msg) * self.transitions(r) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_validate_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4564 * return * validate_key(key) * r = self.stimulus_task_finished(key=key, worker=worker, **msg) # <<<<<<<<<<<<<< * self.transitions(r) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stimulus_task_finished); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 4564, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_worker, __pyx_v_worker) < 0) __PYX_ERR(0, 4564, __pyx_L1_error) __pyx_t_4 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_4, __pyx_v_msg) < 0) __PYX_ERR(0, 4564, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_r = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":4565 * validate_key(key) * r = self.stimulus_task_finished(key=key, worker=worker, **msg) * self.transitions(r) # <<<<<<<<<<<<<< * * def handle_task_erred(self, key=None, **msg): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_r) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_r); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4559 * logger.exception(clean_exception(**msg)[1]) * * def handle_task_finished(self, key=None, worker=None, **msg): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_task_finished", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4567 * self.transitions(r) * * def handle_task_erred(self, key=None, **msg): # <<<<<<<<<<<<<< * r = self.stimulus_task_erred(key=key, **msg) * self.transitions(r) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_79handle_task_erred(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_79handle_task_erred = {"handle_task_erred", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_79handle_task_erred, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_79handle_task_erred(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_task_erred (wrapper)", 0); __pyx_v_msg = PyDict_New(); if (unlikely(!__pyx_v_msg)) return NULL; __Pyx_GOTREF(__pyx_v_msg); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_msg, values, pos_args, "handle_task_erred") < 0)) __PYX_ERR(0, 4567, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("handle_task_erred", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4567, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_msg); __pyx_v_msg = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_task_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_78handle_task_erred(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_msg); /* function exit code */ __Pyx_XDECREF(__pyx_v_msg); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_78handle_task_erred(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_msg) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_task_erred", 0); /* "distributed/scheduler.py":4568 * * def handle_task_erred(self, key=None, **msg): * r = self.stimulus_task_erred(key=key, **msg) # <<<<<<<<<<<<<< * self.transitions(r) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stimulus_task_erred); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 4568, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; if (__Pyx_MergeKeywords(__pyx_t_2, __pyx_v_msg) < 0) __PYX_ERR(0, 4568, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":4569 * def handle_task_erred(self, key=None, **msg): * r = self.stimulus_task_erred(key=key, **msg) * self.transitions(r) # <<<<<<<<<<<<<< * * def handle_release_data(self, key=None, worker=None, client=None, **msg): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_r) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_r); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4567 * self.transitions(r) * * def handle_task_erred(self, key=None, **msg): # <<<<<<<<<<<<<< * r = self.stimulus_task_erred(key=key, **msg) * self.transitions(r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_task_erred", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4571 * self.transitions(r) * * def handle_release_data(self, key=None, worker=None, client=None, **msg): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks.get(key) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_81handle_release_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_81handle_release_data = {"handle_release_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_81handle_release_data, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_81handle_release_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_worker = 0; CYTHON_UNUSED PyObject *__pyx_v_client = 0; PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_release_data (wrapper)", 0); __pyx_v_msg = PyDict_New(); if (unlikely(!__pyx_v_msg)) return NULL; __Pyx_GOTREF(__pyx_v_msg); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_worker,&__pyx_n_s_client,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_msg, values, pos_args, "handle_release_data") < 0)) __PYX_ERR(0, 4571, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_worker = values[2]; __pyx_v_client = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("handle_release_data", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4571, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_msg); __pyx_v_msg = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_release_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_80handle_release_data(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_worker, __pyx_v_client, __pyx_v_msg); /* function exit code */ __Pyx_XDECREF(__pyx_v_msg); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_80handle_release_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_client, PyObject *__pyx_v_msg) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_release_data", 0); /* "distributed/scheduler.py":4572 * * def handle_release_data(self, key=None, worker=None, client=None, **msg): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks.get(key) * if ts is None: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4573 * def handle_release_data(self, key=None, worker=None, client=None, **msg): * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is None: * return */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4573, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4573, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4574 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * return * ws: WorkerState = parent._workers_dv[worker] */ __pyx_t_2 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4575 * ts: TaskState = parent._tasks.get(key) * if ts is None: * return # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[worker] * if ts._processing_on != ws: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":4574 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * return * ws: WorkerState = parent._workers_dv[worker] */ } /* "distributed/scheduler.py":4576 * if ts is None: * return * ws: WorkerState = parent._workers_dv[worker] # <<<<<<<<<<<<<< * if ts._processing_on != ws: * return */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4576, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_v_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4576, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4577 * return * ws: WorkerState = parent._workers_dv[worker] * if ts._processing_on != ws: # <<<<<<<<<<<<<< * return * r = self.stimulus_missing_data(key=key, ensure=False, **msg) */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_ts->_processing_on), ((PyObject *)__pyx_v_ws), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4577, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4577, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "distributed/scheduler.py":4578 * ws: WorkerState = parent._workers_dv[worker] * if ts._processing_on != ws: * return # <<<<<<<<<<<<<< * r = self.stimulus_missing_data(key=key, ensure=False, **msg) * self.transitions(r) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":4577 * return * ws: WorkerState = parent._workers_dv[worker] * if ts._processing_on != ws: # <<<<<<<<<<<<<< * return * r = self.stimulus_missing_data(key=key, ensure=False, **msg) */ } /* "distributed/scheduler.py":4579 * if ts._processing_on != ws: * return * r = self.stimulus_missing_data(key=key, ensure=False, **msg) # <<<<<<<<<<<<<< * self.transitions(r) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stimulus_missing_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 4579, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_ensure, Py_False) < 0) __PYX_ERR(0, 4579, __pyx_L1_error) __pyx_t_4 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_4, __pyx_v_msg) < 0) __PYX_ERR(0, 4579, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_r = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":4580 * return * r = self.stimulus_missing_data(key=key, ensure=False, **msg) * self.transitions(r) # <<<<<<<<<<<<<< * * def handle_missing_data(self, key=None, errant_worker=None, **kwargs): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_r) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_r); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4571 * self.transitions(r) * * def handle_release_data(self, key=None, worker=None, client=None, **msg): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks.get(key) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_release_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4582 * self.transitions(r) * * def handle_missing_data(self, key=None, errant_worker=None, **kwargs): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * logger.debug("handle missing data key=%s worker=%s", key, errant_worker) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_83handle_missing_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_83handle_missing_data = {"handle_missing_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_83handle_missing_data, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_83handle_missing_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_errant_worker = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_missing_data (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_errant_worker,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errant_worker); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "handle_missing_data") < 0)) __PYX_ERR(0, 4582, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_errant_worker = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("handle_missing_data", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4582, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_missing_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_82handle_missing_data(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_errant_worker, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_82handle_missing_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_errant_worker, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_missing_data", 0); /* "distributed/scheduler.py":4583 * * def handle_missing_data(self, key=None, errant_worker=None, **kwargs): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * logger.debug("handle missing data key=%s worker=%s", key, errant_worker) * self.log.append(("missing", key, errant_worker)) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4584 * def handle_missing_data(self, key=None, errant_worker=None, **kwargs): * parent: SchedulerState = cast(SchedulerState, self) * logger.debug("handle missing data key=%s worker=%s", key, errant_worker) # <<<<<<<<<<<<<< * self.log.append(("missing", key, errant_worker)) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_handle_missing_data_key_s_worker, __pyx_v_key, __pyx_v_errant_worker}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4584, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_handle_missing_data_key_s_worker, __pyx_v_key, __pyx_v_errant_worker}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4584, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_handle_missing_data_key_s_worker); __Pyx_GIVEREF(__pyx_kp_u_handle_missing_data_key_s_worker); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_u_handle_missing_data_key_s_worker); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_key); __Pyx_INCREF(__pyx_v_errant_worker); __Pyx_GIVEREF(__pyx_v_errant_worker); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_errant_worker); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4585 * parent: SchedulerState = cast(SchedulerState, self) * logger.debug("handle missing data key=%s worker=%s", key, errant_worker) * self.log.append(("missing", key, errant_worker)) # <<<<<<<<<<<<<< * * ts: TaskState = parent._tasks.get(key) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_u_missing); __Pyx_GIVEREF(__pyx_n_u_missing); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_missing); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_key); __Pyx_INCREF(__pyx_v_errant_worker); __Pyx_GIVEREF(__pyx_v_errant_worker); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_errant_worker); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 4585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4587 * self.log.append(("missing", key, errant_worker)) * * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is None or not ts._who_has: * return */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4587, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4587, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4588 * * ts: TaskState = parent._tasks.get(key) * if ts is None or not ts._who_has: # <<<<<<<<<<<<<< * return * if errant_worker in parent._workers_dv: */ __pyx_t_8 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_9 = (__pyx_t_8 != 0); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); __pyx_t_8 = ((!__pyx_t_9) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L4_bool_binop_done:; if (__pyx_t_7) { /* "distributed/scheduler.py":4589 * ts: TaskState = parent._tasks.get(key) * if ts is None or not ts._who_has: * return # <<<<<<<<<<<<<< * if errant_worker in parent._workers_dv: * ws: WorkerState = parent._workers_dv[errant_worker] */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":4588 * * ts: TaskState = parent._tasks.get(key) * if ts is None or not ts._who_has: # <<<<<<<<<<<<<< * return * if errant_worker in parent._workers_dv: */ } /* "distributed/scheduler.py":4590 * if ts is None or not ts._who_has: * return * if errant_worker in parent._workers_dv: # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[errant_worker] * if ws in ts._who_has: */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4590, __pyx_L1_error) } __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_errant_worker, __pyx_v_parent->_workers_dv, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 4590, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":4591 * return * if errant_worker in parent._workers_dv: * ws: WorkerState = parent._workers_dv[errant_worker] # <<<<<<<<<<<<<< * if ws in ts._who_has: * ts._who_has.remove(ws) */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4591, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_v_errant_worker); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4591, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4592 * if errant_worker in parent._workers_dv: * ws: WorkerState = parent._workers_dv[errant_worker] * if ws in ts._who_has: # <<<<<<<<<<<<<< * ts._who_has.remove(ws) * ws._has_what.remove(ts) */ if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4592, __pyx_L1_error) } __pyx_t_8 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ws), __pyx_v_ts->_who_has, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4592, __pyx_L1_error) __pyx_t_7 = (__pyx_t_8 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":4593 * ws: WorkerState = parent._workers_dv[errant_worker] * if ws in ts._who_has: * ts._who_has.remove(ws) # <<<<<<<<<<<<<< * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() */ if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 4593, __pyx_L1_error) } __pyx_t_6 = __Pyx_PySet_Remove(__pyx_v_ts->_who_has, ((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 4593, __pyx_L1_error) /* "distributed/scheduler.py":4594 * if ws in ts._who_has: * ts._who_has.remove(ws) * ws._has_what.remove(ts) # <<<<<<<<<<<<<< * ws._nbytes -= ts.get_nbytes() * if not ts._who_has: */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 4594, __pyx_L1_error) } __pyx_t_6 = __Pyx_PySet_Remove(__pyx_v_ws->_has_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 4594, __pyx_L1_error) /* "distributed/scheduler.py":4595 * ts._who_has.remove(ws) * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() # <<<<<<<<<<<<<< * if not ts._who_has: * if ts._run_spec: */ __pyx_t_10 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4595, __pyx_L1_error) __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes - __pyx_t_10); /* "distributed/scheduler.py":4592 * if errant_worker in parent._workers_dv: * ws: WorkerState = parent._workers_dv[errant_worker] * if ws in ts._who_has: # <<<<<<<<<<<<<< * ts._who_has.remove(ws) * ws._has_what.remove(ts) */ } /* "distributed/scheduler.py":4590 * if ts is None or not ts._who_has: * return * if errant_worker in parent._workers_dv: # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[errant_worker] * if ws in ts._who_has: */ } /* "distributed/scheduler.py":4596 * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() * if not ts._who_has: # <<<<<<<<<<<<<< * if ts._run_spec: * self.transitions({key: "released"}) */ __pyx_t_7 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); __pyx_t_8 = ((!__pyx_t_7) != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":4597 * ws._nbytes -= ts.get_nbytes() * if not ts._who_has: * if ts._run_spec: # <<<<<<<<<<<<<< * self.transitions({key: "released"}) * else: */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4597, __pyx_L1_error) if (__pyx_t_8) { /* "distributed/scheduler.py":4598 * if not ts._who_has: * if ts._run_spec: * self.transitions({key: "released"}) # <<<<<<<<<<<<<< * else: * self.transitions({key: "forgotten"}) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_v_key, __pyx_n_u_released) < 0) __PYX_ERR(0, 4598, __pyx_L1_error) __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4597 * ws._nbytes -= ts.get_nbytes() * if not ts._who_has: * if ts._run_spec: # <<<<<<<<<<<<<< * self.transitions({key: "released"}) * else: */ goto __pyx_L9; } /* "distributed/scheduler.py":4600 * self.transitions({key: "released"}) * else: * self.transitions({key: "forgotten"}) # <<<<<<<<<<<<<< * * def release_worker_data(self, comm=None, keys=None, worker=None): */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_v_key, __pyx_n_u_forgotten) < 0) __PYX_ERR(0, 4600, __pyx_L1_error) __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L9:; /* "distributed/scheduler.py":4596 * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() * if not ts._who_has: # <<<<<<<<<<<<<< * if ts._run_spec: * self.transitions({key: "released"}) */ } /* "distributed/scheduler.py":4582 * self.transitions(r) * * def handle_missing_data(self, key=None, errant_worker=None, **kwargs): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * logger.debug("handle missing data key=%s worker=%s", key, errant_worker) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_missing_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4602 * self.transitions({key: "forgotten"}) * * def release_worker_data(self, comm=None, keys=None, worker=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_85release_worker_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_85release_worker_data = {"release_worker_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_85release_worker_data, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_85release_worker_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_worker = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("release_worker_data (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_worker,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "release_worker_data") < 0)) __PYX_ERR(0, 4602, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_worker = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("release_worker_data", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4602, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.release_worker_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_84release_worker_data(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_worker); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_84release_worker_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_worker) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_tasks = NULL; PyObject *__pyx_v_removed_tasks = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_wh = NULL; PyObject *__pyx_9genexpr53__pyx_v_k = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; int __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("release_worker_data", 0); /* "distributed/scheduler.py":4603 * * def release_worker_data(self, comm=None, keys=None, worker=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[worker] * tasks = {parent._tasks[k] for k in keys} */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4604 * def release_worker_data(self, comm=None, keys=None, worker=None): * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] # <<<<<<<<<<<<<< * tasks = {parent._tasks[k] for k in keys} * removed_tasks = tasks & ws._has_what */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4604, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_v_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4604, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4605 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] * tasks = {parent._tasks[k] for k in keys} # <<<<<<<<<<<<<< * removed_tasks = tasks & ws._has_what * ws._has_what -= removed_tasks */ { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4605, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_2 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4605, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4605, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4605, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4605, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4605, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4605, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4605, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_k, __pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4605, __pyx_L5_error) } __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_9genexpr53__pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4605, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 4605, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_k); __pyx_9genexpr53__pyx_v_k = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_k); __pyx_9genexpr53__pyx_v_k = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_v_tasks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4606 * ws: WorkerState = parent._workers_dv[worker] * tasks = {parent._tasks[k] for k in keys} * removed_tasks = tasks & ws._has_what # <<<<<<<<<<<<<< * ws._has_what -= removed_tasks * */ __pyx_t_1 = PyNumber_And(__pyx_v_tasks, __pyx_v_ws->_has_what); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_removed_tasks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4607 * tasks = {parent._tasks[k] for k in keys} * removed_tasks = tasks & ws._has_what * ws._has_what -= removed_tasks # <<<<<<<<<<<<<< * * ts: TaskState */ __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_ws->_has_what, __pyx_v_removed_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4607, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_ws->_has_what); __Pyx_DECREF(__pyx_v_ws->_has_what); __pyx_v_ws->_has_what = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4610 * * ts: TaskState * recommendations: dict = {} # <<<<<<<<<<<<<< * for ts in removed_tasks: * ws._nbytes -= ts.get_nbytes() */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_recommendations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4611 * ts: TaskState * recommendations: dict = {} * for ts in removed_tasks: # <<<<<<<<<<<<<< * ws._nbytes -= ts.get_nbytes() * wh = ts._who_has */ __pyx_t_3 = 0; __pyx_t_2 = __Pyx_set_iterator(__pyx_v_removed_tasks, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_3, &__pyx_t_2, __pyx_t_7); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 4611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4611, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":4612 * recommendations: dict = {} * for ts in removed_tasks: * ws._nbytes -= ts.get_nbytes() # <<<<<<<<<<<<<< * wh = ts._who_has * wh.remove(ws) */ __pyx_t_9 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4612, __pyx_L1_error) __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes - __pyx_t_9); /* "distributed/scheduler.py":4613 * for ts in removed_tasks: * ws._nbytes -= ts.get_nbytes() * wh = ts._who_has # <<<<<<<<<<<<<< * wh.remove(ws) * if not wh: */ __pyx_t_2 = __pyx_v_ts->_who_has; __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_wh, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":4614 * ws._nbytes -= ts.get_nbytes() * wh = ts._who_has * wh.remove(ws) # <<<<<<<<<<<<<< * if not wh: * recommendations[ts._key] = "released" */ if (unlikely(__pyx_v_wh == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 4614, __pyx_L1_error) } __pyx_t_10 = __Pyx_PySet_Remove(__pyx_v_wh, ((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 4614, __pyx_L1_error) /* "distributed/scheduler.py":4615 * wh = ts._who_has * wh.remove(ws) * if not wh: # <<<<<<<<<<<<<< * recommendations[ts._key] = "released" * if recommendations: */ __pyx_t_11 = (__pyx_v_wh != Py_None)&&(PySet_GET_SIZE(__pyx_v_wh) != 0); __pyx_t_12 = ((!__pyx_t_11) != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":4616 * wh.remove(ws) * if not wh: * recommendations[ts._key] = "released" # <<<<<<<<<<<<<< * if recommendations: * self.transitions(recommendations) */ if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_ts->_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 4616, __pyx_L1_error) /* "distributed/scheduler.py":4615 * wh = ts._who_has * wh.remove(ws) * if not wh: # <<<<<<<<<<<<<< * recommendations[ts._key] = "released" * if recommendations: */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4617 * if not wh: * recommendations[ts._key] = "released" * if recommendations: # <<<<<<<<<<<<<< * self.transitions(recommendations) * */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_recommendations); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4617, __pyx_L1_error) if (__pyx_t_12) { /* "distributed/scheduler.py":4618 * recommendations[ts._key] = "released" * if recommendations: * self.transitions(recommendations) # <<<<<<<<<<<<<< * * def handle_long_running(self, key=None, worker=None, compute_duration=None): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_recommendations) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_recommendations); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4617 * if not wh: * recommendations[ts._key] = "released" * if recommendations: # <<<<<<<<<<<<<< * self.transitions(recommendations) * */ } /* "distributed/scheduler.py":4602 * self.transitions({key: "forgotten"}) * * def release_worker_data(self, comm=None, keys=None, worker=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.release_worker_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_tasks); __Pyx_XDECREF(__pyx_v_removed_tasks); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_wh); __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_k); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4620 * self.transitions(recommendations) * * def handle_long_running(self, key=None, worker=None, compute_duration=None): # <<<<<<<<<<<<<< * """A task has seceded from the thread pool * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_87handle_long_running(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_86handle_long_running[] = "A task has seceded from the thread pool\n\n We stop the task from being stolen in the future, and change task\n duration accounting as if the task has stopped.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_87handle_long_running = {"handle_long_running", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_87handle_long_running, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_86handle_long_running}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_87handle_long_running(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; CYTHON_UNUSED PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_compute_duration = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_long_running (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_worker,&__pyx_n_s_compute_duration,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compute_duration); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_long_running") < 0)) __PYX_ERR(0, 4620, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_worker = values[2]; __pyx_v_compute_duration = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("handle_long_running", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4620, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_long_running", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_86handle_long_running(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_worker, __pyx_v_compute_duration); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_86handle_long_running(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, CYTHON_UNUSED PyObject *__pyx_v_worker, PyObject *__pyx_v_compute_duration) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; double __pyx_v_old_duration; PyObject *__pyx_v_new_duration = NULL; PyObject *__pyx_v_avg_duration = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; double __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_long_running", 0); /* "distributed/scheduler.py":4626 * duration accounting as if the task has stopped. * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks[key] * if "stealing" in self._extensions: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4627 * """ * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] # <<<<<<<<<<<<<< * if "stealing" in self._extensions: * self._extensions["stealing"].remove_key_from_stealable(ts) */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4627, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4627, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4628 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] * if "stealing" in self._extensions: # <<<<<<<<<<<<<< * self._extensions["stealing"].remove_key_from_stealable(ts) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extensions_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_stealing, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4629 * ts: TaskState = parent._tasks[key] * if "stealing" in self._extensions: * self._extensions["stealing"].remove_key_from_stealable(ts) # <<<<<<<<<<<<<< * * ws: WorkerState = ts._processing_on */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extensions_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_u_stealing); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_remove_key_from_stealable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4628 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] * if "stealing" in self._extensions: # <<<<<<<<<<<<<< * self._extensions["stealing"].remove_key_from_stealable(ts) * */ } /* "distributed/scheduler.py":4631 * self._extensions["stealing"].remove_key_from_stealable(ts) * * ws: WorkerState = ts._processing_on # <<<<<<<<<<<<<< * if ws is None: * logger.debug("Received long-running signal from duplicate task. Ignoring.") */ __pyx_t_1 = ((PyObject *)__pyx_v_ts->_processing_on); __Pyx_INCREF(__pyx_t_1); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4632 * * ws: WorkerState = ts._processing_on * if ws is None: # <<<<<<<<<<<<<< * logger.debug("Received long-running signal from duplicate task. Ignoring.") * return */ __pyx_t_3 = (((PyObject *)__pyx_v_ws) == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4633 * ws: WorkerState = ts._processing_on * if ws is None: * logger.debug("Received long-running signal from duplicate task. Ignoring.") # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_debug); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_kp_u_Received_long_running_signal_fro) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_Received_long_running_signal_fro); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4634 * if ws is None: * logger.debug("Received long-running signal from duplicate task. Ignoring.") * return # <<<<<<<<<<<<<< * * if compute_duration: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":4632 * * ws: WorkerState = ts._processing_on * if ws is None: # <<<<<<<<<<<<<< * logger.debug("Received long-running signal from duplicate task. Ignoring.") * return */ } /* "distributed/scheduler.py":4636 * return * * if compute_duration: # <<<<<<<<<<<<<< * old_duration = ts._prefix._duration_average * new_duration = compute_duration */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compute_duration); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4636, __pyx_L1_error) if (__pyx_t_2) { /* "distributed/scheduler.py":4637 * * if compute_duration: * old_duration = ts._prefix._duration_average # <<<<<<<<<<<<<< * new_duration = compute_duration * if old_duration < 0: */ __pyx_t_6 = __pyx_v_ts->_prefix->_duration_average; __pyx_v_old_duration = __pyx_t_6; /* "distributed/scheduler.py":4638 * if compute_duration: * old_duration = ts._prefix._duration_average * new_duration = compute_duration # <<<<<<<<<<<<<< * if old_duration < 0: * avg_duration = new_duration */ __Pyx_INCREF(__pyx_v_compute_duration); __pyx_v_new_duration = __pyx_v_compute_duration; /* "distributed/scheduler.py":4639 * old_duration = ts._prefix._duration_average * new_duration = compute_duration * if old_duration < 0: # <<<<<<<<<<<<<< * avg_duration = new_duration * else: */ __pyx_t_2 = ((__pyx_v_old_duration < 0.0) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4640 * new_duration = compute_duration * if old_duration < 0: * avg_duration = new_duration # <<<<<<<<<<<<<< * else: * avg_duration = 0.5 * old_duration + 0.5 * new_duration */ __Pyx_INCREF(__pyx_v_new_duration); __pyx_v_avg_duration = __pyx_v_new_duration; /* "distributed/scheduler.py":4639 * old_duration = ts._prefix._duration_average * new_duration = compute_duration * if old_duration < 0: # <<<<<<<<<<<<<< * avg_duration = new_duration * else: */ goto __pyx_L6; } /* "distributed/scheduler.py":4642 * avg_duration = new_duration * else: * avg_duration = 0.5 * old_duration + 0.5 * new_duration # <<<<<<<<<<<<<< * * ts._prefix._duration_average = avg_duration */ /*else*/ { __pyx_t_1 = PyFloat_FromDouble((0.5 * __pyx_v_old_duration)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_new_duration); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_avg_duration = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L6:; /* "distributed/scheduler.py":4644 * avg_duration = 0.5 * old_duration + 0.5 * new_duration * * ts._prefix._duration_average = avg_duration # <<<<<<<<<<<<<< * * ws._occupancy -= ws._processing[ts] */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_avg_duration); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4644, __pyx_L1_error) __pyx_v_ts->_prefix->_duration_average = __pyx_t_6; /* "distributed/scheduler.py":4636 * return * * if compute_duration: # <<<<<<<<<<<<<< * old_duration = ts._prefix._duration_average * new_duration = compute_duration */ } /* "distributed/scheduler.py":4646 * ts._prefix._duration_average = avg_duration * * ws._occupancy -= ws._processing[ts] # <<<<<<<<<<<<<< * parent._total_occupancy -= ws._processing[ts] * ws._processing[ts] = 0 */ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_ws->_occupancy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4646, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ws->_processing, ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ws->_occupancy = __pyx_t_6; /* "distributed/scheduler.py":4647 * * ws._occupancy -= ws._processing[ts] * parent._total_occupancy -= ws._processing[ts] # <<<<<<<<<<<<<< * ws._processing[ts] = 0 * self.check_idle_saturated(ws) */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_parent->_total_occupancy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4647, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ws->_processing, ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_parent->_total_occupancy = __pyx_t_6; /* "distributed/scheduler.py":4648 * ws._occupancy -= ws._processing[ts] * parent._total_occupancy -= ws._processing[ts] * ws._processing[ts] = 0 # <<<<<<<<<<<<<< * self.check_idle_saturated(ws) * */ if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4648, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_ws->_processing, ((PyObject *)__pyx_v_ts), __pyx_int_0) < 0)) __PYX_ERR(0, 4648, __pyx_L1_error) /* "distributed/scheduler.py":4649 * parent._total_occupancy -= ws._processing[ts] * ws._processing[ts] = 0 * self.check_idle_saturated(ws) # <<<<<<<<<<<<<< * * async def handle_worker(self, comm=None, worker=None): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_idle_saturated); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, ((PyObject *)__pyx_v_ws)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_ws)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4620 * self.transitions(recommendations) * * def handle_long_running(self, key=None, worker=None, compute_duration=None): # <<<<<<<<<<<<<< * """A task has seceded from the thread pool * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_long_running", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_new_duration); __Pyx_XDECREF(__pyx_v_avg_duration); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_90generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4651 * self.check_idle_saturated(ws) * * async def handle_worker(self, comm=None, worker=None): # <<<<<<<<<<<<<< * """ * Listen to responses from a single worker */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_89handle_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_88handle_worker[] = "\n Listen to responses from a single worker\n\n This is the main loop for scheduler-worker interaction\n\n See Also\n --------\n Scheduler.handle_client: Equivalent coroutine for clients\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_89handle_worker = {"handle_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_89handle_worker, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_88handle_worker}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_89handle_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_worker = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_worker (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_worker,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_worker") < 0)) __PYX_ERR(0, 4651, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_worker = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("handle_worker", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4651, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_88handle_worker(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_worker); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_88handle_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_worker) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_worker", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_23_handle_worker(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_23_handle_worker, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4651, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_worker = __pyx_v_worker; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_90generator7, __pyx_codeobj__65, (PyObject *) __pyx_cur_scope, __pyx_n_s_handle_worker, __pyx_n_s_Scheduler_handle_worker, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4651, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.handle_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_90generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_worker", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L7_resume_from_await; case 2: goto __pyx_L9_resume_from_await; case 3: goto __pyx_L13_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4651, __pyx_L1_error) /* "distributed/scheduler.py":4661 * Scheduler.handle_client: Equivalent coroutine for clients * """ * comm.name = "Scheduler connection to worker" # <<<<<<<<<<<<<< * worker_comm = self.stream_comms[worker] * worker_comm.start(comm) */ if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_name, __pyx_kp_u_Scheduler_connection_to_worker) < 0) __PYX_ERR(0, 4661, __pyx_L1_error) /* "distributed/scheduler.py":4662 * """ * comm.name = "Scheduler connection to worker" * worker_comm = self.stream_comms[worker] # <<<<<<<<<<<<<< * worker_comm.start(comm) * logger.info("Starting worker compute stream, %s", worker) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_worker_comm = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":4663 * comm.name = "Scheduler connection to worker" * worker_comm = self.stream_comms[worker] * worker_comm.start(comm) # <<<<<<<<<<<<<< * logger.info("Starting worker compute stream, %s", worker) * try: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_worker_comm, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_cur_scope->__pyx_v_comm) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_comm); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4664 * worker_comm = self.stream_comms[worker] * worker_comm.start(comm) * logger.info("Starting worker compute stream, %s", worker) # <<<<<<<<<<<<<< * try: * await self.handle_stream(comm=comm, extra={"worker": worker}) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Starting_worker_compute_stream_s, __pyx_cur_scope->__pyx_v_worker}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4664, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Starting_worker_compute_stream_s, __pyx_cur_scope->__pyx_v_worker}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4664, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Starting_worker_compute_stream_s); __Pyx_GIVEREF(__pyx_kp_u_Starting_worker_compute_stream_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_u_Starting_worker_compute_stream_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_worker); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4665 * worker_comm.start(comm) * logger.info("Starting worker compute stream, %s", worker) * try: # <<<<<<<<<<<<<< * await self.handle_stream(comm=comm, extra={"worker": worker}) * finally: */ /*try:*/ { /* "distributed/scheduler.py":4666 * logger.info("Starting worker compute stream, %s", worker) * try: * await self.handle_stream(comm=comm, extra={"worker": worker}) # <<<<<<<<<<<<<< * finally: * if worker in self.stream_comms: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_handle_stream); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4666, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4666, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_comm, __pyx_cur_scope->__pyx_v_comm) < 0) __PYX_ERR(0, 4666, __pyx_L5_error) __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4666, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_worker, __pyx_cur_scope->__pyx_v_worker) < 0) __PYX_ERR(0, 4666, __pyx_L5_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extra, __pyx_t_5) < 0) __PYX_ERR(0, 4666, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4666, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4666, __pyx_L5_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4666, __pyx_L5_error) } } } /* "distributed/scheduler.py":4668 * await self.handle_stream(comm=comm, extra={"worker": worker}) * finally: * if worker in self.stream_comms: # <<<<<<<<<<<<<< * worker_comm.abort() * await self.remove_worker(address=worker) */ /*finally:*/ { /*normal exit:*/{ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_worker, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":4669 * finally: * if worker in self.stream_comms: * worker_comm.abort() # <<<<<<<<<<<<<< * await self.remove_worker(address=worker) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_worker_comm, __pyx_n_s_abort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4670 * if worker in self.stream_comms: * worker_comm.abort() * await self.remove_worker(address=worker) # <<<<<<<<<<<<<< * * def add_plugin(self, plugin=None, idempotent=False, **kwargs): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_address, __pyx_cur_scope->__pyx_v_worker) < 0) __PYX_ERR(0, 4670, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L9_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4670, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4670, __pyx_L1_error) } } /* "distributed/scheduler.py":4668 * await self.handle_stream(comm=comm, extra={"worker": worker}) * finally: * if worker in self.stream_comms: # <<<<<<<<<<<<<< * worker_comm.abort() * await self.remove_worker(address=worker) */ } goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_4 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4668, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_worker, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 4668, __pyx_L11_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":4669 * finally: * if worker in self.stream_comms: * worker_comm.abort() # <<<<<<<<<<<<<< * await self.remove_worker(address=worker) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_worker_comm, __pyx_n_s_abort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4669, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4669, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4670 * if worker in self.stream_comms: * worker_comm.abort() * await self.remove_worker(address=worker) # <<<<<<<<<<<<<< * * def add_plugin(self, plugin=None, idempotent=False, **kwargs): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4670, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4670, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_address, __pyx_cur_scope->__pyx_v_worker) < 0) __PYX_ERR(0, 4670, __pyx_L11_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4670, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_4 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_5 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_6 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_t_14); __pyx_cur_scope->__pyx_t_7 = __pyx_t_14; __Pyx_XGIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_t_8 = __pyx_t_15; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L13_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_13); __pyx_t_14 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_14); __pyx_t_15 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4670, __pyx_L11_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4670, __pyx_L11_error) } } /* "distributed/scheduler.py":4668 * await self.handle_stream(comm=comm, extra={"worker": worker}) * finally: * if worker in self.stream_comms: # <<<<<<<<<<<<<< * worker_comm.abort() * await self.remove_worker(address=worker) */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; __pyx_L11_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; goto __pyx_L1_error; } __pyx_L6:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4651 * self.check_idle_saturated(ws) * * async def handle_worker(self, comm=None, worker=None): # <<<<<<<<<<<<<< * """ * Listen to responses from a single worker */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("handle_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4672 * await self.remove_worker(address=worker) * * def add_plugin(self, plugin=None, idempotent=False, **kwargs): # <<<<<<<<<<<<<< * """ * Add external plugin to scheduler */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_92add_plugin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_91add_plugin[] = "\n Add external plugin to scheduler\n\n See https://distributed.readthedocs.io/en/latest/plugins.html\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_92add_plugin = {"add_plugin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_92add_plugin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_91add_plugin}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_92add_plugin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_plugin = 0; PyObject *__pyx_v_idempotent = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_plugin (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_plugin,&__pyx_n_s_idempotent,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_False)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_plugin); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idempotent); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "add_plugin") < 0)) __PYX_ERR(0, 4672, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_plugin = values[1]; __pyx_v_idempotent = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_plugin", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4672, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_plugin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_91add_plugin(__pyx_self, __pyx_v_self, __pyx_v_plugin, __pyx_v_idempotent, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_10add_plugin_2generator33(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4681 * plugin = plugin(self, **kwargs) * * if idempotent and any(isinstance(p, type(plugin)) for p in self.plugins): # <<<<<<<<<<<<<< * return * */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_10add_plugin_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_25_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_25_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4681, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_10add_plugin_2generator33, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_add_plugin_locals_gene, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4681, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_plugin.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_10add_plugin_2generator33(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4681, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4681, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4681, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4681, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4681, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4681, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_plugin)) { __Pyx_RaiseClosureNameError("plugin"); __PYX_ERR(0, 4681, __pyx_L1_error) } __pyx_t_5 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_p, ((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_plugin))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 4681, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; } } /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4672 * await self.remove_worker(address=worker) * * def add_plugin(self, plugin=None, idempotent=False, **kwargs): # <<<<<<<<<<<<<< * """ * Add external plugin to scheduler */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_91add_plugin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_plugin, PyObject *__pyx_v_idempotent, PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_plugin", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_24_add_plugin(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_24_add_plugin, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4672, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_plugin = __pyx_v_plugin; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_plugin); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_plugin); /* "distributed/scheduler.py":4678 * See https://distributed.readthedocs.io/en/latest/plugins.html * """ * if isinstance(plugin, type): # <<<<<<<<<<<<<< * plugin = plugin(self, **kwargs) * */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_plugin; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyType_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4679 * """ * if isinstance(plugin, type): * plugin = plugin(self, **kwargs) # <<<<<<<<<<<<<< * * if idempotent and any(isinstance(p, type(plugin)) for p in self.plugins): */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_self); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_plugin, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_plugin); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_plugin, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4678 * See https://distributed.readthedocs.io/en/latest/plugins.html * """ * if isinstance(plugin, type): # <<<<<<<<<<<<<< * plugin = plugin(self, **kwargs) * */ } /* "distributed/scheduler.py":4681 * plugin = plugin(self, **kwargs) * * if idempotent and any(isinstance(p, type(plugin)) for p in self.plugins): # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_idempotent); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4681, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = __pyx_pf_11distributed_9scheduler_9Scheduler_10add_plugin_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4681, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "distributed/scheduler.py":4682 * * if idempotent and any(isinstance(p, type(plugin)) for p in self.plugins): * return # <<<<<<<<<<<<<< * * self.plugins.append(plugin) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":4681 * plugin = plugin(self, **kwargs) * * if idempotent and any(isinstance(p, type(plugin)) for p in self.plugins): # <<<<<<<<<<<<<< * return * */ } /* "distributed/scheduler.py":4684 * return * * self.plugins.append(plugin) # <<<<<<<<<<<<<< * * def remove_plugin(self, plugin): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_cur_scope->__pyx_v_plugin); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 4684, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4672 * await self.remove_worker(address=worker) * * def add_plugin(self, plugin=None, idempotent=False, **kwargs): # <<<<<<<<<<<<<< * """ * Add external plugin to scheduler */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_plugin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4686 * self.plugins.append(plugin) * * def remove_plugin(self, plugin): # <<<<<<<<<<<<<< * """ Remove external plugin from scheduler """ * self.plugins.remove(plugin) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_94remove_plugin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_93remove_plugin[] = " Remove external plugin from scheduler "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_94remove_plugin = {"remove_plugin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_94remove_plugin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_93remove_plugin}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_94remove_plugin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_plugin = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_plugin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_plugin,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_plugin)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("remove_plugin", 1, 2, 2, 1); __PYX_ERR(0, 4686, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_plugin") < 0)) __PYX_ERR(0, 4686, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_plugin = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_plugin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4686, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_plugin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_93remove_plugin(__pyx_self, __pyx_v_self, __pyx_v_plugin); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_93remove_plugin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_plugin) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_plugin", 0); /* "distributed/scheduler.py":4688 * def remove_plugin(self, plugin): * """ Remove external plugin from scheduler """ * self.plugins.remove(plugin) # <<<<<<<<<<<<<< * * def worker_send(self, worker, msg): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_plugin) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_plugin); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4686 * self.plugins.append(plugin) * * def remove_plugin(self, plugin): # <<<<<<<<<<<<<< * """ Remove external plugin from scheduler """ * self.plugins.remove(plugin) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_plugin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4690 * self.plugins.remove(plugin) * * def worker_send(self, worker, msg): # <<<<<<<<<<<<<< * """Send message to worker * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_96worker_send(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_95worker_send[] = "Send message to worker\n\n This also handles connection failures by adding a callback to remove\n the worker on the next cycle.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_96worker_send = {"worker_send", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_96worker_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_95worker_send}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_96worker_send(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("worker_send (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker,&__pyx_n_s_msg,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("worker_send", 1, 3, 3, 1); __PYX_ERR(0, 4690, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("worker_send", 1, 3, 3, 2); __PYX_ERR(0, 4690, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "worker_send") < 0)) __PYX_ERR(0, 4690, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_worker = values[1]; __pyx_v_msg = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("worker_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4690, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.worker_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_95worker_send(__pyx_self, __pyx_v_self, __pyx_v_worker, __pyx_v_msg); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_95worker_send(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, PyObject *__pyx_v_msg) { PyObject *__pyx_v_stream_comms = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("worker_send", 0); /* "distributed/scheduler.py":4696 * the worker on the next cycle. * """ * stream_comms: dict = self.stream_comms # <<<<<<<<<<<<<< * try: * stream_comms[worker].send(msg) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4696, __pyx_L1_error) __pyx_v_stream_comms = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4697 * """ * stream_comms: dict = self.stream_comms * try: # <<<<<<<<<<<<<< * stream_comms[worker].send(msg) * except (CommClosedError, AttributeError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":4698 * stream_comms: dict = self.stream_comms * try: * stream_comms[worker].send(msg) # <<<<<<<<<<<<<< * except (CommClosedError, AttributeError): * self.loop.add_callback(self.remove_worker, address=worker) */ if (unlikely(__pyx_v_stream_comms == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4698, __pyx_L3_error) } __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_stream_comms, __pyx_v_worker); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4698, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_send); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4698, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4698, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4697 * """ * stream_comms: dict = self.stream_comms * try: # <<<<<<<<<<<<<< * stream_comms[worker].send(msg) * except (CommClosedError, AttributeError): */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4699 * try: * stream_comms[worker].send(msg) * except (CommClosedError, AttributeError): # <<<<<<<<<<<<<< * self.loop.add_callback(self.remove_worker, address=worker) * */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4699, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7) || __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_builtin_AttributeError); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.worker_send", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(0, 4699, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":4700 * stream_comms[worker].send(msg) * except (CommClosedError, AttributeError): * self.loop.add_callback(self.remove_worker, address=worker) # <<<<<<<<<<<<<< * * def client_send(self, client, msg): */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4700, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_add_callback); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4700, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4700, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4700, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4700, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_address, __pyx_v_worker) < 0) __PYX_ERR(0, 4700, __pyx_L5_except_error) __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4700, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":4697 * """ * stream_comms: dict = self.stream_comms * try: # <<<<<<<<<<<<<< * stream_comms[worker].send(msg) * except (CommClosedError, AttributeError): */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); __pyx_L8_try_end:; } /* "distributed/scheduler.py":4690 * self.plugins.remove(plugin) * * def worker_send(self, worker, msg): # <<<<<<<<<<<<<< * """Send message to worker * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.Scheduler.worker_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_stream_comms); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4702 * self.loop.add_callback(self.remove_worker, address=worker) * * def client_send(self, client, msg): # <<<<<<<<<<<<<< * """Send message to client""" * client_comms: dict = self.client_comms */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_98client_send(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_97client_send[] = "Send message to client"; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_98client_send = {"client_send", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_98client_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_97client_send}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_98client_send(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_client = 0; PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("client_send (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,&__pyx_n_s_msg,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("client_send", 1, 3, 3, 1); __PYX_ERR(0, 4702, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("client_send", 1, 3, 3, 2); __PYX_ERR(0, 4702, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "client_send") < 0)) __PYX_ERR(0, 4702, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_client = values[1]; __pyx_v_msg = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("client_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4702, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_97client_send(__pyx_self, __pyx_v_self, __pyx_v_client, __pyx_v_msg); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_97client_send(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_msg) { PyObject *__pyx_v_client_comms = 0; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("client_send", 0); /* "distributed/scheduler.py":4704 * def client_send(self, client, msg): * """Send message to client""" * client_comms: dict = self.client_comms # <<<<<<<<<<<<<< * c = client_comms.get(client) * if c is None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4704, __pyx_L1_error) __pyx_v_client_comms = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4705 * """Send message to client""" * client_comms: dict = self.client_comms * c = client_comms.get(client) # <<<<<<<<<<<<<< * if c is None: * return */ if (unlikely(__pyx_v_client_comms == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4705, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_client_comms, __pyx_v_client, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4706 * client_comms: dict = self.client_comms * c = client_comms.get(client) * if c is None: # <<<<<<<<<<<<<< * return * try: */ __pyx_t_2 = (__pyx_v_c == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4707 * c = client_comms.get(client) * if c is None: * return # <<<<<<<<<<<<<< * try: * c.send(msg) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":4706 * client_comms: dict = self.client_comms * c = client_comms.get(client) * if c is None: # <<<<<<<<<<<<<< * return * try: */ } /* "distributed/scheduler.py":4708 * if c is None: * return * try: # <<<<<<<<<<<<<< * c.send(msg) * except CommClosedError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "distributed/scheduler.py":4709 * return * try: * c.send(msg) # <<<<<<<<<<<<<< * except CommClosedError: * if self.status == Status.running: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_send); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4709, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4709, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4708 * if c is None: * return * try: # <<<<<<<<<<<<<< * c.send(msg) * except CommClosedError: */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":4710 * try: * c.send(msg) * except CommClosedError: # <<<<<<<<<<<<<< * if self.status == Status.running: * logger.critical("Tried writing to closed comm: %s", msg) */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4710, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ErrRestore(__pyx_t_1, __pyx_t_7, __pyx_t_8); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_send", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(0, 4710, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":4711 * c.send(msg) * except CommClosedError: * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.critical("Tried writing to closed comm: %s", msg) * */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4711, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Status); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4711, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_running); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4711, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyObject_RichCompare(__pyx_t_9, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4711, __pyx_L6_except_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4711, __pyx_L6_except_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_3) { /* "distributed/scheduler.py":4712 * except CommClosedError: * if self.status == Status.running: * logger.critical("Tried writing to closed comm: %s", msg) # <<<<<<<<<<<<<< * * def send_all(self, client_msgs: dict, worker_msgs: dict): */ __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4712, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_critical); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4712, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_kp_u_Tried_writing_to_closed_comm_s, __pyx_v_msg}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4712, __pyx_L6_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_kp_u_Tried_writing_to_closed_comm_s, __pyx_v_msg}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4712, __pyx_L6_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4712, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; } __Pyx_INCREF(__pyx_kp_u_Tried_writing_to_closed_comm_s); __Pyx_GIVEREF(__pyx_kp_u_Tried_writing_to_closed_comm_s); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_10, __pyx_kp_u_Tried_writing_to_closed_comm_s); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_10, __pyx_v_msg); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4712, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4711 * c.send(msg) * except CommClosedError: * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.critical("Tried writing to closed comm: %s", msg) * */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "distributed/scheduler.py":4708 * if c is None: * return * try: # <<<<<<<<<<<<<< * c.send(msg) * except CommClosedError: */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L9_try_end:; } /* "distributed/scheduler.py":4702 * self.loop.add_callback(self.remove_worker, address=worker) * * def client_send(self, client, msg): # <<<<<<<<<<<<<< * """Send message to client""" * client_comms: dict = self.client_comms */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("distributed.scheduler.Scheduler.client_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_client_comms); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4714 * logger.critical("Tried writing to closed comm: %s", msg) * * def send_all(self, client_msgs: dict, worker_msgs: dict): # <<<<<<<<<<<<<< * """Send messages to client and workers""" * stream_comms: dict = self.stream_comms */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_100send_all(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_99send_all[] = "Send messages to client and workers"; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_100send_all = {"send_all", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_100send_all, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_99send_all}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_100send_all(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_worker_msgs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("send_all (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client_msgs,&__pyx_n_s_worker_msgs,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client_msgs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("send_all", 1, 3, 3, 1); __PYX_ERR(0, 4714, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker_msgs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("send_all", 1, 3, 3, 2); __PYX_ERR(0, 4714, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "send_all") < 0)) __PYX_ERR(0, 4714, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_client_msgs = ((PyObject*)values[1]); __pyx_v_worker_msgs = ((PyObject*)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("send_all", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4714, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.send_all", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client_msgs), (&PyDict_Type), 1, "client_msgs", 1))) __PYX_ERR(0, 4714, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_worker_msgs), (&PyDict_Type), 1, "worker_msgs", 1))) __PYX_ERR(0, 4714, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_99send_all(__pyx_self, __pyx_v_self, __pyx_v_client_msgs, __pyx_v_worker_msgs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_99send_all(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client_msgs, PyObject *__pyx_v_worker_msgs) { PyObject *__pyx_v_stream_comms = 0; PyObject *__pyx_v_client_comms = 0; PyObject *__pyx_v_msgs = 0; PyObject *__pyx_v_worker = NULL; PyObject *__pyx_v_w = NULL; PyObject *__pyx_v_client = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("send_all", 0); /* "distributed/scheduler.py":4716 * def send_all(self, client_msgs: dict, worker_msgs: dict): * """Send messages to client and workers""" * stream_comms: dict = self.stream_comms # <<<<<<<<<<<<<< * client_comms: dict = self.client_comms * msgs: list */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stream_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4716, __pyx_L1_error) __pyx_v_stream_comms = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4717 * """Send messages to client and workers""" * stream_comms: dict = self.stream_comms * client_comms: dict = self.client_comms # <<<<<<<<<<<<<< * msgs: list * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_comms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4717, __pyx_L1_error) __pyx_v_client_comms = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4720 * msgs: list * * for worker, msgs in worker_msgs.items(): # <<<<<<<<<<<<<< * try: * w = stream_comms[worker] */ __pyx_t_2 = 0; if (unlikely(__pyx_v_worker_msgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4720, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_worker_msgs, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 4720, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_worker, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_msgs, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":4721 * * for worker, msgs in worker_msgs.items(): * try: # <<<<<<<<<<<<<< * w = stream_comms[worker] * w.send(*msgs) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "distributed/scheduler.py":4722 * for worker, msgs in worker_msgs.items(): * try: * w = stream_comms[worker] # <<<<<<<<<<<<<< * w.send(*msgs) * except (CommClosedError, AttributeError): */ if (unlikely(__pyx_v_stream_comms == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4722, __pyx_L5_error) } __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_stream_comms, __pyx_v_worker); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4722, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4723 * try: * w = stream_comms[worker] * w.send(*msgs) # <<<<<<<<<<<<<< * except (CommClosedError, AttributeError): * self.loop.add_callback(self.remove_worker, address=worker) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_w, __pyx_n_s_send); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4723, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_Tuple(__pyx_v_msgs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4723, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4723, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4721 * * for worker, msgs in worker_msgs.items(): * try: # <<<<<<<<<<<<<< * w = stream_comms[worker] * w.send(*msgs) */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L12_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4724 * w = stream_comms[worker] * w.send(*msgs) * except (CommClosedError, AttributeError): # <<<<<<<<<<<<<< * self.loop.add_callback(self.remove_worker, address=worker) * */ __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_5, &__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4724, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_11, __pyx_t_12) || __Pyx_PyErr_GivenExceptionMatches(__pyx_t_11, __pyx_builtin_AttributeError); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_ErrRestore(__pyx_t_11, __pyx_t_5, __pyx_t_6); __pyx_t_11 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; if (__pyx_t_7) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.send_all", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_11) < 0) __PYX_ERR(0, 4724, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_11); /* "distributed/scheduler.py":4725 * w.send(*msgs) * except (CommClosedError, AttributeError): * self.loop.add_callback(self.remove_worker, address=worker) # <<<<<<<<<<<<<< * * for client, msgs in client_msgs.items(): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4725, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_add_callback); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4725, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4725, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4725, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4725, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_address, __pyx_v_worker) < 0) __PYX_ERR(0, 4725, __pyx_L7_except_error) __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, __pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4725, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L6_exception_handled; } goto __pyx_L7_except_error; __pyx_L7_except_error:; /* "distributed/scheduler.py":4721 * * for worker, msgs in worker_msgs.items(): * try: # <<<<<<<<<<<<<< * w = stream_comms[worker] * w.send(*msgs) */ __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L12_try_end:; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4727 * self.loop.add_callback(self.remove_worker, address=worker) * * for client, msgs in client_msgs.items(): # <<<<<<<<<<<<<< * c = client_comms.get(client) * if c is None: */ __pyx_t_3 = 0; if (unlikely(__pyx_v_client_msgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4727, __pyx_L1_error) } __pyx_t_11 = __Pyx_dict_iterator(__pyx_v_client_msgs, 1, __pyx_n_s_items, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_3, &__pyx_t_11, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_5); if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 4727, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_client, __pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_msgs, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":4728 * * for client, msgs in client_msgs.items(): * c = client_comms.get(client) # <<<<<<<<<<<<<< * if c is None: * continue */ if (unlikely(__pyx_v_client_comms == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4728, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_client_comms, __pyx_v_client, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4729 * for client, msgs in client_msgs.items(): * c = client_comms.get(client) * if c is None: # <<<<<<<<<<<<<< * continue * try: */ __pyx_t_16 = (__pyx_v_c == Py_None); __pyx_t_17 = (__pyx_t_16 != 0); if (__pyx_t_17) { /* "distributed/scheduler.py":4730 * c = client_comms.get(client) * if c is None: * continue # <<<<<<<<<<<<<< * try: * c.send(*msgs) */ goto __pyx_L15_continue; /* "distributed/scheduler.py":4729 * for client, msgs in client_msgs.items(): * c = client_comms.get(client) * if c is None: # <<<<<<<<<<<<<< * continue * try: */ } /* "distributed/scheduler.py":4731 * if c is None: * continue * try: # <<<<<<<<<<<<<< * c.send(*msgs) * except CommClosedError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":4732 * continue * try: * c.send(*msgs) # <<<<<<<<<<<<<< * except CommClosedError: * if self.status == Status.running: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_send); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4732, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PySequence_Tuple(__pyx_v_msgs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4732, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4732, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4731 * if c is None: * continue * try: # <<<<<<<<<<<<<< * c.send(*msgs) * except CommClosedError: */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L25_try_end; __pyx_L18_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":4733 * try: * c.send(*msgs) * except CommClosedError: # <<<<<<<<<<<<<< * if self.status == Status.running: * logger.critical("Tried writing to closed comm: %s", msgs) */ __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_11, &__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4733, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_7 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_6, __pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_ErrRestore(__pyx_t_6, __pyx_t_11, __pyx_t_5); __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_5 = 0; if (__pyx_t_7) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.send_all", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_11, &__pyx_t_6) < 0) __PYX_ERR(0, 4733, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_6); /* "distributed/scheduler.py":4734 * c.send(*msgs) * except CommClosedError: * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.critical("Tried writing to closed comm: %s", msgs) * */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4734, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Status); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4734, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_running); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4734, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyObject_RichCompare(__pyx_t_15, __pyx_t_14, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4734, __pyx_L20_except_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 4734, __pyx_L20_except_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_17) { /* "distributed/scheduler.py":4735 * except CommClosedError: * if self.status == Status.running: * logger.critical("Tried writing to closed comm: %s", msgs) # <<<<<<<<<<<<<< * * ############################ */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4735, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_critical); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4735, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_kp_u_Tried_writing_to_closed_comm_s, __pyx_v_msgs}; __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4735, __pyx_L20_except_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_12); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_kp_u_Tried_writing_to_closed_comm_s, __pyx_v_msgs}; __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4735, __pyx_L20_except_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_12); } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4735, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_kp_u_Tried_writing_to_closed_comm_s); __Pyx_GIVEREF(__pyx_kp_u_Tried_writing_to_closed_comm_s); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_kp_u_Tried_writing_to_closed_comm_s); __Pyx_INCREF(__pyx_v_msgs); __Pyx_GIVEREF(__pyx_v_msgs); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_msgs); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4735, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4734 * c.send(*msgs) * except CommClosedError: * if self.status == Status.running: # <<<<<<<<<<<<<< * logger.critical("Tried writing to closed comm: %s", msgs) * */ } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L19_exception_handled; } goto __pyx_L20_except_error; __pyx_L20_except_error:; /* "distributed/scheduler.py":4731 * if c is None: * continue * try: # <<<<<<<<<<<<<< * c.send(*msgs) * except CommClosedError: */ __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); goto __pyx_L1_error; __pyx_L19_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); __pyx_L25_try_end:; } __pyx_L15_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4714 * logger.critical("Tried writing to closed comm: %s", msg) * * def send_all(self, client_msgs: dict, worker_msgs: dict): # <<<<<<<<<<<<<< * """Send messages to client and workers""" * stream_comms: dict = self.stream_comms */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("distributed.scheduler.Scheduler.send_all", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_stream_comms); __Pyx_XDECREF(__pyx_v_client_comms); __Pyx_XDECREF(__pyx_v_msgs); __Pyx_XDECREF(__pyx_v_worker); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_client); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_103generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4741 * ############################ * * async def scatter( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_102scatter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_101scatter[] = "Send data out to workers\n\n See also\n --------\n Scheduler.broadcast:\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_102scatter = {"scatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_102scatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_101scatter}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_102scatter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_data = 0; PyObject *__pyx_v_workers = 0; PyObject *__pyx_v_client = 0; PyObject *__pyx_v_broadcast = 0; PyObject *__pyx_v_timeout = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_data,&__pyx_n_s_workers,&__pyx_n_s_client,&__pyx_n_s_broadcast,&__pyx_n_s_timeout,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; /* "distributed/scheduler.py":4743 * async def scatter( * self, * comm=None, # <<<<<<<<<<<<<< * data=None, * workers=None, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":4744 * self, * comm=None, * data=None, # <<<<<<<<<<<<<< * workers=None, * client=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":4745 * comm=None, * data=None, * workers=None, # <<<<<<<<<<<<<< * client=None, * broadcast=False, */ values[3] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":4746 * data=None, * workers=None, * client=None, # <<<<<<<<<<<<<< * broadcast=False, * timeout=2, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":4747 * workers=None, * client=None, * broadcast=False, # <<<<<<<<<<<<<< * timeout=2, * ): */ values[5] = ((PyObject *)((PyObject *)Py_False)); values[6] = ((PyObject *)((PyObject *)__pyx_int_2)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_broadcast); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatter") < 0)) __PYX_ERR(0, 4741, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_data = values[2]; __pyx_v_workers = values[3]; __pyx_v_client = values[4]; __pyx_v_broadcast = values[5]; __pyx_v_timeout = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatter", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4741, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_101scatter(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_data, __pyx_v_workers, __pyx_v_client, __pyx_v_broadcast, __pyx_v_timeout); /* "distributed/scheduler.py":4741 * ############################ * * async def scatter( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_101scatter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_data, PyObject *__pyx_v_workers, PyObject *__pyx_v_client, PyObject *__pyx_v_broadcast, PyObject *__pyx_v_timeout) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatter", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_26_scatter(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_26_scatter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4741, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_data = __pyx_v_data; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data); __pyx_cur_scope->__pyx_v_workers = __pyx_v_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); __pyx_cur_scope->__pyx_v_client = __pyx_v_client; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); __pyx_cur_scope->__pyx_v_broadcast = __pyx_v_broadcast; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_broadcast); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_broadcast); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_103generator8, __pyx_codeobj__66, (PyObject *) __pyx_cur_scope, __pyx_n_s_scatter, __pyx_n_s_Scheduler_scatter, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4741, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_103generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *(*__pyx_t_13)(PyObject *); PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatter", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_await; case 2: goto __pyx_L15_resume_from_await; case 3: goto __pyx_L20_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4741, __pyx_L1_error) /* "distributed/scheduler.py":4756 * Scheduler.broadcast: * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * start = time() * while not parent._workers_dv: */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4757 * """ * parent: SchedulerState = cast(SchedulerState, self) * start = time() # <<<<<<<<<<<<<< * while not parent._workers_dv: * await asyncio.sleep(0.2) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_start = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4758 * parent: SchedulerState = cast(SchedulerState, self) * start = time() * while not parent._workers_dv: # <<<<<<<<<<<<<< * await asyncio.sleep(0.2) * if time() > start + timeout: */ while (1) { __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_parent->_workers_dv); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4758, __pyx_L1_error) __pyx_t_5 = ((!__pyx_t_4) != 0); if (!__pyx_t_5) break; /* "distributed/scheduler.py":4759 * start = time() * while not parent._workers_dv: * await asyncio.sleep(0.2) # <<<<<<<<<<<<<< * if time() > start + timeout: * raise TimeoutError("No workers found") */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sleep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_float_0_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_float_0_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4759, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4759, __pyx_L1_error) } } /* "distributed/scheduler.py":4760 * while not parent._workers_dv: * await asyncio.sleep(0.2) * if time() > start + timeout: # <<<<<<<<<<<<<< * raise TimeoutError("No workers found") * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_start, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4760, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4760, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_5)) { /* "distributed/scheduler.py":4761 * await asyncio.sleep(0.2) * if time() > start + timeout: * raise TimeoutError("No workers found") # <<<<<<<<<<<<<< * * if workers is None: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_kp_u_No_workers_found) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_No_workers_found); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 4761, __pyx_L1_error) /* "distributed/scheduler.py":4760 * while not parent._workers_dv: * await asyncio.sleep(0.2) * if time() > start + timeout: # <<<<<<<<<<<<<< * raise TimeoutError("No workers found") * */ } } /* "distributed/scheduler.py":4763 * raise TimeoutError("No workers found") * * if workers is None: # <<<<<<<<<<<<<< * ws: WorkerState * nthreads = {w: ws._nthreads for w, ws in parent._workers_dv.items()} */ __pyx_t_5 = (__pyx_cur_scope->__pyx_v_workers == Py_None); __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { /* "distributed/scheduler.py":4765 * if workers is None: * ws: WorkerState * nthreads = {w: ws._nthreads for w, ws in parent._workers_dv.items()} # <<<<<<<<<<<<<< * else: * workers = [self.coerce_address(w) for w in workers] */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4765, __pyx_L1_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_7, &__pyx_t_6, &__pyx_t_1, &__pyx_t_9, NULL, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 4765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4765, __pyx_L1_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr55__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr55__pyx_v_w, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr55__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr55__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_9)); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_9genexpr55__pyx_v_ws->_nthreads); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_cur_scope->__pyx_9genexpr55__pyx_v_w, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 4765, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_nthreads = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4763 * raise TimeoutError("No workers found") * * if workers is None: # <<<<<<<<<<<<<< * ws: WorkerState * nthreads = {w: ws._nthreads for w, ws in parent._workers_dv.items()} */ goto __pyx_L8; } /* "distributed/scheduler.py":4767 * nthreads = {w: ws._nthreads for w, ws in parent._workers_dv.items()} * else: * workers = [self.coerce_address(w) for w in workers] # <<<<<<<<<<<<<< * nthreads = {w: parent._workers_dv[w].nthreads for w in workers} * */ /*else*/ { { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_11 = NULL; } else { __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4767, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 4767, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 4767, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4767, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr56__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr56__pyx_v_w, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_9 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_12, __pyx_cur_scope->__pyx_9genexpr56__pyx_v_w) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_9genexpr56__pyx_v_w); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 4767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4768 * else: * workers = [self.coerce_address(w) for w in workers] * nthreads = {w: parent._workers_dv[w].nthreads for w in workers} # <<<<<<<<<<<<<< * * assert isinstance(data, dict) */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_11 = NULL; } else { __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4768, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 4768, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 4768, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4768, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr57__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr57__pyx_v_w, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4768, __pyx_L1_error) } __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_workers_dv, __pyx_cur_scope->__pyx_9genexpr57__pyx_v_w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_nthreads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_cur_scope->__pyx_9genexpr57__pyx_v_w, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 4768, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_nthreads = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L8:; /* "distributed/scheduler.py":4770 * nthreads = {w: parent._workers_dv[w].nthreads for w in workers} * * assert isinstance(data, dict) # <<<<<<<<<<<<<< * * keys, who_has, nbytes = await scatter_to_workers( */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = PyDict_Check(__pyx_cur_scope->__pyx_v_data); if (unlikely(!(__pyx_t_4 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 4770, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":4772 * assert isinstance(data, dict) * * keys, who_has, nbytes = await scatter_to_workers( # <<<<<<<<<<<<<< * nthreads, data, rpc=self.rpc, report=False * ) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_scatter_to_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":4773 * * keys, who_has, nbytes = await scatter_to_workers( * nthreads, data, rpc=self.rpc, report=False # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nthreads); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nthreads); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_nthreads); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_data); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rpc, __pyx_t_9) < 0) __PYX_ERR(0, 4773, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_report, Py_False) < 0) __PYX_ERR(0, 4773, __pyx_L1_error) /* "distributed/scheduler.py":4772 * assert isinstance(data, dict) * * keys, who_has, nbytes = await scatter_to_workers( # <<<<<<<<<<<<<< * nthreads, data, rpc=self.rpc, report=False * ) */ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L15_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4772, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 4772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) { PyObject* sequence = __pyx_t_9; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 4772, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_2 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 4772, __pyx_L1_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 4772, __pyx_L1_error) __pyx_L17_unpacking_done:; } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_keys = __pyx_t_1; __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_who_has = __pyx_t_3; __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_nbytes = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":4776 * ) * * self.update_data(who_has=who_has, nbytes=nbytes, client=client) # <<<<<<<<<<<<<< * * if broadcast: */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_update_data_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_who_has, __pyx_cur_scope->__pyx_v_who_has) < 0) __PYX_ERR(0, 4776, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nbytes, __pyx_cur_scope->__pyx_v_nbytes) < 0) __PYX_ERR(0, 4776, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4776, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4778 * self.update_data(who_has=who_has, nbytes=nbytes, client=client) * * if broadcast: # <<<<<<<<<<<<<< * if broadcast == True: # noqa: E712 * n = len(nthreads) */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_broadcast); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4778, __pyx_L1_error) if (__pyx_t_4) { /* "distributed/scheduler.py":4779 * * if broadcast: * if broadcast == True: # noqa: E712 # <<<<<<<<<<<<<< * n = len(nthreads) * else: */ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_broadcast, Py_True, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4779, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "distributed/scheduler.py":4780 * if broadcast: * if broadcast == True: # noqa: E712 * n = len(nthreads) # <<<<<<<<<<<<<< * else: * n = broadcast */ __pyx_t_7 = PyDict_Size(__pyx_cur_scope->__pyx_v_nthreads); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4780, __pyx_L1_error) __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_n = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":4779 * * if broadcast: * if broadcast == True: # noqa: E712 # <<<<<<<<<<<<<< * n = len(nthreads) * else: */ goto __pyx_L19; } /* "distributed/scheduler.py":4782 * n = len(nthreads) * else: * n = broadcast # <<<<<<<<<<<<<< * await self.replicate(keys=keys, workers=workers, n=n) * */ /*else*/ { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_broadcast); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_broadcast); __pyx_cur_scope->__pyx_v_n = __pyx_cur_scope->__pyx_v_broadcast; } __pyx_L19:; /* "distributed/scheduler.py":4783 * else: * n = broadcast * await self.replicate(keys=keys, workers=workers, n=n) # <<<<<<<<<<<<<< * * self.log_event( */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_replicate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_keys, __pyx_cur_scope->__pyx_v_keys) < 0) __PYX_ERR(0, 4783, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_workers, __pyx_cur_scope->__pyx_v_workers) < 0) __PYX_ERR(0, 4783, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_n, __pyx_cur_scope->__pyx_v_n) < 0) __PYX_ERR(0, 4783, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L20_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4783, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4783, __pyx_L1_error) } } /* "distributed/scheduler.py":4778 * self.update_data(who_has=who_has, nbytes=nbytes, client=client) * * if broadcast: # <<<<<<<<<<<<<< * if broadcast == True: # noqa: E712 * n = len(nthreads) */ } /* "distributed/scheduler.py":4785 * await self.replicate(keys=keys, workers=workers, n=n) * * self.log_event( # <<<<<<<<<<<<<< * [client, "all"], {"action": "scatter", "client": client, "count": len(data)} * ) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":4786 * * self.log_event( * [client, "all"], {"action": "scatter", "client": client, "count": len(data)} # <<<<<<<<<<<<<< * ) * return keys */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_client); __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_all); __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_action, __pyx_n_u_scatter) < 0) __PYX_ERR(0, 4786, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4786, __pyx_L1_error) __pyx_t_7 = PyObject_Length(__pyx_cur_scope->__pyx_v_data); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4786, __pyx_L1_error) __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_count, __pyx_t_12) < 0) __PYX_ERR(0, 4786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_3, __pyx_t_1}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4785, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_3, __pyx_t_1}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4785, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_8, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_8, __pyx_t_1); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":4788 * [client, "all"], {"action": "scatter", "client": client, "count": len(data)} * ) * return keys # <<<<<<<<<<<<<< * * async def gather(self, comm=None, keys=None, serializers=None): */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_keys); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4741 * ############################ * * async def scatter( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_106generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4790 * return keys * * async def gather(self, comm=None, keys=None, serializers=None): # <<<<<<<<<<<<<< * """ Collect data in from workers """ * parent: SchedulerState = cast(SchedulerState, self) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_105gather(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_104gather[] = " Collect data in from workers "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_105gather = {"gather", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_105gather, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_104gather}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_105gather(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_serializers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gather (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_serializers,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serializers); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gather") < 0)) __PYX_ERR(0, 4790, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_serializers = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gather", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4790, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_104gather(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_serializers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_104gather(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_serializers) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gather", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_27_gather(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_27_gather, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4790, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_keys = __pyx_v_keys; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys); __pyx_cur_scope->__pyx_v_serializers = __pyx_v_serializers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_serializers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_serializers); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_106generator9, __pyx_codeobj__67, (PyObject *) __pyx_cur_scope, __pyx_n_s_gather, __pyx_n_s_Scheduler_gather, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4790, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_106generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *(*__pyx_t_14)(PyObject *); PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_t_21; int __pyx_t_22; Py_ssize_t __pyx_t_23; PyObject *__pyx_t_24 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gather", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L9_resume_from_await; case 2: goto __pyx_L27_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4790, __pyx_L1_error) /* "distributed/scheduler.py":4792 * async def gather(self, comm=None, keys=None, serializers=None): * """ Collect data in from workers """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * keys = list(keys) */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4794 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState * keys = list(keys) # <<<<<<<<<<<<<< * who_has = {} * for key in keys: */ __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_keys, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4795 * ws: WorkerState * keys = list(keys) * who_has = {} # <<<<<<<<<<<<<< * for key in keys: * ts: TaskState = parent._tasks.get(key) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_who_has = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4796 * keys = list(keys) * who_has = {} * for key in keys: # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks.get(key) * if ts is not None: */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4796, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4796, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4796, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4796, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4797 * who_has = {} * for key in keys: * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is not None: * who_has[key] = [ws._address for ws in ts._who_has] */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4797, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_cur_scope->__pyx_v_key, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4797, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4798 * for key in keys: * ts: TaskState = parent._tasks.get(key) * if ts is not None: # <<<<<<<<<<<<<< * who_has[key] = [ws._address for ws in ts._who_has] * else: */ __pyx_t_5 = (((PyObject *)__pyx_cur_scope->__pyx_v_ts) != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":4799 * ts: TaskState = parent._tasks.get(key) * if ts is not None: * who_has[key] = [ws._address for ws in ts._who_has] # <<<<<<<<<<<<<< * else: * who_has[key] = [] */ { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_ts->_who_has, 1, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_7, __pyx_t_9, &__pyx_t_8, &__pyx_t_11, __pyx_t_10); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 4799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4799, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr58__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr58__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_11)); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_cur_scope->__pyx_9genexpr58__pyx_v_ws->_address))) __PYX_ERR(0, 4799, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_who_has, __pyx_cur_scope->__pyx_v_key, __pyx_t_4) < 0)) __PYX_ERR(0, 4799, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4798 * for key in keys: * ts: TaskState = parent._tasks.get(key) * if ts is not None: # <<<<<<<<<<<<<< * who_has[key] = [ws._address for ws in ts._who_has] * else: */ goto __pyx_L6; } /* "distributed/scheduler.py":4801 * who_has[key] = [ws._address for ws in ts._who_has] * else: * who_has[key] = [] # <<<<<<<<<<<<<< * * data, missing_keys, missing_workers = await gather_from_workers( */ /*else*/ { __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_who_has, __pyx_cur_scope->__pyx_v_key, __pyx_t_4) < 0)) __PYX_ERR(0, 4801, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L6:; /* "distributed/scheduler.py":4796 * keys = list(keys) * who_has = {} * for key in keys: # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks.get(key) * if ts is not None: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4803 * who_has[key] = [] * * data, missing_keys, missing_workers = await gather_from_workers( # <<<<<<<<<<<<<< * who_has, rpc=self.rpc, close=False, serializers=serializers * ) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_gather_from_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":4804 * * data, missing_keys, missing_workers = await gather_from_workers( * who_has, rpc=self.rpc, close=False, serializers=serializers # <<<<<<<<<<<<<< * ) * if not missing_keys: */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_who_has); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_who_has); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_who_has); __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_rpc, __pyx_t_11) < 0) __PYX_ERR(0, 4804, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_close, Py_False) < 0) __PYX_ERR(0, 4804, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_serializers, __pyx_cur_scope->__pyx_v_serializers) < 0) __PYX_ERR(0, 4804, __pyx_L1_error) /* "distributed/scheduler.py":4803 * who_has[key] = [] * * data, missing_keys, missing_workers = await gather_from_workers( # <<<<<<<<<<<<<< * who_has, rpc=self.rpc, close=False, serializers=serializers * ) */ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L9_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4803, __pyx_L1_error) __pyx_t_11 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_11); } else { __pyx_t_11 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_11) < 0) __PYX_ERR(0, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { PyObject* sequence = __pyx_t_11; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 4803, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_1 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 4803, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 4803, __pyx_L1_error) __pyx_L11_unpacking_done:; } __Pyx_GIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_v_data = __pyx_t_7; __pyx_t_7 = 0; __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_missing_keys = __pyx_t_4; __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_missing_workers = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4806 * who_has, rpc=self.rpc, close=False, serializers=serializers * ) * if not missing_keys: # <<<<<<<<<<<<<< * result = {"status": "OK", "data": data} * else: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_missing_keys); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4806, __pyx_L1_error) __pyx_t_5 = ((!__pyx_t_6) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":4807 * ) * if not missing_keys: * result = {"status": "OK", "data": data} # <<<<<<<<<<<<<< * else: * missing_states = [ */ __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_status, __pyx_n_u_OK) < 0) __PYX_ERR(0, 4807, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_data, __pyx_cur_scope->__pyx_v_data) < 0) __PYX_ERR(0, 4807, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_v_result = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4806 * who_has, rpc=self.rpc, close=False, serializers=serializers * ) * if not missing_keys: # <<<<<<<<<<<<<< * result = {"status": "OK", "data": data} * else: */ goto __pyx_L12; } /* "distributed/scheduler.py":4809 * result = {"status": "OK", "data": data} * else: * missing_states = [ # <<<<<<<<<<<<<< * (parent._tasks[key].state if key in parent._tasks else None) * for key in missing_keys */ /*else*/ { { /* enter inner scope */ __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); /* "distributed/scheduler.py":4811 * missing_states = [ * (parent._tasks[key].state if key in parent._tasks else None) * for key in missing_keys # <<<<<<<<<<<<<< * ] * logger.exception( */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_missing_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_missing_keys)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_missing_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_missing_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4811, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4811, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4811, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4811, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr59__pyx_v_key); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr59__pyx_v_key, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4810 * else: * missing_states = [ * (parent._tasks[key].state if key in parent._tasks else None) # <<<<<<<<<<<<<< * for key in missing_keys * ] */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4810, __pyx_L1_error) } __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_9genexpr59__pyx_v_key, __pyx_cur_scope->__pyx_v_parent->_tasks, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4810, __pyx_L1_error) if ((__pyx_t_5 != 0)) { if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4810, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_cur_scope->__pyx_9genexpr59__pyx_v_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_state); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __pyx_t_13; __pyx_t_13 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_4 = Py_None; } if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4811 * missing_states = [ * (parent._tasks[key].state if key in parent._tasks else None) * for key in missing_keys # <<<<<<<<<<<<<< * ] * logger.exception( */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_v_missing_states = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4813 * for key in missing_keys * ] * logger.exception( # <<<<<<<<<<<<<< * "Couldn't gather keys %s state: %s workers: %s", * missing_keys, */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4817 * missing_keys, * missing_states, * missing_workers, # <<<<<<<<<<<<<< * ) * result = {"status": "error", "keys": missing_keys} */ __pyx_t_1 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_kp_u_Couldn_t_gather_keys_s_state_s_w, __pyx_cur_scope->__pyx_v_missing_keys, __pyx_cur_scope->__pyx_v_missing_states, __pyx_cur_scope->__pyx_v_missing_workers}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4813, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_kp_u_Couldn_t_gather_keys_s_state_s_w, __pyx_cur_scope->__pyx_v_missing_keys, __pyx_cur_scope->__pyx_v_missing_states, __pyx_cur_scope->__pyx_v_missing_workers}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4813, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif { __pyx_t_13 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Couldn_t_gather_keys_s_state_s_w); __Pyx_GIVEREF(__pyx_kp_u_Couldn_t_gather_keys_s_state_s_w); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_10, __pyx_kp_u_Couldn_t_gather_keys_s_state_s_w); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_missing_keys); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_missing_keys); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_10, __pyx_cur_scope->__pyx_v_missing_keys); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_missing_states); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_missing_states); PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_10, __pyx_cur_scope->__pyx_v_missing_states); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_missing_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_missing_workers); PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_10, __pyx_cur_scope->__pyx_v_missing_workers); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4819 * missing_workers, * ) * result = {"status": "error", "keys": missing_keys} # <<<<<<<<<<<<<< * with log_errors(): * # Remove suspicious workers from the scheduler but allow them to */ __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_status, __pyx_n_u_error) < 0) __PYX_ERR(0, 4819, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_keys, __pyx_cur_scope->__pyx_v_missing_keys) < 0) __PYX_ERR(0, 4819, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_v_result = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4820 * ) * result = {"status": "error", "keys": missing_keys} * with log_errors(): # <<<<<<<<<<<<<< * # Remove suspicious workers from the scheduler but allow them to * # reconnect. */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_11, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_13 = __Pyx_PyObject_LookupSpecial(__pyx_t_11, __pyx_n_s_enter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4820, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_13); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4820, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); /*try:*/ { /* "distributed/scheduler.py":4823 * # Remove suspicious workers from the scheduler but allow them to * # reconnect. * await asyncio.gather( # <<<<<<<<<<<<<< * *[ * self.remove_worker(address=worker, close=False) */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4823, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_gather); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4823, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; { /* enter inner scope */ /* "distributed/scheduler.py":4824 * # reconnect. * await asyncio.gather( * *[ # <<<<<<<<<<<<<< * self.remove_worker(address=worker, close=False) * for worker in missing_workers */ __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4824, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); /* "distributed/scheduler.py":4826 * *[ * self.remove_worker(address=worker, close=False) * for worker in missing_workers # <<<<<<<<<<<<<< * ] * ) */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_missing_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_missing_workers)) { __pyx_t_13 = __pyx_cur_scope->__pyx_v_missing_workers; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_missing_workers); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4826, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4826, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_13))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4826, __pyx_L19_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4826, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_13)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4826, __pyx_L19_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4826, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_3(__pyx_t_13); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4826, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr60__pyx_v_worker); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr60__pyx_v_worker, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4825 * await asyncio.gather( * *[ * self.remove_worker(address=worker, close=False) # <<<<<<<<<<<<<< * for worker in missing_workers * ] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4825, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4825, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_address, __pyx_cur_scope->__pyx_9genexpr60__pyx_v_worker) < 0) __PYX_ERR(0, 4825, __pyx_L19_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_close, Py_False) < 0) __PYX_ERR(0, 4825, __pyx_L19_error) __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4825, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_19))) __PYX_ERR(0, 4824, __pyx_L19_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; /* "distributed/scheduler.py":4826 * *[ * self.remove_worker(address=worker, close=False) * for worker in missing_workers # <<<<<<<<<<<<<< * ] * ) */ } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } /* exit inner scope */ /* "distributed/scheduler.py":4823 * # Remove suspicious workers from the scheduler but allow them to * # reconnect. * await asyncio.gather( # <<<<<<<<<<<<<< * *[ * self.remove_worker(address=worker, close=False) */ __pyx_t_13 = PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4823, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4823, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_t_0 = __pyx_t_15; __Pyx_XGIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_t_1 = __pyx_t_16; __Pyx_XGIVEREF(__pyx_t_17); __pyx_cur_scope->__pyx_t_2 = __pyx_t_17; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_3 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L27_resume_from_await:; __pyx_t_15 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_15); __pyx_t_16 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_16); __pyx_t_17 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_17); __pyx_t_18 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4823, __pyx_L19_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4823, __pyx_L19_error) } } /* "distributed/scheduler.py":4829 * ] * ) * for key, workers in missing_keys.items(): # <<<<<<<<<<<<<< * # Task may already be gone if it was held by a * # `missing_worker` */ __pyx_t_2 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_missing_keys == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4829, __pyx_L19_error) } __pyx_t_13 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_missing_keys, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4829, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = __pyx_t_13; __pyx_t_13 = 0; while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_11, __pyx_t_9, &__pyx_t_2, &__pyx_t_13, &__pyx_t_4, NULL, __pyx_t_10); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 4829, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4832 * # Task may already be gone if it was held by a * # `missing_worker` * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * logger.exception( * "Workers don't have promised key: %s, %s", */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4832, __pyx_L19_error) } __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_cur_scope->__pyx_v_key, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4832, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4832, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4833 * # `missing_worker` * ts: TaskState = parent._tasks.get(key) * logger.exception( # <<<<<<<<<<<<<< * "Workers don't have promised key: %s, %s", * str(workers), */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_exception); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4835 * logger.exception( * "Workers don't have promised key: %s, %s", * str(workers), # <<<<<<<<<<<<<< * str(key), * ) */ __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4835, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_13); /* "distributed/scheduler.py":4836 * "Workers don't have promised key: %s, %s", * str(workers), * str(key), # <<<<<<<<<<<<<< * ) * if not workers or ts is None: */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4836, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_19); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_19, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_19)) { PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_kp_u_Workers_don_t_have_promised_key, __pyx_t_13, __pyx_t_7}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4833, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) { PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_kp_u_Workers_don_t_have_promised_key, __pyx_t_13, __pyx_t_7}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4833, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_20 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_20); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Workers_don_t_have_promised_key); __Pyx_GIVEREF(__pyx_kp_u_Workers_don_t_have_promised_key); PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_12, __pyx_kp_u_Workers_don_t_have_promised_key); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_12, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_12, __pyx_t_7); __pyx_t_13 = 0; __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4838 * str(key), * ) * if not workers or ts is None: # <<<<<<<<<<<<<< * continue * for worker in workers: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_workers); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4838, __pyx_L19_error) __pyx_t_21 = ((!__pyx_t_6) != 0); if (!__pyx_t_21) { } else { __pyx_t_5 = __pyx_t_21; goto __pyx_L31_bool_binop_done; } __pyx_t_21 = (((PyObject *)__pyx_cur_scope->__pyx_v_ts) == Py_None); __pyx_t_6 = (__pyx_t_21 != 0); __pyx_t_5 = __pyx_t_6; __pyx_L31_bool_binop_done:; if (__pyx_t_5) { /* "distributed/scheduler.py":4839 * ) * if not workers or ts is None: * continue # <<<<<<<<<<<<<< * for worker in workers: * ws = parent._workers_dv.get(worker) */ goto __pyx_L28_continue; /* "distributed/scheduler.py":4838 * str(key), * ) * if not workers or ts is None: # <<<<<<<<<<<<<< * continue * for worker in workers: */ } /* "distributed/scheduler.py":4840 * if not workers or ts is None: * continue * for worker in workers: # <<<<<<<<<<<<<< * ws = parent._workers_dv.get(worker) * if ws is not None and ts in ws._has_what: */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_4 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_3 = NULL; } else { __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4840, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4840, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_19 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_19); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 4840, __pyx_L19_error) #else __pyx_t_19 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4840, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_19); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_19 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_19); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 4840, __pyx_L19_error) #else __pyx_t_19 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4840, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_19); #endif } } else { __pyx_t_19 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_19)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4840, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_19); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_worker, __pyx_t_19); __Pyx_GIVEREF(__pyx_t_19); __pyx_t_19 = 0; /* "distributed/scheduler.py":4841 * continue * for worker in workers: * ws = parent._workers_dv.get(worker) # <<<<<<<<<<<<<< * if ws is not None and ts in ws._has_what: * ws._has_what.remove(ts) */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 4841, __pyx_L19_error) } __pyx_t_19 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent->_workers_dv, __pyx_cur_scope->__pyx_v_worker, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4841, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_19); if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4841, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_19)); __Pyx_GIVEREF(__pyx_t_19); __pyx_t_19 = 0; /* "distributed/scheduler.py":4842 * for worker in workers: * ws = parent._workers_dv.get(worker) * if ws is not None and ts in ws._has_what: # <<<<<<<<<<<<<< * ws._has_what.remove(ts) * ts._who_has.remove(ws) */ __pyx_t_6 = (((PyObject *)__pyx_cur_scope->__pyx_v_ws) != Py_None); __pyx_t_21 = (__pyx_t_6 != 0); if (__pyx_t_21) { } else { __pyx_t_5 = __pyx_t_21; goto __pyx_L36_bool_binop_done; } if (unlikely(__pyx_cur_scope->__pyx_v_ws->_has_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 4842, __pyx_L19_error) } __pyx_t_21 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_cur_scope->__pyx_v_ts), __pyx_cur_scope->__pyx_v_ws->_has_what, Py_EQ)); if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 4842, __pyx_L19_error) __pyx_t_6 = (__pyx_t_21 != 0); __pyx_t_5 = __pyx_t_6; __pyx_L36_bool_binop_done:; if (__pyx_t_5) { /* "distributed/scheduler.py":4843 * ws = parent._workers_dv.get(worker) * if ws is not None and ts in ws._has_what: * ws._has_what.remove(ts) # <<<<<<<<<<<<<< * ts._who_has.remove(ws) * ws._nbytes -= ts.get_nbytes() */ if (unlikely(__pyx_cur_scope->__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 4843, __pyx_L19_error) } __pyx_t_22 = __Pyx_PySet_Remove(__pyx_cur_scope->__pyx_v_ws->_has_what, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 4843, __pyx_L19_error) /* "distributed/scheduler.py":4844 * if ws is not None and ts in ws._has_what: * ws._has_what.remove(ts) * ts._who_has.remove(ws) # <<<<<<<<<<<<<< * ws._nbytes -= ts.get_nbytes() * self.transitions({key: "released"}) */ if (unlikely(__pyx_cur_scope->__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 4844, __pyx_L19_error) } __pyx_t_22 = __Pyx_PySet_Remove(__pyx_cur_scope->__pyx_v_ts->_who_has, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 4844, __pyx_L19_error) /* "distributed/scheduler.py":4845 * ws._has_what.remove(ts) * ts._who_has.remove(ws) * ws._nbytes -= ts.get_nbytes() # <<<<<<<<<<<<<< * self.transitions({key: "released"}) * */ __pyx_t_23 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_cur_scope->__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4845, __pyx_L19_error) __pyx_cur_scope->__pyx_v_ws->_nbytes = (__pyx_cur_scope->__pyx_v_ws->_nbytes - __pyx_t_23); /* "distributed/scheduler.py":4846 * ts._who_has.remove(ws) * ws._nbytes -= ts.get_nbytes() * self.transitions({key: "released"}) # <<<<<<<<<<<<<< * * self.log_event("all", {"action": "gather", "count": len(keys)}) */ __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4846, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4846, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_cur_scope->__pyx_v_key, __pyx_n_u_released) < 0) __PYX_ERR(0, 4846, __pyx_L19_error) __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } __pyx_t_19 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_13, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_7); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4846, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; /* "distributed/scheduler.py":4842 * for worker in workers: * ws = parent._workers_dv.get(worker) * if ws is not None and ts in ws._has_what: # <<<<<<<<<<<<<< * ws._has_what.remove(ts) * ts._who_has.remove(ws) */ } /* "distributed/scheduler.py":4840 * if not workers or ts is None: * continue * for worker in workers: # <<<<<<<<<<<<<< * ws = parent._workers_dv.get(worker) * if ws is not None and ts in ws._has_what: */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L28_continue:; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":4820 * ) * result = {"status": "error", "keys": missing_keys} * with log_errors(): # <<<<<<<<<<<<<< * # Remove suspicious workers from the scheduler but allow them to * # reconnect. */ } __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L24_try_end; __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_4, &__pyx_t_19) < 0) __PYX_ERR(0, 4820, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_19); __pyx_t_20 = PyTuple_Pack(3, __pyx_t_11, __pyx_t_4, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4820, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_20, NULL); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 4820, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (__pyx_t_5 < 0) __PYX_ERR(0, 4820, __pyx_L21_except_error) __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestoreWithState(__pyx_t_11, __pyx_t_4, __pyx_t_19); __pyx_t_11 = 0; __pyx_t_4 = 0; __pyx_t_19 = 0; __PYX_ERR(0, 4820, __pyx_L21_except_error) } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L20_exception_handled; } __pyx_L21_except_error:; __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); goto __pyx_L1_error; __pyx_L20_exception_handled:; __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_L24_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_15) { __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } goto __pyx_L18; } __pyx_L18:; } goto __pyx_L41; __pyx_L15_error:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L1_error; __pyx_L41:; } } __pyx_L12:; /* "distributed/scheduler.py":4848 * self.transitions({key: "released"}) * * self.log_event("all", {"action": "gather", "count": len(keys)}) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_action, __pyx_n_u_gather) < 0) __PYX_ERR(0, 4848, __pyx_L1_error) __pyx_t_9 = PyObject_Length(__pyx_cur_scope->__pyx_v_keys); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4848, __pyx_L1_error) __pyx_t_20 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_count, __pyx_t_20) < 0) __PYX_ERR(0, 4848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_20 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_n_u_all, __pyx_t_11}; __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4848, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_n_u_all, __pyx_t_11}; __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4848, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_20) { __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_20); __pyx_t_20 = NULL; } __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_n_u_all); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; /* "distributed/scheduler.py":4849 * * self.log_event("all", {"action": "gather", "count": len(keys)}) * return result # <<<<<<<<<<<<<< * * def clear_task_state(self): */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_result); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4790 * return keys * * async def gather(self, comm=None, keys=None, serializers=None): # <<<<<<<<<<<<<< * """ Collect data in from workers """ * parent: SchedulerState = cast(SchedulerState, self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4851 * return result * * def clear_task_state(self): # <<<<<<<<<<<<<< * # XXX what about nested state such as ClientState.wants_what * # (see also fire-and-forget...) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_108clear_task_state(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_108clear_task_state = {"clear_task_state", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_108clear_task_state, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_108clear_task_state(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear_task_state (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_107clear_task_state(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_107clear_task_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_collection = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear_task_state", 0); /* "distributed/scheduler.py":4854 * # XXX what about nested state such as ClientState.wants_what * # (see also fire-and-forget...) * logger.info("Clear task state") # <<<<<<<<<<<<<< * for collection in self._task_state_collections: * collection.clear() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_Clear_task_state) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Clear_task_state); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4855 * # (see also fire-and-forget...) * logger.info("Clear task state") * for collection in self._task_state_collections: # <<<<<<<<<<<<<< * collection.clear() * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_task_state_collections); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4855, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 4855, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 4855, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4855, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_collection, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4856 * logger.info("Clear task state") * for collection in self._task_state_collections: * collection.clear() # <<<<<<<<<<<<<< * * async def restart(self, client=None, timeout=3): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_collection, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4855 * # (see also fire-and-forget...) * logger.info("Clear task state") * for collection in self._task_state_collections: # <<<<<<<<<<<<<< * collection.clear() * */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4851 * return result * * def clear_task_state(self): # <<<<<<<<<<<<<< * # XXX what about nested state such as ClientState.wants_what * # (see also fire-and-forget...) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.clear_task_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_collection); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_111generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4858 * collection.clear() * * async def restart(self, client=None, timeout=3): # <<<<<<<<<<<<<< * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_110restart(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_109restart[] = " Restart all workers. Reset local state. "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_110restart = {"restart", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_110restart, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_109restart}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_110restart(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_client = 0; PyObject *__pyx_v_timeout = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restart (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,&__pyx_n_s_timeout,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)__pyx_int_3)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restart") < 0)) __PYX_ERR(0, 4858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_client = values[1]; __pyx_v_timeout = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restart", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.restart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_109restart(__pyx_self, __pyx_v_self, __pyx_v_client, __pyx_v_timeout); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_7restart_2generator34(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4918 * ) * else: * if not all(resp == "OK" for resp in resps): # <<<<<<<<<<<<<< * logger.error( * "Not all workers responded positively: %s", resps, exc_info=True */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_7restart_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_29_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_29_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4918, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_7restart_2generator34, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_restart_locals_genexpr, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4918, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.restart.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_7restart_2generator34(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4918, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resps)) { __Pyx_RaiseClosureNameError("resps"); __PYX_ERR(0, 4918, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resps)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resps)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_resps; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4918, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4918, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4918, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4918, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_resp); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resp, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_resp, __pyx_n_u_OK, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4918, __pyx_L1_error) __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } } /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4858 * collection.clear() * * async def restart(self, client=None, timeout=3): # <<<<<<<<<<<<<< * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_109restart(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_timeout) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restart", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_28_restart(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_28_restart, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4858, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_client = __pyx_v_client; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_111generator10, __pyx_codeobj__68, (PyObject *) __pyx_cur_scope, __pyx_n_s_restart, __pyx_n_s_Scheduler_restart, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4858, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.restart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_111generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; Py_ssize_t __pyx_t_14; Py_ssize_t __pyx_t_15; PyObject *__pyx_t_16 = NULL; int __pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_t_21; PyObject *__pyx_t_22 = NULL; char const *__pyx_t_23; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; PyObject *__pyx_t_29 = NULL; PyObject *(*__pyx_t_30)(PyObject *); char const *__pyx_t_31; int __pyx_t_32; char const *__pyx_t_33; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restart", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L30_resume_from_await; case 2: goto __pyx_L77_resume_from_await; case 3: goto __pyx_L83_resume_from_await; case 4: goto __pyx_L88_resume_from_await; case 5: goto __pyx_L109_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4858, __pyx_L1_error) /* "distributed/scheduler.py":4860 * async def restart(self, client=None, timeout=3): * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * with log_errors(): * */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4861 * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * * n_workers = len(parent._workers_dv) */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4861, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4861, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":4863 * with log_errors(): * * n_workers = len(parent._workers_dv) # <<<<<<<<<<<<<< * * logger.info("Send lost future signal to clients") */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 4863, __pyx_L8_error) } __pyx_t_9 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4863, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_cur_scope->__pyx_v_n_workers = __pyx_t_9; /* "distributed/scheduler.py":4865 * n_workers = len(parent._workers_dv) * * logger.info("Send lost future signal to clients") # <<<<<<<<<<<<<< * cs: ClientState * ts: TaskState */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4865, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4865, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_Send_lost_future_signal_to_clien) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Send_lost_future_signal_to_clien); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4865, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4868 * cs: ClientState * ts: TaskState * for cs in parent._clients.values(): # <<<<<<<<<<<<<< * self.client_releases_keys( * keys=[ts._key for ts in cs._wants_what], client=cs._client_key */ __pyx_t_9 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_clients == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 4868, __pyx_L8_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_clients, 1, __pyx_n_s_values, (&__pyx_t_10), (&__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4868, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, &__pyx_t_3, NULL, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 4868, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 4868, __pyx_L8_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_cs)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4869 * ts: TaskState * for cs in parent._clients.values(): * self.client_releases_keys( # <<<<<<<<<<<<<< * keys=[ts._key for ts in cs._wants_what], client=cs._client_key * ) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client_releases_keys_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4869, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":4870 * for cs in parent._clients.values(): * self.client_releases_keys( * keys=[ts._key for ts in cs._wants_what], client=cs._client_key # <<<<<<<<<<<<<< * ) * */ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4870, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4870, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_14 = 0; __pyx_t_16 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_cs->_wants_what, 1, (&__pyx_t_15), (&__pyx_t_12)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4870, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = __pyx_t_16; __pyx_t_16 = 0; while (1) { __pyx_t_17 = __Pyx_set_iter_next(__pyx_t_13, __pyx_t_15, &__pyx_t_14, &__pyx_t_16, __pyx_t_12); if (unlikely(__pyx_t_17 == 0)) break; if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 4870, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 4870, __pyx_L8_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr61__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr61__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_16)); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_cur_scope->__pyx_9genexpr61__pyx_v_ts->_key))) __PYX_ERR(0, 4870, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } /* exit inner scope */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_keys, __pyx_t_5) < 0) __PYX_ERR(0, 4870, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client, __pyx_cur_scope->__pyx_v_cs->_client_key) < 0) __PYX_ERR(0, 4870, __pyx_L8_error) /* "distributed/scheduler.py":4869 * ts: TaskState * for cs in parent._clients.values(): * self.client_releases_keys( # <<<<<<<<<<<<<< * keys=[ts._key for ts in cs._wants_what], client=cs._client_key * ) */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4869, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4874 * * ws: WorkerState * nannies = {addr: ws._nanny for addr, ws in parent._workers_dv.items()} # <<<<<<<<<<<<<< * * for addr in list(parent._workers_dv): */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4874, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 4874, __pyx_L8_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4874, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_9, &__pyx_t_10, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 4874, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 4874, __pyx_L8_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr62__pyx_v_addr); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr62__pyx_v_addr, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr62__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr62__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr62__pyx_v_addr, (PyObject*)__pyx_cur_scope->__pyx_9genexpr62__pyx_v_ws->_nanny))) __PYX_ERR(0, 4874, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_nannies = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4876 * nannies = {addr: ws._nanny for addr, ws in parent._workers_dv.items()} * * for addr in list(parent._workers_dv): # <<<<<<<<<<<<<< * try: * # Ask the worker to close if it doesn't have a nanny, */ __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_parent->_workers_dv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4876, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 4876, __pyx_L8_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4876, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_addr); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_addr, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4877 * * for addr in list(parent._workers_dv): * try: # <<<<<<<<<<<<<< * # Ask the worker to close if it doesn't have a nanny, * # otherwise the nanny will kill it anyway */ { __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); /*try:*/ { /* "distributed/scheduler.py":4880 * # Ask the worker to close if it doesn't have a nanny, * # otherwise the nanny will kill it anyway * await self.remove_worker(address=addr, close=addr not in nannies) # <<<<<<<<<<<<<< * except Exception as e: * logger.info( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4880, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4880, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_address, __pyx_cur_scope->__pyx_v_addr) < 0) __PYX_ERR(0, 4880, __pyx_L22_error) __pyx_t_21 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_addr, __pyx_cur_scope->__pyx_v_nannies, Py_NE)); if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 4880, __pyx_L22_error) __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4880, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 4880, __pyx_L22_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4880, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __pyx_cur_scope->__pyx_t_5 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_6 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_7 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_8 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L30_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_5; __pyx_t_18 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4880, __pyx_L22_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4880, __pyx_L22_error) } } /* "distributed/scheduler.py":4877 * * for addr in list(parent._workers_dv): * try: # <<<<<<<<<<<<<< * # Ask the worker to close if it doesn't have a nanny, * # otherwise the nanny will kill it anyway */ } __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L29_try_end; __pyx_L22_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4881 * # otherwise the nanny will kill it anyway * await self.remove_worker(address=addr, close=addr not in nannies) * except Exception as e: # <<<<<<<<<<<<<< * logger.info( * "Exception while restarting. This is normal", exc_info=True */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_11) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.restart", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 4881, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_e = __pyx_t_3; /*try:*/ { /* "distributed/scheduler.py":4882 * await self.remove_worker(address=addr, close=addr not in nannies) * except Exception as e: * logger.info( # <<<<<<<<<<<<<< * "Exception while restarting. This is normal", exc_info=True * ) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4882, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_info); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4882, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4883 * except Exception as e: * logger.info( * "Exception while restarting. This is normal", exc_info=True # <<<<<<<<<<<<<< * ) * */ __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4883, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4883, __pyx_L36_error) /* "distributed/scheduler.py":4882 * await self.remove_worker(address=addr, close=addr not in nannies) * except Exception as e: * logger.info( # <<<<<<<<<<<<<< * "Exception while restarting. This is normal", exc_info=True * ) */ __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_tuple__69, __pyx_t_13); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4882, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } /* "distributed/scheduler.py":4881 * # otherwise the nanny will kill it anyway * await self.remove_worker(address=addr, close=addr not in nannies) * except Exception as e: # <<<<<<<<<<<<<< * logger.info( * "Exception while restarting. This is normal", exc_info=True */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; goto __pyx_L37; } __pyx_L36_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_29); __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_23 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_29); __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29); } __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26); __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_23; goto __pyx_L24_except_error; } __pyx_L37:; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L23_exception_handled; } goto __pyx_L24_except_error; __pyx_L24_except_error:; /* "distributed/scheduler.py":4877 * * for addr in list(parent._workers_dv): * try: # <<<<<<<<<<<<<< * # Ask the worker to close if it doesn't have a nanny, * # otherwise the nanny will kill it anyway */ __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); goto __pyx_L8_error; __pyx_L23_exception_handled:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_L29_try_end:; } /* "distributed/scheduler.py":4876 * nannies = {addr: ws._nanny for addr, ws in parent._workers_dv.items()} * * for addr in list(parent._workers_dv): # <<<<<<<<<<<<<< * try: * # Ask the worker to close if it doesn't have a nanny, */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4886 * ) * * self.clear_task_state() # <<<<<<<<<<<<<< * * for plugin in self.plugins[:]: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_clear_task_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4886, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4886, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4888 * self.clear_task_state() * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * plugin.restart(self) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4888, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, NULL, NULL, &__pyx_slice__57, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4888, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; __pyx_t_30 = NULL; } else { __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4888, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_30 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 4888, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_30)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 4888, __pyx_L8_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4888, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 4888, __pyx_L8_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4888, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_30(__pyx_t_5); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4888, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_plugin); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_plugin, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4889 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.restart(self) * except Exception as e: */ { __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); /*try:*/ { /* "distributed/scheduler.py":4890 * for plugin in self.plugins[:]: * try: * plugin.restart(self) # <<<<<<<<<<<<<< * except Exception as e: * logger.exception(e) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_plugin, __pyx_n_s_restart); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4890, __pyx_L44_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_self); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4890, __pyx_L44_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4889 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.restart(self) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L51_try_end; __pyx_L44_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4891 * try: * plugin.restart(self) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_12) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.restart", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 4891, __pyx_L46_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_e = __pyx_t_3; /*try:*/ { /* "distributed/scheduler.py":4892 * plugin.restart(self) * except Exception as e: * logger.exception(e) # <<<<<<<<<<<<<< * * logger.debug("Send kill signal to nannies: %s", nannies) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4892, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_exception); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4892, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_22 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_13, __pyx_cur_scope->__pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4892, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } /* "distributed/scheduler.py":4891 * try: * plugin.restart(self) * except Exception as e: # <<<<<<<<<<<<<< * logger.exception(e) * */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; goto __pyx_L58; } __pyx_L57_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27); __Pyx_XGOTREF(__pyx_t_29); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_12 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_31 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_29); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ErrRestore(__pyx_t_29, __pyx_t_28, __pyx_t_27); __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_31; goto __pyx_L46_except_error; } __pyx_L58:; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L45_exception_handled; } goto __pyx_L46_except_error; __pyx_L46_except_error:; /* "distributed/scheduler.py":4889 * * for plugin in self.plugins[:]: * try: # <<<<<<<<<<<<<< * plugin.restart(self) * except Exception as e: */ __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); goto __pyx_L8_error; __pyx_L45_exception_handled:; __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); __pyx_L51_try_end:; } /* "distributed/scheduler.py":4888 * self.clear_task_state() * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * plugin.restart(self) */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4894 * logger.exception(e) * * logger.debug("Send kill signal to nannies: %s", nannies) # <<<<<<<<<<<<<< * * nannies = [ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4894, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4894, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Send_kill_signal_to_nannies_s, __pyx_cur_scope->__pyx_v_nannies}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4894, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Send_kill_signal_to_nannies_s, __pyx_cur_scope->__pyx_v_nannies}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4894, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4894, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Send_kill_signal_to_nannies_s); __Pyx_GIVEREF(__pyx_kp_u_Send_kill_signal_to_nannies_s); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_11, __pyx_kp_u_Send_kill_signal_to_nannies_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nannies); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nannies); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_nannies); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4894, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4896 * logger.debug("Send kill signal to nannies: %s", nannies) * * nannies = [ # <<<<<<<<<<<<<< * rpc(nanny_address, connection_args=self.connection_args) * for nanny_address in nannies.values() */ { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4896, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":4898 * nannies = [ * rpc(nanny_address, connection_args=self.connection_args) * for nanny_address in nannies.values() # <<<<<<<<<<<<<< * if nanny_address is not None * ] */ __pyx_t_9 = 0; __pyx_t_1 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_nannies, 0, __pyx_n_s_values, (&__pyx_t_10), (&__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4898, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_10, &__pyx_t_9, NULL, &__pyx_t_1, NULL, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 4898, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr63__pyx_v_nanny_address); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr63__pyx_v_nanny_address, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4899 * rpc(nanny_address, connection_args=self.connection_args) * for nanny_address in nannies.values() * if nanny_address is not None # <<<<<<<<<<<<<< * ] * */ __pyx_t_21 = (__pyx_cur_scope->__pyx_9genexpr63__pyx_v_nanny_address != Py_None); __pyx_t_32 = (__pyx_t_21 != 0); if (__pyx_t_32) { /* "distributed/scheduler.py":4897 * * nannies = [ * rpc(nanny_address, connection_args=self.connection_args) # <<<<<<<<<<<<<< * for nanny_address in nannies.values() * if nanny_address is not None */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_rpc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4897, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4897, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_9genexpr63__pyx_v_nanny_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_9genexpr63__pyx_v_nanny_address); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_9genexpr63__pyx_v_nanny_address); __pyx_t_22 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4897, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_connection_args); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4897, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_connection_args, __pyx_t_16) < 0) __PYX_ERR(0, 4897, __pyx_L8_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_22); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4897, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 4896, __pyx_L8_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":4899 * rpc(nanny_address, connection_args=self.connection_args) * for nanny_address in nannies.values() * if nanny_address is not None # <<<<<<<<<<<<<< * ] * */ } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_nannies); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_nannies, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4902 * ] * * resps = All( # <<<<<<<<<<<<<< * [ * nanny.restart( */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_All); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4902, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); { /* enter inner scope */ /* "distributed/scheduler.py":4903 * * resps = All( * [ # <<<<<<<<<<<<<< * nanny.restart( * close=True, timeout=timeout * 0.8, executor_wait=False */ __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4903, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); /* "distributed/scheduler.py":4907 * close=True, timeout=timeout * 0.8, executor_wait=False * ) * for nanny in nannies # <<<<<<<<<<<<<< * ] * ) */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_nannies)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_nannies)) { __pyx_t_22 = __pyx_cur_scope->__pyx_v_nannies; __Pyx_INCREF(__pyx_t_22); __pyx_t_10 = 0; __pyx_t_30 = NULL; } else { __pyx_t_10 = -1; __pyx_t_22 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_nannies); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4907, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_30 = Py_TYPE(__pyx_t_22)->tp_iternext; if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 4907, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_30)) { if (likely(PyList_CheckExact(__pyx_t_22))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_22)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_22, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4907, __pyx_L8_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_22, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4907, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_22)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_22, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4907, __pyx_L8_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_22, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4907, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_30(__pyx_t_22); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4907, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr64__pyx_v_nanny); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr64__pyx_v_nanny, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4904 * resps = All( * [ * nanny.restart( # <<<<<<<<<<<<<< * close=True, timeout=timeout * 0.8, executor_wait=False * ) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr64__pyx_v_nanny, __pyx_n_s_restart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4904, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":4905 * [ * nanny.restart( * close=True, timeout=timeout * 0.8, executor_wait=False # <<<<<<<<<<<<<< * ) * for nanny in nannies */ __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4905, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_close, Py_True) < 0) __PYX_ERR(0, 4905, __pyx_L8_error) __pyx_t_13 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_timeout, __pyx_float_0_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4905, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_timeout, __pyx_t_13) < 0) __PYX_ERR(0, 4905, __pyx_L8_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_executor_wait, Py_False) < 0) __PYX_ERR(0, 4905, __pyx_L8_error) /* "distributed/scheduler.py":4904 * resps = All( * [ * nanny.restart( # <<<<<<<<<<<<<< * close=True, timeout=timeout * 0.8, executor_wait=False * ) */ __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4904, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_16, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 4903, __pyx_L8_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4907 * close=True, timeout=timeout * 0.8, executor_wait=False * ) * for nanny in nannies # <<<<<<<<<<<<<< * ] * ) */ } __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } /* exit inner scope */ __pyx_t_22 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_22)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_22); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_22) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_22, __pyx_t_16) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_16); __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4902, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_resps = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":4910 * ] * ) * try: # <<<<<<<<<<<<<< * resps = await asyncio.wait_for(resps, timeout) * except TimeoutError: */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); /*try:*/ { /* "distributed/scheduler.py":4911 * ) * try: * resps = await asyncio.wait_for(resps, timeout) # <<<<<<<<<<<<<< * except TimeoutError: * logger.error( */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4911, __pyx_L71_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_wait_for); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4911, __pyx_L71_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_resps, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4911, __pyx_L71_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_resps, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4911, __pyx_L71_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_22 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4911, __pyx_L71_error) __Pyx_GOTREF(__pyx_t_22); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resps); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resps); PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_11, __pyx_cur_scope->__pyx_v_resps); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_timeout); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4911, __pyx_L71_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_4 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_6 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_7 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L77_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_18 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4911, __pyx_L71_error) __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5); } else { __pyx_t_5 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_5) < 0) __PYX_ERR(0, 4911, __pyx_L71_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_resps); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_resps, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4910 * ] * ) * try: # <<<<<<<<<<<<<< * resps = await asyncio.wait_for(resps, timeout) * except TimeoutError: */ } /* "distributed/scheduler.py":4918 * ) * else: * if not all(resp == "OK" for resp in resps): # <<<<<<<<<<<<<< * logger.error( * "Not all workers responded positively: %s", resps, exc_info=True */ /*else:*/ { __pyx_t_5 = __pyx_pf_11distributed_9scheduler_9Scheduler_7restart_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4918, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_16 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4918, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_32 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_32 < 0)) __PYX_ERR(0, 4918, __pyx_L73_except_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_21 = ((!__pyx_t_32) != 0); if (__pyx_t_21) { /* "distributed/scheduler.py":4919 * else: * if not all(resp == "OK" for resp in resps): * logger.error( # <<<<<<<<<<<<<< * "Not all workers responded positively: %s", resps, exc_info=True * ) */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4919, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4919, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":4920 * if not all(resp == "OK" for resp in resps): * logger.error( * "Not all workers responded positively: %s", resps, exc_info=True # <<<<<<<<<<<<<< * ) * finally: */ __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4919, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_kp_u_Not_all_workers_responded_positi); __Pyx_GIVEREF(__pyx_kp_u_Not_all_workers_responded_positi); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_kp_u_Not_all_workers_responded_positi); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resps); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resps); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_resps); __pyx_t_22 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4920, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_22); if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4920, __pyx_L73_except_error) /* "distributed/scheduler.py":4919 * else: * if not all(resp == "OK" for resp in resps): * logger.error( # <<<<<<<<<<<<<< * "Not all workers responded positively: %s", resps, exc_info=True * ) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, __pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4919, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4918 * ) * else: * if not all(resp == "OK" for resp in resps): # <<<<<<<<<<<<<< * logger.error( * "Not all workers responded positively: %s", resps, exc_info=True */ } } __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L76_try_end; __pyx_L71_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":4912 * try: * resps = await asyncio.wait_for(resps, timeout) * except TimeoutError: # <<<<<<<<<<<<<< * logger.error( * "Nannies didn't report back restarted within " */ __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_22, &__pyx_t_16); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4912, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ErrRestore(__pyx_t_3, __pyx_t_22, __pyx_t_16); __pyx_t_3 = 0; __pyx_t_22 = 0; __pyx_t_16 = 0; if (__pyx_t_11) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.restart", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_22, &__pyx_t_3) < 0) __PYX_ERR(0, 4912, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_22); __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":4913 * resps = await asyncio.wait_for(resps, timeout) * except TimeoutError: * logger.error( # <<<<<<<<<<<<<< * "Nannies didn't report back restarted within " * "timeout. Continuuing with restart process" */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4913, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4913, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_13, __pyx_kp_u_Nannies_didn_t_report_back_resta) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_Nannies_didn_t_report_back_resta); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4913, __pyx_L73_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L72_exception_handled; } goto __pyx_L73_except_error; __pyx_L73_except_error:; /* "distributed/scheduler.py":4910 * ] * ) * try: # <<<<<<<<<<<<<< * resps = await asyncio.wait_for(resps, timeout) * except TimeoutError: */ __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); goto __pyx_L69_error; __pyx_L72_exception_handled:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_L76_try_end:; } } /* "distributed/scheduler.py":4923 * ) * finally: * await asyncio.gather(*[nanny.close_rpc() for nanny in nannies]) # <<<<<<<<<<<<<< * * self.clear_task_state() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_gather); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_nannies)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_nannies)) { __pyx_t_16 = __pyx_cur_scope->__pyx_v_nannies; __Pyx_INCREF(__pyx_t_16); __pyx_t_10 = 0; __pyx_t_30 = NULL; } else { __pyx_t_10 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_nannies); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_30 = Py_TYPE(__pyx_t_16)->tp_iternext; if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 4923, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_30)) { if (likely(PyList_CheckExact(__pyx_t_16))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_16)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4923, __pyx_L8_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_16, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_16)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4923, __pyx_L8_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_16, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_30(__pyx_t_16); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4923, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr66__pyx_v_nanny); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr66__pyx_v_nanny, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr66__pyx_v_nanny, __pyx_n_s_close_rpc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } /* exit inner scope */ __pyx_t_16 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4923, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L83_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4923, __pyx_L8_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4923, __pyx_L8_error) } } goto __pyx_L70; } __pyx_L69_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_33 = __pyx_filename; { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_gather); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_nannies)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_nannies)) { __pyx_t_22 = __pyx_cur_scope->__pyx_v_nannies; __Pyx_INCREF(__pyx_t_22); __pyx_t_10 = 0; __pyx_t_30 = NULL; } else { __pyx_t_10 = -1; __pyx_t_22 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_nannies); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_30 = Py_TYPE(__pyx_t_22)->tp_iternext; if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 4923, __pyx_L85_error) } for (;;) { if (likely(!__pyx_t_30)) { if (likely(PyList_CheckExact(__pyx_t_22))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_22)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_22, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4923, __pyx_L85_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_22, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_22)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_22, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4923, __pyx_L85_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_22, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_30(__pyx_t_22); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4923, __pyx_L85_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr67__pyx_v_nanny); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr67__pyx_v_nanny, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr67__pyx_v_nanny, __pyx_n_s_close_rpc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } /* exit inner scope */ __pyx_t_22 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4923, __pyx_L85_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __pyx_cur_scope->__pyx_t_9 = __pyx_t_11; __pyx_cur_scope->__pyx_t_10 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_4 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_6 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_7 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_8 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_25); __pyx_cur_scope->__pyx_t_11 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_t_26); __pyx_cur_scope->__pyx_t_12 = __pyx_t_26; __pyx_cur_scope->__pyx_t_13 = __pyx_t_33; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L88_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_11 = __pyx_cur_scope->__pyx_t_9; __pyx_t_12 = __pyx_cur_scope->__pyx_t_10; __pyx_t_18 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_24 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_25 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_25); __pyx_t_26 = __pyx_cur_scope->__pyx_t_12; __pyx_cur_scope->__pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_t_26); __pyx_t_33 = __pyx_cur_scope->__pyx_t_13; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4923, __pyx_L85_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4923, __pyx_L85_error) } } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26); } __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_20, __pyx_t_19, __pyx_t_18); __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_33; goto __pyx_L8_error; __pyx_L85_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26); } __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; goto __pyx_L8_error; } __pyx_L70:; } /* "distributed/scheduler.py":4925 * await asyncio.gather(*[nanny.close_rpc() for nanny in nannies]) * * self.clear_task_state() # <<<<<<<<<<<<<< * * with suppress(AttributeError): */ __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_clear_task_state); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4925, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_22))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_22); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_22, function); } } __pyx_t_3 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_22); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4925, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4927 * self.clear_task_state() * * with suppress(AttributeError): # <<<<<<<<<<<<<< * for c in self._worker_coroutines: * c.cancel() */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_suppress); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4927, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_22))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_22); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_22, function); } } __pyx_t_3 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_22, __pyx_t_16, __pyx_builtin_AttributeError) : __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_builtin_AttributeError); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4927, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __pyx_t_26 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4927, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_26); __pyx_t_16 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4927, __pyx_L89_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_22 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_16); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4927, __pyx_L89_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_25, &__pyx_t_24, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_18); /*try:*/ { /* "distributed/scheduler.py":4928 * * with suppress(AttributeError): * for c in self._worker_coroutines: # <<<<<<<<<<<<<< * c.cancel() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_worker_coroutines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4928, __pyx_L93_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_22 = __pyx_t_3; __Pyx_INCREF(__pyx_t_22); __pyx_t_10 = 0; __pyx_t_30 = NULL; } else { __pyx_t_10 = -1; __pyx_t_22 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4928, __pyx_L93_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_30 = Py_TYPE(__pyx_t_22)->tp_iternext; if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 4928, __pyx_L93_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_30)) { if (likely(PyList_CheckExact(__pyx_t_22))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_22)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_22, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4928, __pyx_L93_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_22, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4928, __pyx_L93_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_22)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_22, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4928, __pyx_L93_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_22, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4928, __pyx_L93_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_30(__pyx_t_22); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4928, __pyx_L93_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4929 * with suppress(AttributeError): * for c in self._worker_coroutines: * c.cancel() # <<<<<<<<<<<<<< * * self.log_event([client, "all"], {"action": "restart", "client": client}) */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_c, __pyx_n_s_cancel); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4929, __pyx_L93_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_16); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4929, __pyx_L93_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4928 * * with suppress(AttributeError): * for c in self._worker_coroutines: # <<<<<<<<<<<<<< * c.cancel() * */ } __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; /* "distributed/scheduler.py":4927 * self.clear_task_state() * * with suppress(AttributeError): # <<<<<<<<<<<<<< * for c in self._worker_coroutines: * c.cancel() */ } __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L98_try_end; __pyx_L93_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.restart", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_22, &__pyx_t_3, &__pyx_t_16) < 0) __PYX_ERR(0, 4927, __pyx_L95_except_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_22, __pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4927, __pyx_L95_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4927, __pyx_L95_except_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_19); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (__pyx_t_21 < 0) __PYX_ERR(0, 4927, __pyx_L95_except_error) __pyx_t_32 = ((!(__pyx_t_21 != 0)) != 0); if (__pyx_t_32) { __Pyx_GIVEREF(__pyx_t_22); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestoreWithState(__pyx_t_22, __pyx_t_3, __pyx_t_16); __pyx_t_22 = 0; __pyx_t_3 = 0; __pyx_t_16 = 0; __PYX_ERR(0, 4927, __pyx_L95_except_error) } __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L94_exception_handled; } __pyx_L95_except_error:; __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_24, __pyx_t_18); goto __pyx_L8_error; __pyx_L94_exception_handled:; __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_24, __pyx_t_18); __pyx_L98_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_26) { __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4927, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } goto __pyx_L92; } __pyx_L92:; } goto __pyx_L104; __pyx_L89_error:; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; goto __pyx_L8_error; __pyx_L104:; } /* "distributed/scheduler.py":4931 * c.cancel() * * self.log_event([client, "all"], {"action": "restart", "client": client}) # <<<<<<<<<<<<<< * start = time() * while time() < start + 10 and len(parent._workers_dv) < n_workers: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4931, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_22 = PyList_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 4931, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_client); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_client); PyList_SET_ITEM(__pyx_t_22, 0, __pyx_cur_scope->__pyx_v_client); __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyList_SET_ITEM(__pyx_t_22, 1, __pyx_n_u_all); __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4931, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_action, __pyx_n_u_restart) < 0) __PYX_ERR(0, 4931, __pyx_L8_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_client, __pyx_cur_scope->__pyx_v_client) < 0) __PYX_ERR(0, 4931, __pyx_L8_error) __pyx_t_1 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_22, __pyx_t_5}; __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4931, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_22, __pyx_t_5}; __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4931, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4931, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_22); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_5); __pyx_t_22 = 0; __pyx_t_5 = 0; __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4931, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":4932 * * self.log_event([client, "all"], {"action": "restart", "client": client}) * start = time() # <<<<<<<<<<<<<< * while time() < start + 10 and len(parent._workers_dv) < n_workers: * await asyncio.sleep(0.01) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4932, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_16 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4932, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_v_start = __pyx_t_16; __pyx_t_16 = 0; /* "distributed/scheduler.py":4933 * self.log_event([client, "all"], {"action": "restart", "client": client}) * start = time() * while time() < start + 10 and len(parent._workers_dv) < n_workers: # <<<<<<<<<<<<<< * await asyncio.sleep(0.01) * */ while (1) { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4933, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_16 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4933, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_start, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4933, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = PyObject_RichCompare(__pyx_t_16, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4933, __pyx_L8_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 4933, __pyx_L8_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_21) { } else { __pyx_t_32 = __pyx_t_21; goto __pyx_L107_bool_binop_done; } __pyx_t_13 = __pyx_cur_scope->__pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_13); if (unlikely(__pyx_t_13 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 4933, __pyx_L8_error) } __pyx_t_10 = PyDict_Size(__pyx_t_13); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4933, __pyx_L8_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_21 = ((__pyx_t_10 < __pyx_cur_scope->__pyx_v_n_workers) != 0); __pyx_t_32 = __pyx_t_21; __pyx_L107_bool_binop_done:; if (!__pyx_t_32) break; /* "distributed/scheduler.py":4934 * start = time() * while time() < start + 10 and len(parent._workers_dv) < n_workers: * await asyncio.sleep(0.01) # <<<<<<<<<<<<<< * * self.report({"op": "restart"}) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4934, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sleep); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4934, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_13 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_3, __pyx_float_0_01) : __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_float_0_01); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4934, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L109_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4934, __pyx_L8_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4934, __pyx_L8_error) } } } /* "distributed/scheduler.py":4936 * await asyncio.sleep(0.01) * * self.report({"op": "restart"}) # <<<<<<<<<<<<<< * * async def broadcast( */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_report); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4936, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4936, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_op, __pyx_n_u_restart) < 0) __PYX_ERR(0, 4936, __pyx_L8_error) __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_13 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4936, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":4861 * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * * n_workers = len(parent._workers_dv) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.restart", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_16, &__pyx_t_3) < 0) __PYX_ERR(0, 4861, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_13, __pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4861, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 4861, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_26); __pyx_t_32 = __Pyx_PyObject_IsTrue(__pyx_t_26); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (__pyx_t_32 < 0) __PYX_ERR(0, 4861, __pyx_L10_except_error) __pyx_t_21 = ((!(__pyx_t_32 != 0)) != 0); if (__pyx_t_21) { __Pyx_GIVEREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_13, __pyx_t_16, __pyx_t_3); __pyx_t_13 = 0; __pyx_t_16 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 4861, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L113; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L113:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4858 * collection.clear() * * async def restart(self, client=None, timeout=3): # <<<<<<<<<<<<<< * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_22); __Pyx_AddTraceback("restart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_114generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4938 * self.report({"op": "restart"}) * * async def broadcast( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_113broadcast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_112broadcast[] = " Broadcast message to workers, return all results "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_113broadcast = {"broadcast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_113broadcast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_112broadcast}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_113broadcast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_msg = 0; PyObject *__pyx_v_workers = 0; PyObject *__pyx_v_hosts = 0; PyObject *__pyx_v_nanny = 0; PyObject *__pyx_v_serializers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("broadcast (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_msg,&__pyx_n_s_workers,&__pyx_n_s_hosts,&__pyx_n_s_nanny,&__pyx_n_s_serializers,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; /* "distributed/scheduler.py":4940 * async def broadcast( * self, * comm=None, # <<<<<<<<<<<<<< * msg=None, * workers=None, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":4941 * self, * comm=None, * msg=None, # <<<<<<<<<<<<<< * workers=None, * hosts=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":4942 * comm=None, * msg=None, * workers=None, # <<<<<<<<<<<<<< * hosts=None, * nanny=False, */ values[3] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":4943 * msg=None, * workers=None, * hosts=None, # <<<<<<<<<<<<<< * nanny=False, * serializers=None, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":4944 * workers=None, * hosts=None, * nanny=False, # <<<<<<<<<<<<<< * serializers=None, * ): */ values[5] = ((PyObject *)((PyObject *)Py_False)); /* "distributed/scheduler.py":4945 * hosts=None, * nanny=False, * serializers=None, # <<<<<<<<<<<<<< * ): * """ Broadcast message to workers, return all results """ */ values[6] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hosts); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nanny); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serializers); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast") < 0)) __PYX_ERR(0, 4938, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_msg = values[2]; __pyx_v_workers = values[3]; __pyx_v_hosts = values[4]; __pyx_v_nanny = values[5]; __pyx_v_serializers = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("broadcast", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4938, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.broadcast", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_112broadcast(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_msg, __pyx_v_workers, __pyx_v_hosts, __pyx_v_nanny, __pyx_v_serializers); /* "distributed/scheduler.py":4938 * self.report({"op": "restart"}) * * async def broadcast( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_112broadcast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_msg, PyObject *__pyx_v_workers, PyObject *__pyx_v_hosts, PyObject *__pyx_v_nanny, PyObject *__pyx_v_serializers) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("broadcast", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_30_broadcast(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_30_broadcast, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4938, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_msg = __pyx_v_msg; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_msg); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_msg); __pyx_cur_scope->__pyx_v_workers = __pyx_v_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); __pyx_cur_scope->__pyx_v_hosts = __pyx_v_hosts; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hosts); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hosts); __pyx_cur_scope->__pyx_v_nanny = __pyx_v_nanny; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nanny); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nanny); __pyx_cur_scope->__pyx_v_serializers = __pyx_v_serializers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_serializers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_serializers); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_114generator11, __pyx_codeobj__70, (PyObject *) __pyx_cur_scope, __pyx_n_s_broadcast, __pyx_n_s_Scheduler_broadcast, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4938, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.broadcast", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9broadcast_2generator35(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4965 * addresses = workers * * async def send_message(addr): # <<<<<<<<<<<<<< * comm = await self.rpc.connect(addr) * comm.name = "Scheduler Broadcast" */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_9broadcast_1send_message(PyObject *__pyx_self, PyObject *__pyx_v_addr); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_9broadcast_1send_message = {"send_message", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_9broadcast_1send_message, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_9broadcast_1send_message(PyObject *__pyx_self, PyObject *__pyx_v_addr) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("send_message (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_9broadcast_send_message(__pyx_self, ((PyObject *)__pyx_v_addr)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9broadcast_send_message(PyObject *__pyx_self, PyObject *__pyx_v_addr) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("send_message", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_31_send_message(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_31_send_message, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4965, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *) __Pyx_CyFunction_GetClosure(__pyx_self); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_v_addr = __pyx_v_addr; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_addr); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_addr); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_9broadcast_2generator35, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_send_message, __pyx_n_s_Scheduler_broadcast_locals_send, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4965, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.broadcast.send_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9broadcast_2generator35(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("send_message", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L4_resume_from_await; case 2: goto __pyx_L8_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4965, __pyx_L1_error) /* "distributed/scheduler.py":4966 * * async def send_message(addr): * comm = await self.rpc.connect(addr) # <<<<<<<<<<<<<< * comm.name = "Scheduler Broadcast" * try: */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4966, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_connect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_addr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_addr); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4966, __pyx_L1_error) __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_1 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 4966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_comm = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4967 * async def send_message(addr): * comm = await self.rpc.connect(addr) * comm.name = "Scheduler Broadcast" # <<<<<<<<<<<<<< * try: * resp = await send_recv(comm, close=True, serializers=serializers, **msg) */ if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_name, __pyx_kp_u_Scheduler_Broadcast) < 0) __PYX_ERR(0, 4967, __pyx_L1_error) /* "distributed/scheduler.py":4968 * comm = await self.rpc.connect(addr) * comm.name = "Scheduler Broadcast" * try: # <<<<<<<<<<<<<< * resp = await send_recv(comm, close=True, serializers=serializers, **msg) * finally: */ /*try:*/ { /* "distributed/scheduler.py":4969 * comm.name = "Scheduler Broadcast" * try: * resp = await send_recv(comm, close=True, serializers=serializers, **msg) # <<<<<<<<<<<<<< * finally: * self.rpc.reuse(addr, comm) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_send_recv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4969, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4969, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_comm); __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4969, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_close, Py_True) < 0) __PYX_ERR(0, 4969, __pyx_L6_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_serializers)) { __Pyx_RaiseClosureNameError("serializers"); __PYX_ERR(0, 4969, __pyx_L6_error) } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_serializers, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_serializers) < 0) __PYX_ERR(0, 4969, __pyx_L6_error) __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_msg)) { __Pyx_RaiseClosureNameError("msg"); __PYX_ERR(0, 4969, __pyx_L6_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_msg == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(0, 4969, __pyx_L6_error) } if (__Pyx_MergeKeywords(__pyx_t_2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_msg) < 0) __PYX_ERR(0, 4969, __pyx_L6_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4969, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L8_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4969, __pyx_L6_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_4 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(0, 4969, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_resp = __pyx_t_4; __pyx_t_4 = 0; } /* "distributed/scheduler.py":4971 * resp = await send_recv(comm, close=True, serializers=serializers, **msg) * finally: * self.rpc.reuse(addr, comm) # <<<<<<<<<<<<<< * return resp * */ /*finally:*/ { /*normal exit:*/{ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4971, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reuse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_addr, __pyx_cur_scope->__pyx_v_comm}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4971, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_addr, __pyx_cur_scope->__pyx_v_comm}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4971, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_addr); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_addr); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_5, __pyx_cur_scope->__pyx_v_addr); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_comm); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 4971, __pyx_L10_error) } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4971, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reuse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4971, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_addr, __pyx_cur_scope->__pyx_v_comm}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4971, __pyx_L10_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_addr, __pyx_cur_scope->__pyx_v_comm}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4971, __pyx_L10_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4971, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_addr); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_addr); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_cur_scope->__pyx_v_addr); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_cur_scope->__pyx_v_comm); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4971, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; __pyx_L10_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L7:; } /* "distributed/scheduler.py":4972 * finally: * self.rpc.reuse(addr, comm) * return resp # <<<<<<<<<<<<<< * * results = await All( */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_resp); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4965 * addresses = workers * * async def send_message(addr): # <<<<<<<<<<<<<< * comm = await self.rpc.connect(addr) * comm.name = "Scheduler Broadcast" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("send_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":4938 * self.report({"op": "restart"}) * * async def broadcast( # <<<<<<<<<<<<<< * self, * comm=None, */ static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_114generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("broadcast", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L18_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4938, __pyx_L1_error) /* "distributed/scheduler.py":4948 * ): * """ Broadcast message to workers, return all results """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if workers is None or workers is True: * if hosts is None: */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4949 * """ Broadcast message to workers, return all results """ * parent: SchedulerState = cast(SchedulerState, self) * if workers is None or workers is True: # <<<<<<<<<<<<<< * if hosts is None: * workers = list(parent._workers_dv) */ __pyx_t_3 = (__pyx_cur_scope->__pyx_v_workers == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = (__pyx_cur_scope->__pyx_v_workers == Py_True); __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "distributed/scheduler.py":4950 * parent: SchedulerState = cast(SchedulerState, self) * if workers is None or workers is True: * if hosts is None: # <<<<<<<<<<<<<< * workers = list(parent._workers_dv) * else: */ __pyx_t_2 = (__pyx_cur_scope->__pyx_v_hosts == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4951 * if workers is None or workers is True: * if hosts is None: * workers = list(parent._workers_dv) # <<<<<<<<<<<<<< * else: * workers = [] */ __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_parent->_workers_dv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4950 * parent: SchedulerState = cast(SchedulerState, self) * if workers is None or workers is True: * if hosts is None: # <<<<<<<<<<<<<< * workers = list(parent._workers_dv) * else: */ goto __pyx_L7; } /* "distributed/scheduler.py":4953 * workers = list(parent._workers_dv) * else: * workers = [] # <<<<<<<<<<<<<< * if hosts is not None: * for host in hosts: */ /*else*/ { __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L7:; /* "distributed/scheduler.py":4949 * """ Broadcast message to workers, return all results """ * parent: SchedulerState = cast(SchedulerState, self) * if workers is None or workers is True: # <<<<<<<<<<<<<< * if hosts is None: * workers = list(parent._workers_dv) */ } /* "distributed/scheduler.py":4954 * else: * workers = [] * if hosts is not None: # <<<<<<<<<<<<<< * for host in hosts: * if host in parent._host_info: */ __pyx_t_3 = (__pyx_cur_scope->__pyx_v_hosts != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":4955 * workers = [] * if hosts is not None: * for host in hosts: # <<<<<<<<<<<<<< * if host in parent._host_info: * workers.extend(parent._host_info[host]["addresses"]) */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_hosts)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_hosts)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_hosts; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_hosts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4955, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4955, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4955, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4955, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_host); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_host, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4956 * if hosts is not None: * for host in hosts: * if host in parent._host_info: # <<<<<<<<<<<<<< * workers.extend(parent._host_info[host]["addresses"]) * # TODO replace with worker_list */ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_host, __pyx_cur_scope->__pyx_v_parent->_host_info, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4956, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":4957 * for host in hosts: * if host in parent._host_info: * workers.extend(parent._host_info[host]["addresses"]) # <<<<<<<<<<<<<< * # TODO replace with worker_list * */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_workers, __pyx_n_s_extend); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_parent->_host_info, __pyx_cur_scope->__pyx_v_host); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_u_addresses); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":4956 * if hosts is not None: * for host in hosts: * if host in parent._host_info: # <<<<<<<<<<<<<< * workers.extend(parent._host_info[host]["addresses"]) * # TODO replace with worker_list */ } /* "distributed/scheduler.py":4955 * workers = [] * if hosts is not None: * for host in hosts: # <<<<<<<<<<<<<< * if host in parent._host_info: * workers.extend(parent._host_info[host]["addresses"]) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4954 * else: * workers = [] * if hosts is not None: # <<<<<<<<<<<<<< * for host in hosts: * if host in parent._host_info: */ } /* "distributed/scheduler.py":4960 * # TODO replace with worker_list * * if nanny: # <<<<<<<<<<<<<< * addresses = [parent._workers_dv[w].nanny for w in workers] * else: */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_nanny); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4960, __pyx_L1_error) if (__pyx_t_3) { /* "distributed/scheduler.py":4961 * * if nanny: * addresses = [parent._workers_dv[w].nanny for w in workers] # <<<<<<<<<<<<<< * else: * addresses = workers */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_7 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4961, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4961, __pyx_L1_error) #else __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4961, __pyx_L1_error) #else __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4961, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_8); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr68__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr68__pyx_v_w, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4961, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_workers_dv, __pyx_cur_scope->__pyx_9genexpr68__pyx_v_w); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nanny); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 4961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_addresses = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4960 * # TODO replace with worker_list * * if nanny: # <<<<<<<<<<<<<< * addresses = [parent._workers_dv[w].nanny for w in workers] * else: */ goto __pyx_L12; } /* "distributed/scheduler.py":4963 * addresses = [parent._workers_dv[w].nanny for w in workers] * else: * addresses = workers # <<<<<<<<<<<<<< * * async def send_message(addr): */ /*else*/ { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); __pyx_cur_scope->__pyx_v_addresses = __pyx_cur_scope->__pyx_v_workers; } __pyx_L12:; /* "distributed/scheduler.py":4965 * addresses = workers * * async def send_message(addr): # <<<<<<<<<<<<<< * comm = await self.rpc.connect(addr) * comm.name = "Scheduler Broadcast" */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_9broadcast_1send_message, 0, __pyx_n_s_Scheduler_broadcast_locals_send, ((PyObject*)__pyx_cur_scope), __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_send_message = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4974 * return resp * * results = await All( # <<<<<<<<<<<<<< * [send_message(address) for address in addresses if address is not None] * ) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_All); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { /* enter inner scope */ /* "distributed/scheduler.py":4975 * * results = await All( * [send_message(address) for address in addresses if address is not None] # <<<<<<<<<<<<<< * ) * */ __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_addresses)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_addresses)) { __pyx_t_8 = __pyx_cur_scope->__pyx_v_addresses; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_addresses); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4975, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4975, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4975, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_6(__pyx_t_8); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4975, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr69__pyx_v_address); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr69__pyx_v_address, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = (__pyx_cur_scope->__pyx_9genexpr69__pyx_v_address != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_9 = __pyx_pf_11distributed_9scheduler_9Scheduler_9broadcast_send_message(__pyx_cur_scope->__pyx_v_send_message, __pyx_cur_scope->__pyx_9genexpr69__pyx_v_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 4975, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* exit inner scope */ __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L18_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4974, __pyx_L1_error) __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_1 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 4974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_results = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":4978 * ) * * return dict(zip(workers, results)) # <<<<<<<<<<<<<< * * async def proxy(self, comm=None, msg=None, worker=None, serializers=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_workers); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_results); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_results); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_results); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4938 * self.report({"op": "restart"}) * * async def broadcast( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("broadcast", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_117generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4980 * return dict(zip(workers, results)) * * async def proxy(self, comm=None, msg=None, worker=None, serializers=None): # <<<<<<<<<<<<<< * """ Proxy a communication through the scheduler to some other worker """ * d = await self.broadcast( */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_116proxy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_115proxy[] = " Proxy a communication through the scheduler to some other worker "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_116proxy = {"proxy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_116proxy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_115proxy}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_116proxy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_msg = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_serializers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_msg,&__pyx_n_s_worker,&__pyx_n_s_serializers,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serializers); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "proxy") < 0)) __PYX_ERR(0, 4980, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_msg = values[2]; __pyx_v_worker = values[3]; __pyx_v_serializers = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("proxy", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4980, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.proxy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_115proxy(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_msg, __pyx_v_worker, __pyx_v_serializers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_115proxy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_msg, PyObject *__pyx_v_worker, PyObject *__pyx_v_serializers) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("proxy", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_32_proxy(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_32_proxy, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4980, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_msg = __pyx_v_msg; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_msg); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_msg); __pyx_cur_scope->__pyx_v_worker = __pyx_v_worker; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); __pyx_cur_scope->__pyx_v_serializers = __pyx_v_serializers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_serializers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_serializers); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_117generator12, __pyx_codeobj__73, (PyObject *) __pyx_cur_scope, __pyx_n_s_proxy, __pyx_n_s_Scheduler_proxy, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4980, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.proxy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_117generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L4_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4980, __pyx_L1_error) /* "distributed/scheduler.py":4982 * async def proxy(self, comm=None, msg=None, worker=None, serializers=None): * """ Proxy a communication through the scheduler to some other worker """ * d = await self.broadcast( # <<<<<<<<<<<<<< * comm=comm, msg=msg, workers=[worker], serializers=serializers * ) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":4983 * """ Proxy a communication through the scheduler to some other worker """ * d = await self.broadcast( * comm=comm, msg=msg, workers=[worker], serializers=serializers # <<<<<<<<<<<<<< * ) * return d[worker] */ __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_comm, __pyx_cur_scope->__pyx_v_comm) < 0) __PYX_ERR(0, 4983, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_msg, __pyx_cur_scope->__pyx_v_msg) < 0) __PYX_ERR(0, 4983, __pyx_L1_error) __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_worker); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_workers, __pyx_t_3) < 0) __PYX_ERR(0, 4983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_serializers, __pyx_cur_scope->__pyx_v_serializers) < 0) __PYX_ERR(0, 4983, __pyx_L1_error) /* "distributed/scheduler.py":4982 * async def proxy(self, comm=None, msg=None, worker=None, serializers=None): * """ Proxy a communication through the scheduler to some other worker """ * d = await self.broadcast( # <<<<<<<<<<<<<< * comm=comm, msg=msg, workers=[worker], serializers=serializers * ) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4982, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 4982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_d = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":4985 * comm=comm, msg=msg, workers=[worker], serializers=serializers * ) * return d[worker] # <<<<<<<<<<<<<< * * async def _delete_worker_data(self, worker_address, keys): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_d, __pyx_cur_scope->__pyx_v_worker); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4980 * return dict(zip(workers, results)) * * async def proxy(self, comm=None, msg=None, worker=None, serializers=None): # <<<<<<<<<<<<<< * """ Proxy a communication through the scheduler to some other worker """ * d = await self.broadcast( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("proxy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_120generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":4987 * return d[worker] * * async def _delete_worker_data(self, worker_address, keys): # <<<<<<<<<<<<<< * """Delete data from a worker and update the corresponding worker/task states * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_119_delete_worker_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_118_delete_worker_data[] = "Delete data from a worker and update the corresponding worker/task states\n\n Parameters\n ----------\n worker_address: str\n Worker address to delete keys from\n keys: List[str]\n List of keys to delete on the specified worker\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_119_delete_worker_data = {"_delete_worker_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_119_delete_worker_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_118_delete_worker_data}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_119_delete_worker_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_worker_address = 0; PyObject *__pyx_v_keys = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_delete_worker_data (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker_address,&__pyx_n_s_keys,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker_address)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_delete_worker_data", 1, 3, 3, 1); __PYX_ERR(0, 4987, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_delete_worker_data", 1, 3, 3, 2); __PYX_ERR(0, 4987, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_delete_worker_data") < 0)) __PYX_ERR(0, 4987, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_worker_address = values[1]; __pyx_v_keys = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_delete_worker_data", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4987, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler._delete_worker_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_118_delete_worker_data(__pyx_self, __pyx_v_self, __pyx_v_worker_address, __pyx_v_keys); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_118_delete_worker_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker_address, PyObject *__pyx_v_keys) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_delete_worker_data", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 4987, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_worker_address = __pyx_v_worker_address; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_worker_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_worker_address); __pyx_cur_scope->__pyx_v_keys = __pyx_v_keys; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_120generator13, __pyx_codeobj__74, (PyObject *) __pyx_cur_scope, __pyx_n_s_delete_worker_data, __pyx_n_s_Scheduler__delete_worker_data, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 4987, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler._delete_worker_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_120generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; Py_ssize_t __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_delete_worker_data", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L4_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4987, __pyx_L1_error) /* "distributed/scheduler.py":4997 * List of keys to delete on the specified worker * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * await retry_operation( * self.rpc(addr=worker_address).delete_data, keys=list(keys), report=False */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":4998 * """ * parent: SchedulerState = cast(SchedulerState, self) * await retry_operation( # <<<<<<<<<<<<<< * self.rpc(addr=worker_address).delete_data, keys=list(keys), report=False * ) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_retry_operation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":4999 * parent: SchedulerState = cast(SchedulerState, self) * await retry_operation( * self.rpc(addr=worker_address).delete_data, keys=list(keys), report=False # <<<<<<<<<<<<<< * ) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_addr, __pyx_cur_scope->__pyx_v_worker_address) < 0) __PYX_ERR(0, 4999, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_delete_data_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":4998 * """ * parent: SchedulerState = cast(SchedulerState, self) * await retry_operation( # <<<<<<<<<<<<<< * self.rpc(addr=worker_address).delete_data, keys=list(keys), report=False * ) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":4999 * parent: SchedulerState = cast(SchedulerState, self) * await retry_operation( * self.rpc(addr=worker_address).delete_data, keys=list(keys), report=False # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_List(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_keys, __pyx_t_2) < 0) __PYX_ERR(0, 4999, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_report, Py_False) < 0) __PYX_ERR(0, 4999, __pyx_L1_error) /* "distributed/scheduler.py":4998 * """ * parent: SchedulerState = cast(SchedulerState, self) * await retry_operation( # <<<<<<<<<<<<<< * self.rpc(addr=worker_address).delete_data, keys=list(keys), report=False * ) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 4998, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 4998, __pyx_L1_error) } } /* "distributed/scheduler.py":5002 * ) * * ws: WorkerState = parent._workers_dv[worker_address] # <<<<<<<<<<<<<< * ts: TaskState * tasks: set = {parent._tasks[key] for key in keys} */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5002, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_workers_dv, __pyx_cur_scope->__pyx_v_worker_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5002, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5004 * ws: WorkerState = parent._workers_dv[worker_address] * ts: TaskState * tasks: set = {parent._tasks[key] for key in keys} # <<<<<<<<<<<<<< * ws._has_what -= tasks * for ts in tasks: */ { /* enter inner scope */ __pyx_t_2 = PySet_New(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5004, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5004, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5004, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5004, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr70__pyx_v_key); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr70__pyx_v_key, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5004, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_cur_scope->__pyx_9genexpr70__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PySet_Add(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 5004, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_tasks = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5005 * ts: TaskState * tasks: set = {parent._tasks[key] for key in keys} * ws._has_what -= tasks # <<<<<<<<<<<<<< * for ts in tasks: * ts._who_has.remove(ws) */ __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_cur_scope->__pyx_v_ws->_has_what, __pyx_cur_scope->__pyx_v_tasks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PySet_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 5005, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ws->_has_what); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ws->_has_what); __pyx_cur_scope->__pyx_v_ws->_has_what = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5006 * tasks: set = {parent._tasks[key] for key in keys} * ws._has_what -= tasks * for ts in tasks: # <<<<<<<<<<<<<< * ts._who_has.remove(ws) * ws._nbytes -= ts.get_nbytes() */ __pyx_t_5 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_tasks, 1, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_7, &__pyx_t_5, &__pyx_t_3, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 5006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5006, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5007 * ws._has_what -= tasks * for ts in tasks: * ts._who_has.remove(ws) # <<<<<<<<<<<<<< * ws._nbytes -= ts.get_nbytes() * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) */ if (unlikely(__pyx_cur_scope->__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 5007, __pyx_L1_error) } __pyx_t_10 = __Pyx_PySet_Remove(__pyx_cur_scope->__pyx_v_ts->_who_has, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 5007, __pyx_L1_error) /* "distributed/scheduler.py":5008 * for ts in tasks: * ts._who_has.remove(ws) * ws._nbytes -= ts.get_nbytes() # <<<<<<<<<<<<<< * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) * */ __pyx_t_11 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_cur_scope->__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5008, __pyx_L1_error) __pyx_cur_scope->__pyx_v_ws->_nbytes = (__pyx_cur_scope->__pyx_v_ws->_nbytes - __pyx_t_11); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5009 * ts._who_has.remove(ws) * ws._nbytes -= ts.get_nbytes() * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) # <<<<<<<<<<<<<< * * async def rebalance(self, comm=None, keys=None, workers=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_action, __pyx_kp_u_remove_worker_data) < 0) __PYX_ERR(0, 5009, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_keys, __pyx_cur_scope->__pyx_v_keys) < 0) __PYX_ERR(0, 5009, __pyx_L1_error) __pyx_t_1 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_ws->_address, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5009, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_ws->_address, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5009, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ws->_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ws->_address); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_cur_scope->__pyx_v_ws->_address); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":4987 * return d[worker] * * async def _delete_worker_data(self, worker_address, keys): # <<<<<<<<<<<<<< * """Delete data from a worker and update the corresponding worker/task states * */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("_delete_worker_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_123generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5011 * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) * * async def rebalance(self, comm=None, keys=None, workers=None): # <<<<<<<<<<<<<< * """Rebalance keys so that each worker stores roughly equal bytes * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_122rebalance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_121rebalance[] = "Rebalance keys so that each worker stores roughly equal bytes\n\n **Policy**\n\n This orders the workers by what fraction of bytes of the existing keys\n they have. It walks down this list from most-to-least. At each worker\n it sends the largest results it can find and sends them to the least\n occupied worker until either the sender or the recipient are at the\n average expected load.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_122rebalance = {"rebalance", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_122rebalance, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_121rebalance}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_122rebalance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_workers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rebalance (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_workers,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rebalance") < 0)) __PYX_ERR(0, 5011, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_workers = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rebalance", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5011, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_121rebalance(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_workers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_9genexpr77_2generator36(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5049 * * worker_bytes = { * ws: sum(ts.get_nbytes() for ts in v) # <<<<<<<<<<<<<< * for ws, v in tasks_by_worker.items() * } */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_9genexpr77_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_35_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_35_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5049, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_9genexpr77_2generator36, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_rebalance_locals_genex, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5049, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_9genexpr77_2generator36(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5049, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr77__pyx_v_v)) { __Pyx_RaiseClosureNameError("v"); __PYX_ERR(0, 5049, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr77__pyx_v_v)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr77__pyx_v_v)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr77__pyx_v_v; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr77__pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5049, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 5049, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 5049, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5049, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ts); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ts, __pyx_n_s_get_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5049, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5088 * break * * to_recipients = defaultdict(lambda: defaultdict(list)) # <<<<<<<<<<<<<< * to_senders = defaultdict(list) * for sender, recipient, ts in msgs: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_9rebalance_lambda14(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_9rebalance_lambda14 = {"lambda14", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_9rebalance_lambda14, METH_NOARGS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_9rebalance_lambda14(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda14 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda14(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda14(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda14", 0); __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance.lambda14", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_3generator37(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5096 * result = await asyncio.gather( * *( * retry_operation(self.rpc(addr=r).gather, who_has=v) # <<<<<<<<<<<<<< * for r, v in to_recipients.items() * ) */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_1genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_36_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_36_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5096, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_3generator37, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_rebalance_locals_genex, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_3generator37(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5096, __pyx_L1_error) /* "distributed/scheduler.py":5097 * *( * retry_operation(self.rpc(addr=r).gather, who_has=v) * for r, v in to_recipients.items() # <<<<<<<<<<<<<< * ) * ) */ __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_recipients)) { __Pyx_RaiseClosureNameError("to_recipients"); __PYX_ERR(0, 5097, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_recipients == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5097, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_recipients, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5096 * result = await asyncio.gather( * *( * retry_operation(self.rpc(addr=r).gather, who_has=v) # <<<<<<<<<<<<<< * for r, v in to_recipients.items() * ) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_retry_operation); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 5096, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_addr, __pyx_cur_scope->__pyx_v_r) < 0) __PYX_ERR(0, 5096, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_gather); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_who_has, __pyx_cur_scope->__pyx_v_v) < 0) __PYX_ERR(0, 5096, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5096, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_6generator38(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5114 * ) * * if not all(r["status"] == "OK" for r in result): # <<<<<<<<<<<<<< * return { * "status": "missing-data", */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_4genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_37_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_37_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5114, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_6generator38, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_rebalance_locals_genex, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5114, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_6generator38(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5114, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_result)) { __Pyx_RaiseClosureNameError("result"); __PYX_ERR(0, 5114, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_result)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_result)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5114, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 5114, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 5114, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5114, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_r, __pyx_n_u_status); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_OK, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } } /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_9generator39(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5119 * "keys": tuple( * concat( * r["keys"].keys() # <<<<<<<<<<<<<< * for r in result * if r["status"] == "missing-data" */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_7genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_38_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_38_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5119, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_9generator39, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_rebalance_locals_genex, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5119, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_9generator39(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L7_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5119, __pyx_L1_error) /* "distributed/scheduler.py":5120 * concat( * r["keys"].keys() * for r in result # <<<<<<<<<<<<<< * if r["status"] == "missing-data" * ) */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_result)) { __Pyx_RaiseClosureNameError("result"); __PYX_ERR(0, 5120, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_result)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_result)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5120, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 5120, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 5120, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5120, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":5121 * r["keys"].keys() * for r in result * if r["status"] == "missing-data" # <<<<<<<<<<<<<< * ) * ), */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_r, __pyx_n_u_status); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_missing_data, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":5119 * "keys": tuple( * concat( * r["keys"].keys() # <<<<<<<<<<<<<< * for r in result * if r["status"] == "missing-data" */ __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_r, __pyx_n_u_keys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_keys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5119, __pyx_L1_error) /* "distributed/scheduler.py":5121 * r["keys"].keys() * for r in result * if r["status"] == "missing-data" # <<<<<<<<<<<<<< * ) * ), */ } /* "distributed/scheduler.py":5120 * concat( * r["keys"].keys() * for r in result # <<<<<<<<<<<<<< * if r["status"] == "missing-data" * ) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":5119 * "keys": tuple( * concat( * r["keys"].keys() # <<<<<<<<<<<<<< * for r in result * if r["status"] == "missing-data" */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_12generator40(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5142 * * await asyncio.gather( * *(self._delete_worker_data(r, v) for r, v in to_senders.items()) # <<<<<<<<<<<<<< * ) * */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_10genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_39_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_39_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5142, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_12generator40, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_rebalance_locals_genex, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5142, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9rebalance_12generator40(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5142, __pyx_L1_error) __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_senders)) { __Pyx_RaiseClosureNameError("to_senders"); __PYX_ERR(0, 5142, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_senders == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5142, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_senders, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 5142, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_delete_worker_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_r, __pyx_cur_scope->__pyx_v_v}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5142, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_r, __pyx_cur_scope->__pyx_v_v}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5142, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_r); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_cur_scope->__pyx_v_r); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_v); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_v); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_cur_scope->__pyx_v_v); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5142, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5011 * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) * * async def rebalance(self, comm=None, keys=None, workers=None): # <<<<<<<<<<<<<< * """Rebalance keys so that each worker stores roughly equal bytes * */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_121rebalance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_workers) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rebalance", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_34_rebalance(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_34_rebalance, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5011, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_keys = __pyx_v_keys; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys); __pyx_cur_scope->__pyx_v_workers = __pyx_v_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_123generator14, __pyx_codeobj__75, (PyObject *) __pyx_cur_scope, __pyx_n_s_rebalance, __pyx_n_s_Scheduler_rebalance, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5011, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_123generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; Py_ssize_t __pyx_t_14; PyObject *(*__pyx_t_15)(PyObject *); Py_ssize_t __pyx_t_16; int __pyx_t_17; int __pyx_t_18; int __pyx_t_19; Py_ssize_t __pyx_t_20; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *(*__pyx_t_25)(PyObject *); int __pyx_t_26; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; PyObject *__pyx_t_29 = NULL; PyObject *__pyx_t_30 = NULL; PyObject *__pyx_t_31 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rebalance", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L15_resume_from_await; case 2: goto __pyx_L75_resume_from_await; case 3: goto __pyx_L83_resume_from_await; case 4: goto __pyx_L87_resume_from_await; case 5: goto __pyx_L88_resume_from_await; case 6: goto __pyx_L89_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5011, __pyx_L1_error) /* "distributed/scheduler.py":5022 * average expected load. * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState * with log_errors(): */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5024 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState * with log_errors(): # <<<<<<<<<<<<<< * async with self._lock: * if keys: */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5024, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5024, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":5025 * ts: TaskState * with log_errors(): * async with self._lock: # <<<<<<<<<<<<<< * if keys: * tasks = {parent._tasks[k] for k in keys} */ /*with:*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5025, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_aexit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5025, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_aenter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5025, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5025, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_5 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L15_resume_from_await:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5025, __pyx_L14_error) __pyx_t_2 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_2 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_2) < 0) __PYX_ERR(0, 5025, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "distributed/scheduler.py":5026 * with log_errors(): * async with self._lock: * if keys: # <<<<<<<<<<<<<< * tasks = {parent._tasks[k] for k in keys} * missing_data = [ts._key for ts in tasks if not ts._who_has] */ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_keys); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 5026, __pyx_L19_error) if (__pyx_t_13) { /* "distributed/scheduler.py":5027 * async with self._lock: * if keys: * tasks = {parent._tasks[k] for k in keys} # <<<<<<<<<<<<<< * missing_data = [ts._key for ts in tasks if not ts._who_has] * if missing_data: */ { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5027, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_14 = 0; __pyx_t_15 = NULL; } else { __pyx_t_14 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5027, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5027, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 5027, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5027, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 5027, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5027, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_15(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5027, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr71__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr71__pyx_v_k, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5027, __pyx_L19_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_cur_scope->__pyx_9genexpr71__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5027, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5027, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_tasks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5028 * if keys: * tasks = {parent._tasks[k] for k in keys} * missing_data = [ts._key for ts in tasks if not ts._who_has] # <<<<<<<<<<<<<< * if missing_data: * return {"status": "missing-data", "keys": missing_data} */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5028, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_tasks, 1, (&__pyx_t_16), (&__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5028, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_18 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_16, &__pyx_t_14, &__pyx_t_3, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5028, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5028, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr72__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr72__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_13 = (__pyx_cur_scope->__pyx_9genexpr72__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_cur_scope->__pyx_9genexpr72__pyx_v_ts->_who_has) != 0); __pyx_t_19 = ((!__pyx_t_13) != 0); if (__pyx_t_19) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr72__pyx_v_ts->_key))) __PYX_ERR(0, 5028, __pyx_L19_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_missing_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5029 * tasks = {parent._tasks[k] for k in keys} * missing_data = [ts._key for ts in tasks if not ts._who_has] * if missing_data: # <<<<<<<<<<<<<< * return {"status": "missing-data", "keys": missing_data} * else: */ __pyx_t_19 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_missing_data) != 0); if (__pyx_t_19) { /* "distributed/scheduler.py":5030 * missing_data = [ts._key for ts in tasks if not ts._who_has] * if missing_data: * return {"status": "missing-data", "keys": missing_data} # <<<<<<<<<<<<<< * else: * tasks = set(parent._tasks.values()) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5030, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_status, __pyx_kp_u_missing_data) < 0) __PYX_ERR(0, 5030, __pyx_L19_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_keys, __pyx_cur_scope->__pyx_v_missing_data) < 0) __PYX_ERR(0, 5030, __pyx_L19_error) __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L23_try_return; /* "distributed/scheduler.py":5029 * tasks = {parent._tasks[k] for k in keys} * missing_data = [ts._key for ts in tasks if not ts._who_has] * if missing_data: # <<<<<<<<<<<<<< * return {"status": "missing-data", "keys": missing_data} * else: */ } /* "distributed/scheduler.py":5026 * with log_errors(): * async with self._lock: * if keys: # <<<<<<<<<<<<<< * tasks = {parent._tasks[k] for k in keys} * missing_data = [ts._key for ts in tasks if not ts._who_has] */ goto __pyx_L25; } /* "distributed/scheduler.py":5032 * return {"status": "missing-data", "keys": missing_data} * else: * tasks = set(parent._tasks.values()) # <<<<<<<<<<<<<< * * if workers: */ /*else*/ { if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 5032, __pyx_L19_error) } __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_v_parent->_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5032, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5032, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_tasks = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L25:; /* "distributed/scheduler.py":5034 * tasks = set(parent._tasks.values()) * * if workers: # <<<<<<<<<<<<<< * workers = {parent._workers_dv[w] for w in workers} * workers_by_task = {ts: ts._who_has & workers for ts in tasks} */ __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_workers); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 5034, __pyx_L19_error) if (__pyx_t_19) { /* "distributed/scheduler.py":5035 * * if workers: * workers = {parent._workers_dv[w] for w in workers} # <<<<<<<<<<<<<< * workers_by_task = {ts: ts._who_has & workers for ts in tasks} * else: */ { /* enter inner scope */ __pyx_t_2 = PySet_New(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5035, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_1); __pyx_t_16 = 0; __pyx_t_15 = NULL; } else { __pyx_t_16 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5035, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_15 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5035, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5035, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5035, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5035, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5035, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_15(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5035, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr73__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr73__pyx_v_w, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5035, __pyx_L19_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_workers_dv, __pyx_cur_scope->__pyx_9genexpr73__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5035, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PySet_Add(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5035, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5036 * if workers: * workers = {parent._workers_dv[w] for w in workers} * workers_by_task = {ts: ts._who_has & workers for ts in tasks} # <<<<<<<<<<<<<< * else: * workers = set(parent._workers_dv.values()) */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5036, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_16 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_tasks, 1, (&__pyx_t_14), (&__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5036, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_18 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_14, &__pyx_t_16, &__pyx_t_3, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5036, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5036, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr74__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr74__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_And(__pyx_cur_scope->__pyx_9genexpr74__pyx_v_ts->_who_has, __pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5036, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_cur_scope->__pyx_9genexpr74__pyx_v_ts, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5036, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_workers_by_task = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5034 * tasks = set(parent._tasks.values()) * * if workers: # <<<<<<<<<<<<<< * workers = {parent._workers_dv[w] for w in workers} * workers_by_task = {ts: ts._who_has & workers for ts in tasks} */ goto __pyx_L32; } /* "distributed/scheduler.py":5038 * workers_by_task = {ts: ts._who_has & workers for ts in tasks} * else: * workers = set(parent._workers_dv.values()) # <<<<<<<<<<<<<< * workers_by_task = {ts: ts._who_has for ts in tasks} * */ /*else*/ { if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 5038, __pyx_L19_error) } __pyx_t_2 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_v_parent->_workers_dv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5038, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5038, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5039 * else: * workers = set(parent._workers_dv.values()) * workers_by_task = {ts: ts._who_has for ts in tasks} # <<<<<<<<<<<<<< * * ws: WorkerState */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5039, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_tasks, 1, (&__pyx_t_16), (&__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5039, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_18 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_16, &__pyx_t_14, &__pyx_t_3, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5039, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5039, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr75__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr75__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr75__pyx_v_ts, (PyObject*)__pyx_cur_scope->__pyx_9genexpr75__pyx_v_ts->_who_has))) __PYX_ERR(0, 5039, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_workers_by_task = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L32:; /* "distributed/scheduler.py":5042 * * ws: WorkerState * tasks_by_worker = {ws: set() for ws in workers} # <<<<<<<<<<<<<< * * for k, v in workers_by_task.items(): */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5042, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_2); __pyx_t_16 = 0; __pyx_t_15 = NULL; } else { __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5042, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5042, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5042, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5042, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5042, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5042, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_15(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5042, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5042, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr76__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr76__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5042, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr76__pyx_v_ws, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5042, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_tasks_by_worker = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5044 * tasks_by_worker = {ws: set() for ws in workers} * * for k, v in workers_by_task.items(): # <<<<<<<<<<<<<< * for vv in v: * tasks_by_worker[vv].add(k) */ __pyx_t_16 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_workers_by_task, 1, __pyx_n_s_items, (&__pyx_t_14), (&__pyx_t_17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5044, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_14, &__pyx_t_16, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5044, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5045 * * for k, v in workers_by_task.items(): * for vv in v: # <<<<<<<<<<<<<< * tasks_by_worker[vv].add(k) * */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_v)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_v)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_v; __Pyx_INCREF(__pyx_t_3); __pyx_t_20 = 0; __pyx_t_15 = NULL; } else { __pyx_t_20 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5045, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5045, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_20 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_20); __Pyx_INCREF(__pyx_t_2); __pyx_t_20++; if (unlikely(0 < 0)) __PYX_ERR(0, 5045, __pyx_L19_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5045, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_20 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_20); __Pyx_INCREF(__pyx_t_2); __pyx_t_20++; if (unlikely(0 < 0)) __PYX_ERR(0, 5045, __pyx_L19_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5045, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_15(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5045, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_vv); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_vv, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5046 * for k, v in workers_by_task.items(): * for vv in v: * tasks_by_worker[vv].add(k) # <<<<<<<<<<<<<< * * worker_bytes = { */ __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_tasks_by_worker, __pyx_cur_scope->__pyx_v_vv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5046, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_add); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5046, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_21))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_21, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_21, __pyx_t_5, __pyx_cur_scope->__pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_21, __pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5046, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5045 * * for k, v in workers_by_task.items(): * for vv in v: # <<<<<<<<<<<<<< * tasks_by_worker[vv].add(k) * */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5048 * tasks_by_worker[vv].add(k) * * worker_bytes = { # <<<<<<<<<<<<<< * ws: sum(ts.get_nbytes() for ts in v) * for ws, v in tasks_by_worker.items() */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5048, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5050 * worker_bytes = { * ws: sum(ts.get_nbytes() for ts in v) * for ws, v in tasks_by_worker.items() # <<<<<<<<<<<<<< * } * */ __pyx_t_14 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_tasks_by_worker, 1, __pyx_n_s_items, (&__pyx_t_16), (&__pyx_t_17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5050, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_16, &__pyx_t_14, &__pyx_t_2, &__pyx_t_21, NULL, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5050, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_21); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5050, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr77__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr77__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr77__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr77__pyx_v_v, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5049 * * worker_bytes = { * ws: sum(ts.get_nbytes() for ts in v) # <<<<<<<<<<<<<< * for ws, v in tasks_by_worker.items() * } */ __pyx_t_21 = __pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_9genexpr77_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5049, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5049, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr77__pyx_v_ws, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 5049, __pyx_L19_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_worker_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5053 * } * * avg = sum(worker_bytes.values()) / len(worker_bytes) # <<<<<<<<<<<<<< * * sorted_workers = list( */ __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_v_worker_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5053, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5053, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_16 = PyDict_Size(__pyx_cur_scope->__pyx_v_worker_bytes); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5053, __pyx_L19_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5053, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5053, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_avg = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":5056 * * sorted_workers = list( * map(first, sorted(worker_bytes.items(), key=second, reverse=True)) # <<<<<<<<<<<<<< * ) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_first); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_worker_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_second); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_21) < 0) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reverse, Py_True) < 0) __PYX_ERR(0, 5056, __pyx_L19_error) __pyx_t_21 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_21); __pyx_t_2 = 0; __pyx_t_21 = 0; __pyx_t_21 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5056, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5055 * avg = sum(worker_bytes.values()) / len(worker_bytes) * * sorted_workers = list( # <<<<<<<<<<<<<< * map(first, sorted(worker_bytes.items(), key=second, reverse=True)) * ) */ __pyx_t_1 = PySequence_List(__pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5055, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_sorted_workers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5059 * ) * * recipients = iter(reversed(sorted_workers)) # <<<<<<<<<<<<<< * recipient = next(recipients) * msgs = [] # (sender, recipient, key) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_cur_scope->__pyx_v_sorted_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5059, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_21 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5059, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_v_recipients = __pyx_t_21; __pyx_t_21 = 0; /* "distributed/scheduler.py":5060 * * recipients = iter(reversed(sorted_workers)) * recipient = next(recipients) # <<<<<<<<<<<<<< * msgs = [] # (sender, recipient, key) * for sender in sorted_workers[: len(workers) // 2]: */ __pyx_t_21 = __Pyx_PyIter_Next(__pyx_cur_scope->__pyx_v_recipients); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5060, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_v_recipient = __pyx_t_21; __pyx_t_21 = 0; /* "distributed/scheduler.py":5061 * recipients = iter(reversed(sorted_workers)) * recipient = next(recipients) * msgs = [] # (sender, recipient, key) # <<<<<<<<<<<<<< * for sender in sorted_workers[: len(workers) // 2]: * sender_keys = { */ __pyx_t_21 = PyList_New(0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5061, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_v_msgs = ((PyObject*)__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5062 * recipient = next(recipients) * msgs = [] # (sender, recipient, key) * for sender in sorted_workers[: len(workers) // 2]: # <<<<<<<<<<<<<< * sender_keys = { * ts: ts.get_nbytes() for ts in tasks_by_worker[sender] */ __pyx_t_16 = PyObject_Length(__pyx_cur_scope->__pyx_v_workers); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5062, __pyx_L19_error) __pyx_t_21 = __Pyx_PyList_GetSlice(__pyx_cur_scope->__pyx_v_sorted_workers, 0, __Pyx_div_Py_ssize_t(__pyx_t_16, 2)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5062, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_1 = __pyx_t_21; __Pyx_INCREF(__pyx_t_1); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; for (;;) { if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_21 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_21); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5062, __pyx_L19_error) #else __pyx_t_21 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5062, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sender); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sender, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5063 * msgs = [] # (sender, recipient, key) * for sender in sorted_workers[: len(workers) // 2]: * sender_keys = { # <<<<<<<<<<<<<< * ts: ts.get_nbytes() for ts in tasks_by_worker[sender] * } */ { /* enter inner scope */ __pyx_t_21 = PyDict_New(); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5063, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); /* "distributed/scheduler.py":5064 * for sender in sorted_workers[: len(workers) // 2]: * sender_keys = { * ts: ts.get_nbytes() for ts in tasks_by_worker[sender] # <<<<<<<<<<<<<< * } * sender_keys = iter( */ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_tasks_by_worker, __pyx_cur_scope->__pyx_v_sender); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5064, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0; __pyx_t_15 = NULL; } else { __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5064, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5064, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_2); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 5064, __pyx_L19_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5064, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_2); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 5064, __pyx_L19_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5064, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_15(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5064, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_2); } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5064, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr79__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr79__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_20 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_cur_scope->__pyx_9genexpr79__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5064, __pyx_L19_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5064, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_t_21, (PyObject*)__pyx_cur_scope->__pyx_9genexpr79__pyx_v_ts, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 5064, __pyx_L19_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sender_keys); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sender_keys, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5067 * } * sender_keys = iter( * sorted(sender_keys.items(), key=second, reverse=True) # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_sender_keys, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5067, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_21 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5067, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5067, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_21); __pyx_t_21 = 0; __pyx_t_21 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5067, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_second); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5067, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_21, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 5067, __pyx_L19_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_21, __pyx_n_s_reverse, Py_True) < 0) __PYX_ERR(0, 5067, __pyx_L19_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5067, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5066 * ts: ts.get_nbytes() for ts in tasks_by_worker[sender] * } * sender_keys = iter( # <<<<<<<<<<<<<< * sorted(sender_keys.items(), key=second, reverse=True) * ) */ __pyx_t_21 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5066, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_sender_keys); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_sender_keys, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5070 * ) * * try: # <<<<<<<<<<<<<< * while worker_bytes[sender] > avg: * while ( */ { __Pyx_ExceptionSave(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); /*try:*/ { /* "distributed/scheduler.py":5071 * * try: * while worker_bytes[sender] > avg: # <<<<<<<<<<<<<< * while ( * worker_bytes[recipient] < avg */ while (1) { __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_worker_bytes, __pyx_cur_scope->__pyx_v_sender); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5071, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_2 = PyObject_RichCompare(__pyx_t_21, __pyx_cur_scope->__pyx_v_avg, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5071, __pyx_L51_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 5071, __pyx_L51_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_19) break; /* "distributed/scheduler.py":5072 * try: * while worker_bytes[sender] > avg: * while ( # <<<<<<<<<<<<<< * worker_bytes[recipient] < avg * and worker_bytes[sender] > avg */ while (1) { /* "distributed/scheduler.py":5073 * while worker_bytes[sender] > avg: * while ( * worker_bytes[recipient] < avg # <<<<<<<<<<<<<< * and worker_bytes[sender] > avg * ): */ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_worker_bytes, __pyx_cur_scope->__pyx_v_recipient); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5073, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_21 = PyObject_RichCompare(__pyx_t_2, __pyx_cur_scope->__pyx_v_avg, Py_LT); __Pyx_XGOTREF(__pyx_t_21); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5073, __pyx_L51_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_21); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 5073, __pyx_L51_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (__pyx_t_13) { } else { __pyx_t_19 = __pyx_t_13; goto __pyx_L63_bool_binop_done; } /* "distributed/scheduler.py":5074 * while ( * worker_bytes[recipient] < avg * and worker_bytes[sender] > avg # <<<<<<<<<<<<<< * ): * ts, nb = next(sender_keys) */ __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_worker_bytes, __pyx_cur_scope->__pyx_v_sender); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5074, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_2 = PyObject_RichCompare(__pyx_t_21, __pyx_cur_scope->__pyx_v_avg, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5074, __pyx_L51_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 5074, __pyx_L51_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_19 = __pyx_t_13; __pyx_L63_bool_binop_done:; if (!__pyx_t_19) break; /* "distributed/scheduler.py":5076 * and worker_bytes[sender] > avg * ): * ts, nb = next(sender_keys) # <<<<<<<<<<<<<< * if ts not in tasks_by_worker[recipient]: * tasks_by_worker[recipient].add(ts) */ __pyx_t_2 = __Pyx_PyIter_Next(__pyx_cur_scope->__pyx_v_sender_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5076, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 5076, __pyx_L51_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_21 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_21 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_21 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5076, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5076, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5076, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_25 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_21 = __pyx_t_25(__pyx_t_5); if (unlikely(!__pyx_t_21)) goto __pyx_L65_unpacking_failed; __Pyx_GOTREF(__pyx_t_21); index = 1; __pyx_t_3 = __pyx_t_25(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L65_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_25(__pyx_t_5), 2) < 0) __PYX_ERR(0, 5076, __pyx_L51_error) __pyx_t_25 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L66_unpacking_done; __pyx_L65_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_25 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 5076, __pyx_L51_error) __pyx_L66_unpacking_done:; } if (!(likely(((__pyx_t_21) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_21, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5076, __pyx_L51_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_21)); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_nb); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_nb, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5077 * ): * ts, nb = next(sender_keys) * if ts not in tasks_by_worker[recipient]: # <<<<<<<<<<<<<< * tasks_by_worker[recipient].add(ts) * # tasks_by_worker[sender].remove(ts) */ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_tasks_by_worker, __pyx_cur_scope->__pyx_v_recipient); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5077, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_19 = (__Pyx_PySequence_ContainsTF(((PyObject *)__pyx_cur_scope->__pyx_v_ts), __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 5077, __pyx_L51_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = (__pyx_t_19 != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":5078 * ts, nb = next(sender_keys) * if ts not in tasks_by_worker[recipient]: * tasks_by_worker[recipient].add(ts) # <<<<<<<<<<<<<< * # tasks_by_worker[sender].remove(ts) * msgs.append((sender, recipient, ts)) */ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_tasks_by_worker, __pyx_cur_scope->__pyx_v_recipient); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5078, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5078, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_21))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_21, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_21, __pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_21, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5078, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5080 * tasks_by_worker[recipient].add(ts) * # tasks_by_worker[sender].remove(ts) * msgs.append((sender, recipient, ts)) # <<<<<<<<<<<<<< * worker_bytes[sender] -= nb * worker_bytes[recipient] += nb */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5080, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sender); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_sender); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_sender); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_recipient); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_recipient); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_recipient); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __pyx_t_26 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_msgs, __pyx_t_2); if (unlikely(__pyx_t_26 == ((int)-1))) __PYX_ERR(0, 5080, __pyx_L51_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5081 * # tasks_by_worker[sender].remove(ts) * msgs.append((sender, recipient, ts)) * worker_bytes[sender] -= nb # <<<<<<<<<<<<<< * worker_bytes[recipient] += nb * if worker_bytes[sender] > avg: */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sender); __pyx_t_2 = __pyx_cur_scope->__pyx_v_sender; __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_worker_bytes, __pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5081, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_21, __pyx_cur_scope->__pyx_v_nb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5081, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_worker_bytes, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(0, 5081, __pyx_L51_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5082 * msgs.append((sender, recipient, ts)) * worker_bytes[sender] -= nb * worker_bytes[recipient] += nb # <<<<<<<<<<<<<< * if worker_bytes[sender] > avg: * recipient = next(recipients) */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_recipient); __pyx_t_2 = __pyx_cur_scope->__pyx_v_recipient; __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_worker_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5082, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_cur_scope->__pyx_v_nb); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5082, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_worker_bytes, __pyx_t_2, __pyx_t_21) < 0)) __PYX_ERR(0, 5082, __pyx_L51_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5077 * ): * ts, nb = next(sender_keys) * if ts not in tasks_by_worker[recipient]: # <<<<<<<<<<<<<< * tasks_by_worker[recipient].add(ts) * # tasks_by_worker[sender].remove(ts) */ } } /* "distributed/scheduler.py":5083 * worker_bytes[sender] -= nb * worker_bytes[recipient] += nb * if worker_bytes[sender] > avg: # <<<<<<<<<<<<<< * recipient = next(recipients) * except StopIteration: */ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_worker_bytes, __pyx_cur_scope->__pyx_v_sender); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5083, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_21 = PyObject_RichCompare(__pyx_t_2, __pyx_cur_scope->__pyx_v_avg, Py_GT); __Pyx_XGOTREF(__pyx_t_21); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5083, __pyx_L51_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_21); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 5083, __pyx_L51_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (__pyx_t_13) { /* "distributed/scheduler.py":5084 * worker_bytes[recipient] += nb * if worker_bytes[sender] > avg: * recipient = next(recipients) # <<<<<<<<<<<<<< * except StopIteration: * break */ __pyx_t_21 = __Pyx_PyIter_Next(__pyx_cur_scope->__pyx_v_recipients); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5084, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_recipient); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_recipient, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5083 * worker_bytes[sender] -= nb * worker_bytes[recipient] += nb * if worker_bytes[sender] > avg: # <<<<<<<<<<<<<< * recipient = next(recipients) * except StopIteration: */ } } /* "distributed/scheduler.py":5070 * ) * * try: # <<<<<<<<<<<<<< * while worker_bytes[sender] > avg: * while ( */ } __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; goto __pyx_L58_try_end; __pyx_L51_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5085 * if worker_bytes[sender] > avg: * recipient = next(recipients) * except StopIteration: # <<<<<<<<<<<<<< * break * */ __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_17) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_21, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 5085, __pyx_L53_except_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":5086 * recipient = next(recipients) * except StopIteration: * break # <<<<<<<<<<<<<< * * to_recipients = defaultdict(lambda: defaultdict(list)) */ goto __pyx_L69_except_break; __pyx_L69_except_break:; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L56_try_break; } goto __pyx_L53_except_error; __pyx_L53_except_error:; /* "distributed/scheduler.py":5070 * ) * * try: # <<<<<<<<<<<<<< * while worker_bytes[sender] > avg: * while ( */ __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); goto __pyx_L19_error; __pyx_L56_try_break:; __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); goto __pyx_L48_break; __pyx_L58_try_end:; } /* "distributed/scheduler.py":5062 * recipient = next(recipients) * msgs = [] # (sender, recipient, key) * for sender in sorted_workers[: len(workers) // 2]: # <<<<<<<<<<<<<< * sender_keys = { * ts: ts.get_nbytes() for ts in tasks_by_worker[sender] */ } __pyx_L48_break:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5088 * break * * to_recipients = defaultdict(lambda: defaultdict(list)) # <<<<<<<<<<<<<< * to_senders = defaultdict(list) * for sender, recipient, ts in msgs: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5088, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_9rebalance_lambda14, 0, __pyx_n_s_Scheduler_rebalance_locals_lambd, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5088, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_21 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_21) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_21, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5088, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_to_recipients = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5089 * * to_recipients = defaultdict(lambda: defaultdict(list)) * to_senders = defaultdict(list) # <<<<<<<<<<<<<< * for sender, recipient, ts in msgs: * to_recipients[recipient.address][ts._key].append(sender.address) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5089, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5089, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_to_senders = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5090 * to_recipients = defaultdict(lambda: defaultdict(list)) * to_senders = defaultdict(list) * for sender, recipient, ts in msgs: # <<<<<<<<<<<<<< * to_recipients[recipient.address][ts._key].append(sender.address) * to_senders[sender.address].append(ts._key) */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_msgs; __Pyx_INCREF(__pyx_t_1); __pyx_t_16 = 0; for (;;) { if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5090, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5090, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 5090, __pyx_L19_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_21 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_21 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5090, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_21 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5090, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5090, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_27 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5090, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_25 = Py_TYPE(__pyx_t_27)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_25(__pyx_t_27); if (unlikely(!__pyx_t_2)) goto __pyx_L73_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_21 = __pyx_t_25(__pyx_t_27); if (unlikely(!__pyx_t_21)) goto __pyx_L73_unpacking_failed; __Pyx_GOTREF(__pyx_t_21); index = 2; __pyx_t_5 = __pyx_t_25(__pyx_t_27); if (unlikely(!__pyx_t_5)) goto __pyx_L73_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_25(__pyx_t_27), 3) < 0) __PYX_ERR(0, 5090, __pyx_L19_error) __pyx_t_25 = NULL; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; goto __pyx_L74_unpacking_done; __pyx_L73_unpacking_failed:; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_25 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 5090, __pyx_L19_error) __pyx_L74_unpacking_done:; } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5090, __pyx_L19_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sender); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sender, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_recipient); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_recipient, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5091 * to_senders = defaultdict(list) * for sender, recipient, ts in msgs: * to_recipients[recipient.address][ts._key].append(sender.address) # <<<<<<<<<<<<<< * to_senders[sender.address].append(ts._key) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_recipient, __pyx_n_s_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5091, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_to_recipients, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5091, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_cur_scope->__pyx_v_ts->_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5091, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_sender, __pyx_n_s_address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5091, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_26 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_t_5); if (unlikely(__pyx_t_26 == ((int)-1))) __PYX_ERR(0, 5091, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5092 * for sender, recipient, ts in msgs: * to_recipients[recipient.address][ts._key].append(sender.address) * to_senders[sender.address].append(ts._key) # <<<<<<<<<<<<<< * * result = await asyncio.gather( */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_sender, __pyx_n_s_address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5092, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_to_senders, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5092, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_26 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_cur_scope->__pyx_v_ts->_key); if (unlikely(__pyx_t_26 == ((int)-1))) __PYX_ERR(0, 5092, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5090 * to_recipients = defaultdict(lambda: defaultdict(list)) * to_senders = defaultdict(list) * for sender, recipient, ts in msgs: # <<<<<<<<<<<<<< * to_recipients[recipient.address][ts._key].append(sender.address) * to_senders[sender.address].append(ts._key) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5094 * to_senders[sender.address].append(ts._key) * * result = await asyncio.gather( # <<<<<<<<<<<<<< * *( * retry_operation(self.rpc(addr=r).gather, who_has=v) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5094, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_gather); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5094, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5096 * result = await asyncio.gather( * *( * retry_operation(self.rpc(addr=r).gather, who_has=v) # <<<<<<<<<<<<<< * for r, v in to_recipients.items() * ) */ __pyx_t_1 = __pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_1genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5096, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5094 * to_senders[sender.address].append(ts._key) * * result = await asyncio.gather( # <<<<<<<<<<<<<< * *( * retry_operation(self.rpc(addr=r).gather, who_has=v) */ __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5094, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5094, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_4 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_5 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_6 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_7 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L75_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5094, __pyx_L19_error) __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_1 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 5094, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5100 * ) * ) * for r, v in to_recipients.items(): # <<<<<<<<<<<<<< * self.log_event(r, {"action": "rebalance", "who_has": v}) * */ __pyx_t_16 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_to_recipients == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5100, __pyx_L19_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_to_recipients, 0, __pyx_n_s_items, (&__pyx_t_14), (&__pyx_t_17)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5100, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_14, &__pyx_t_16, &__pyx_t_5, &__pyx_t_3, NULL, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5100, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5101 * ) * for r, v in to_recipients.items(): * self.log_event(r, {"action": "rebalance", "who_has": v}) # <<<<<<<<<<<<<< * * self.log_event( */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5101, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_21 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5101, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); if (PyDict_SetItem(__pyx_t_21, __pyx_n_u_action, __pyx_n_u_rebalance) < 0) __PYX_ERR(0, 5101, __pyx_L19_error) if (PyDict_SetItem(__pyx_t_21, __pyx_n_u_who_has, __pyx_cur_scope->__pyx_v_v) < 0) __PYX_ERR(0, 5101, __pyx_L19_error) __pyx_t_2 = NULL; __pyx_t_18 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_18 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_r, __pyx_t_21}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5101, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_r, __pyx_t_21}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5101, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } else #endif { __pyx_t_27 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5101, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_r); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_27, 0+__pyx_t_18, __pyx_cur_scope->__pyx_v_r); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_27, 1+__pyx_t_18, __pyx_t_21); __pyx_t_21 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5101, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5103 * self.log_event(r, {"action": "rebalance", "who_has": v}) * * self.log_event( # <<<<<<<<<<<<<< * "all", * { */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5103, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":5106 * "all", * { * "action": "rebalance", # <<<<<<<<<<<<<< * "total-keys": len(tasks), * "senders": valmap(len, to_senders), */ __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5106, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_action, __pyx_n_u_rebalance) < 0) __PYX_ERR(0, 5106, __pyx_L19_error) /* "distributed/scheduler.py":5107 * { * "action": "rebalance", * "total-keys": len(tasks), # <<<<<<<<<<<<<< * "senders": valmap(len, to_senders), * "recipients": valmap(len, to_recipients), */ __pyx_t_14 = PySet_GET_SIZE(__pyx_cur_scope->__pyx_v_tasks); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5107, __pyx_L19_error) __pyx_t_27 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5107, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_total_keys, __pyx_t_27) < 0) __PYX_ERR(0, 5106, __pyx_L19_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; /* "distributed/scheduler.py":5108 * "action": "rebalance", * "total-keys": len(tasks), * "senders": valmap(len, to_senders), # <<<<<<<<<<<<<< * "recipients": valmap(len, to_recipients), * "moved_keys": len(msgs), */ __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_valmap); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5108, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5108, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_28 = NULL; __pyx_t_17 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) { __pyx_t_28 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_28)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_28); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_21, function); __pyx_t_17 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_21)) { PyObject *__pyx_temp[3] = {__pyx_t_28, __pyx_t_2, __pyx_cur_scope->__pyx_v_to_senders}; __pyx_t_27 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5108, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) { PyObject *__pyx_temp[3] = {__pyx_t_28, __pyx_t_2, __pyx_cur_scope->__pyx_v_to_senders}; __pyx_t_27 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5108, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_29 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 5108, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_29); if (__pyx_t_28) { __Pyx_GIVEREF(__pyx_t_28); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_28); __pyx_t_28 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_29, 0+__pyx_t_17, __pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_to_senders); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_to_senders); PyTuple_SET_ITEM(__pyx_t_29, 1+__pyx_t_17, __pyx_cur_scope->__pyx_v_to_senders); __pyx_t_2 = 0; __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_29, NULL); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5108, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; } __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_senders, __pyx_t_27) < 0) __PYX_ERR(0, 5106, __pyx_L19_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; /* "distributed/scheduler.py":5109 * "total-keys": len(tasks), * "senders": valmap(len, to_senders), * "recipients": valmap(len, to_recipients), # <<<<<<<<<<<<<< * "moved_keys": len(msgs), * }, */ __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_valmap); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5109, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_29 = __Pyx_GetBuiltinName(__pyx_n_s_len); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 5109, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_2 = NULL; __pyx_t_17 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_21, function); __pyx_t_17 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_21)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_29, __pyx_cur_scope->__pyx_v_to_recipients}; __pyx_t_27 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5109, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_29, __pyx_cur_scope->__pyx_v_to_recipients}; __pyx_t_27 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5109, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; } else #endif { __pyx_t_28 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 5109, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_28); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_28, 0+__pyx_t_17, __pyx_t_29); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_to_recipients); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_to_recipients); PyTuple_SET_ITEM(__pyx_t_28, 1+__pyx_t_17, __pyx_cur_scope->__pyx_v_to_recipients); __pyx_t_29 = 0; __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_28, NULL); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5109, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; } __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_recipients, __pyx_t_27) < 0) __PYX_ERR(0, 5106, __pyx_L19_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; /* "distributed/scheduler.py":5110 * "senders": valmap(len, to_senders), * "recipients": valmap(len, to_recipients), * "moved_keys": len(msgs), # <<<<<<<<<<<<<< * }, * ) */ __pyx_t_14 = PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_msgs); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5110, __pyx_L19_error) __pyx_t_27 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5110, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_moved_keys, __pyx_t_27) < 0) __PYX_ERR(0, 5106, __pyx_L19_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_27 = NULL; __pyx_t_17 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_27 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_27)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_27); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_17 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_27, __pyx_n_u_all, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5103, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_27, __pyx_n_u_all, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5103, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_21 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5103, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); if (__pyx_t_27) { __Pyx_GIVEREF(__pyx_t_27); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_27); __pyx_t_27 = NULL; } __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_17, __pyx_n_u_all); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_17, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5103, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5114 * ) * * if not all(r["status"] == "OK" for r in result): # <<<<<<<<<<<<<< * return { * "status": "missing-data", */ __pyx_t_1 = __pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_4genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5114, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5114, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 5114, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_19 = ((!__pyx_t_13) != 0); if (__pyx_t_19) { /* "distributed/scheduler.py":5115 * * if not all(r["status"] == "OK" for r in result): * return { # <<<<<<<<<<<<<< * "status": "missing-data", * "keys": tuple( */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":5116 * if not all(r["status"] == "OK" for r in result): * return { * "status": "missing-data", # <<<<<<<<<<<<<< * "keys": tuple( * concat( */ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5116, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_status, __pyx_kp_u_missing_data) < 0) __PYX_ERR(0, 5116, __pyx_L19_error) /* "distributed/scheduler.py":5118 * "status": "missing-data", * "keys": tuple( * concat( # <<<<<<<<<<<<<< * r["keys"].keys() * for r in result */ __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_concat); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5118, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); /* "distributed/scheduler.py":5119 * "keys": tuple( * concat( * r["keys"].keys() # <<<<<<<<<<<<<< * for r in result * if r["status"] == "missing-data" */ __pyx_t_5 = __pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_7genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5119, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_27 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) { __pyx_t_27 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_27)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_27); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_21, function); } } __pyx_t_1 = (__pyx_t_27) ? __Pyx_PyObject_Call2Args(__pyx_t_21, __pyx_t_27, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_21, __pyx_t_5); __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5118, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5117 * return { * "status": "missing-data", * "keys": tuple( # <<<<<<<<<<<<<< * concat( * r["keys"].keys() */ __pyx_t_21 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5117, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_keys, __pyx_t_21) < 0) __PYX_ERR(0, 5116, __pyx_L19_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L23_try_return; /* "distributed/scheduler.py":5114 * ) * * if not all(r["status"] == "OK" for r in result): # <<<<<<<<<<<<<< * return { * "status": "missing-data", */ } /* "distributed/scheduler.py":5126 * } * * for sender, recipient, ts in msgs: # <<<<<<<<<<<<<< * assert ts._state == "memory" * ts._who_has.add(recipient) */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_msgs; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0; for (;;) { if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_21 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_21); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 5126, __pyx_L19_error) #else __pyx_t_21 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5126, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); #endif if ((likely(PyTuple_CheckExact(__pyx_t_21))) || (PyList_CheckExact(__pyx_t_21))) { PyObject* sequence = __pyx_t_21; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 5126, __pyx_L19_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_27 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_27 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_27); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5126, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5126, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_27 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5126, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); #endif __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } else { Py_ssize_t index = -1; __pyx_t_28 = PyObject_GetIter(__pyx_t_21); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 5126, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_25 = Py_TYPE(__pyx_t_28)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_25(__pyx_t_28); if (unlikely(!__pyx_t_1)) goto __pyx_L81_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_25(__pyx_t_28); if (unlikely(!__pyx_t_5)) goto __pyx_L81_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_27 = __pyx_t_25(__pyx_t_28); if (unlikely(!__pyx_t_27)) goto __pyx_L81_unpacking_failed; __Pyx_GOTREF(__pyx_t_27); if (__Pyx_IternextUnpackEndCheck(__pyx_t_25(__pyx_t_28), 3) < 0) __PYX_ERR(0, 5126, __pyx_L19_error) __pyx_t_25 = NULL; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; goto __pyx_L82_unpacking_done; __pyx_L81_unpacking_failed:; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __pyx_t_25 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 5126, __pyx_L19_error) __pyx_L82_unpacking_done:; } if (!(likely(((__pyx_t_27) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_27, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5126, __pyx_L19_error) __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sender); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sender, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_recipient); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_recipient, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_27)); __Pyx_GIVEREF(__pyx_t_27); __pyx_t_27 = 0; /* "distributed/scheduler.py":5127 * * for sender, recipient, ts in msgs: * assert ts._state == "memory" # <<<<<<<<<<<<<< * ts._who_has.add(recipient) * recipient.has_what.add(ts) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_19 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_ts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 5127, __pyx_L19_error) if (unlikely(!(__pyx_t_19 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 5127, __pyx_L19_error) } } #endif /* "distributed/scheduler.py":5128 * for sender, recipient, ts in msgs: * assert ts._state == "memory" * ts._who_has.add(recipient) # <<<<<<<<<<<<<< * recipient.has_what.add(ts) * recipient.nbytes += ts.get_nbytes() */ if (unlikely(__pyx_cur_scope->__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 5128, __pyx_L19_error) } __pyx_t_26 = PySet_Add(__pyx_cur_scope->__pyx_v_ts->_who_has, __pyx_cur_scope->__pyx_v_recipient); if (unlikely(__pyx_t_26 == ((int)-1))) __PYX_ERR(0, 5128, __pyx_L19_error) /* "distributed/scheduler.py":5129 * assert ts._state == "memory" * ts._who_has.add(recipient) * recipient.has_what.add(ts) # <<<<<<<<<<<<<< * recipient.nbytes += ts.get_nbytes() * self.log.append( */ __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_recipient, __pyx_n_s_has_what); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5129, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5129, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_27 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_27 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_27)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_27); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_21 = (__pyx_t_27) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_27, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5129, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5130 * ts._who_has.add(recipient) * recipient.has_what.add(ts) * recipient.nbytes += ts.get_nbytes() # <<<<<<<<<<<<<< * self.log.append( * ( */ __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_recipient, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5130, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_16 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_cur_scope->__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5130, __pyx_L19_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5130, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_27 = PyNumber_InPlaceAdd(__pyx_t_21, __pyx_t_5); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5130, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_recipient, __pyx_n_s_nbytes, __pyx_t_27) < 0) __PYX_ERR(0, 5130, __pyx_L19_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; /* "distributed/scheduler.py":5131 * recipient.has_what.add(ts) * recipient.nbytes += ts.get_nbytes() * self.log.append( # <<<<<<<<<<<<<< * ( * "rebalance", */ __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5131, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); /* "distributed/scheduler.py":5135 * "rebalance", * ts._key, * time(), # <<<<<<<<<<<<<< * sender.address, * recipient.address, */ __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_time); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5135, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_21, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_21, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_21); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5135, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; /* "distributed/scheduler.py":5136 * ts._key, * time(), * sender.address, # <<<<<<<<<<<<<< * recipient.address, * ) */ __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_sender, __pyx_n_s_address); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5136, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_21); /* "distributed/scheduler.py":5137 * time(), * sender.address, * recipient.address, # <<<<<<<<<<<<<< * ) * ) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_recipient, __pyx_n_s_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5137, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5133 * self.log.append( * ( * "rebalance", # <<<<<<<<<<<<<< * ts._key, * time(), */ __pyx_t_28 = PyTuple_New(5); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 5133, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_INCREF(__pyx_n_u_rebalance); __Pyx_GIVEREF(__pyx_n_u_rebalance); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_n_u_rebalance); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ts->_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ts->_key); PyTuple_SET_ITEM(__pyx_t_28, 1, __pyx_cur_scope->__pyx_v_ts->_key); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_28, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_28, 3, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_28, 4, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_21 = 0; __pyx_t_1 = 0; /* "distributed/scheduler.py":5131 * recipient.has_what.add(ts) * recipient.nbytes += ts.get_nbytes() * self.log.append( # <<<<<<<<<<<<<< * ( * "rebalance", */ __pyx_t_26 = __Pyx_PyObject_Append(__pyx_t_27, __pyx_t_28); if (unlikely(__pyx_t_26 == ((int)-1))) __PYX_ERR(0, 5131, __pyx_L19_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; /* "distributed/scheduler.py":5126 * } * * for sender, recipient, ts in msgs: # <<<<<<<<<<<<<< * assert ts._state == "memory" * ts._who_has.add(recipient) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5141 * ) * * await asyncio.gather( # <<<<<<<<<<<<<< * *(self._delete_worker_data(r, v) for r, v in to_senders.items()) * ) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5141, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_28 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_gather); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 5141, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5142 * * await asyncio.gather( * *(self._delete_worker_data(r, v) for r, v in to_senders.items()) # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __pyx_pf_11distributed_9scheduler_9Scheduler_9rebalance_10genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5142, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":5141 * ) * * await asyncio.gather( # <<<<<<<<<<<<<< * *(self._delete_worker_data(r, v) for r, v in to_senders.items()) * ) */ __pyx_t_27 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 5141, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_28, __pyx_t_27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5141, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_4 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_5 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_6 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_7 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L83_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5141, __pyx_L19_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 5141, __pyx_L19_error) } } /* "distributed/scheduler.py":5145 * ) * * return {"status": "OK"} # <<<<<<<<<<<<<< * * async def replicate( */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5145, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_status, __pyx_n_u_OK) < 0) __PYX_ERR(0, 5145, __pyx_L19_error) __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L23_try_return; /* "distributed/scheduler.py":5025 * ts: TaskState * with log_errors(): * async with self._lock: # <<<<<<<<<<<<<< * if keys: * tasks = {parent._tasks[k] for k in keys} */ } __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_27, &__pyx_t_28) < 0) __PYX_ERR(0, 5025, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_27); __Pyx_GOTREF(__pyx_t_28); __pyx_t_1 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_27, __pyx_t_28); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5025, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5025, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_24); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_5 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_6 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_7 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_8 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_9 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_27); __pyx_cur_scope->__pyx_t_10 = __pyx_t_27; __Pyx_XGIVEREF(__pyx_t_28); __pyx_cur_scope->__pyx_t_11 = __pyx_t_28; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_SwapException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L87_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_24 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_27 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_27); __pyx_t_28 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_28); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5025, __pyx_L21_except_error) __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_1 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 5025, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_24 = __pyx_t_1; __pyx_t_1 = 0; __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (__pyx_t_19 < 0) __PYX_ERR(0, 5025, __pyx_L21_except_error) __pyx_t_13 = ((!(__pyx_t_19 != 0)) != 0); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_27, __pyx_t_28); __pyx_t_3 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __PYX_ERR(0, 5025, __pyx_L21_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; goto __pyx_L20_exception_handled; } __pyx_L21_except_error:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L8_error; __pyx_L23_try_return:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L16_return; __pyx_L20_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_9) { __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5025, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_4 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_5 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L88_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_12 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5025, __pyx_L8_error) __pyx_t_28 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_28); } else { __pyx_t_28 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_28) < 0) __PYX_ERR(0, 5025, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_28); } __pyx_t_12 = __pyx_t_28; __pyx_t_28 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } goto __pyx_L18; } __pyx_L16_return: { __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_30 = __pyx_r; __pyx_r = 0; if (__pyx_t_9) { __pyx_t_31 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 5025, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_31); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_31); __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_4 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_5 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_6 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_7 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_8 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_9 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_10 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_30); __pyx_cur_scope->__pyx_t_11 = __pyx_t_30; __Pyx_XGIVEREF(__pyx_t_31); __pyx_cur_scope->__pyx_t_12 = __pyx_t_31; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 6; return __pyx_r; __pyx_L89_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_22 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_30 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_30); __pyx_t_31 = __pyx_cur_scope->__pyx_t_12; __pyx_cur_scope->__pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_t_31); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5025, __pyx_L8_error) __pyx_t_28 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_28); } else { __pyx_t_28 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_28) < 0) __PYX_ERR(0, 5025, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_28); } __pyx_t_31 = __pyx_t_28; __pyx_t_28 = 0; __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; } __pyx_r = __pyx_t_30; __pyx_t_30 = 0; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10); __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; goto __pyx_L12_try_return; } __pyx_L18:; } goto __pyx_L90; __pyx_L14_error:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_error; __pyx_L90:; } /* "distributed/scheduler.py":5024 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState * with log_errors(): # <<<<<<<<<<<<<< * async with self._lock: * if keys: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.rebalance", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_28, &__pyx_t_27, &__pyx_t_3) < 0) __PYX_ERR(0, 5024, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_GOTREF(__pyx_t_27); __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_Pack(3, __pyx_t_28, __pyx_t_27, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5024, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5024, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_13 < 0) __PYX_ERR(0, 5024, __pyx_L10_except_error) __pyx_t_19 = ((!(__pyx_t_13 != 0)) != 0); if (__pyx_t_19) { __Pyx_GIVEREF(__pyx_t_28); __Pyx_GIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_28, __pyx_t_27, __pyx_t_3); __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 5024, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L12_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L5_return; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L7; } __pyx_L5_return: { __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_9 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_22, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_r; __pyx_r = 0; if (__pyx_t_4) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_24; __pyx_t_24 = 0; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_22, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_9 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; goto __pyx_L0; } __pyx_L7:; } goto __pyx_L94; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L94:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":5011 * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) * * async def rebalance(self, comm=None, keys=None, workers=None): # <<<<<<<<<<<<<< * """Rebalance keys so that each worker stores roughly equal bytes * */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_21); __Pyx_XDECREF(__pyx_t_27); __Pyx_XDECREF(__pyx_t_28); __Pyx_XDECREF(__pyx_t_29); __Pyx_AddTraceback("rebalance", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_126generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5147 * return {"status": "OK"} * * async def replicate( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_125replicate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_124replicate[] = "Replicate data throughout cluster\n\n This performs a tree copy of the data throughout the network\n individually on each piece of data.\n\n Parameters\n ----------\n keys: Iterable\n list of keys to replicate\n n: int\n Number of replications we expect to see within the cluster\n branching_factor: int, optional\n The number of workers that can copy data in each generation.\n The larger the branching factor, the more data we copy in\n a single step, but the more a given worker risks being\n swamped by data requests.\n\n See also\n --------\n Scheduler.rebalance\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_125replicate = {"replicate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_125replicate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_124replicate}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_125replicate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_n = 0; PyObject *__pyx_v_workers = 0; PyObject *__pyx_v_branching_factor = 0; PyObject *__pyx_v_delete = 0; PyObject *__pyx_v_lock = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("replicate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_n,&__pyx_n_s_workers,&__pyx_n_s_branching_factor,&__pyx_n_s_delete,&__pyx_n_s_lock_2,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":5149 * async def replicate( * self, * comm=None, # <<<<<<<<<<<<<< * keys=None, * n=None, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5150 * self, * comm=None, * keys=None, # <<<<<<<<<<<<<< * n=None, * workers=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5151 * comm=None, * keys=None, * n=None, # <<<<<<<<<<<<<< * workers=None, * branching_factor=2, */ values[3] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5152 * keys=None, * n=None, * workers=None, # <<<<<<<<<<<<<< * branching_factor=2, * delete=True, */ values[4] = ((PyObject *)((PyObject *)Py_None)); values[5] = ((PyObject *)((PyObject *)__pyx_int_2)); /* "distributed/scheduler.py":5154 * workers=None, * branching_factor=2, * delete=True, # <<<<<<<<<<<<<< * lock=True, * ): */ values[6] = ((PyObject *)((PyObject *)Py_True)); /* "distributed/scheduler.py":5155 * branching_factor=2, * delete=True, * lock=True, # <<<<<<<<<<<<<< * ): * """Replicate data throughout cluster */ values[7] = ((PyObject *)((PyObject *)Py_True)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_branching_factor); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delete); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lock_2); if (value) { values[7] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replicate") < 0)) __PYX_ERR(0, 5147, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_n = values[3]; __pyx_v_workers = values[4]; __pyx_v_branching_factor = values[5]; __pyx_v_delete = values[6]; __pyx_v_lock = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("replicate", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5147, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.replicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_124replicate(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_n, __pyx_v_workers, __pyx_v_branching_factor, __pyx_v_delete, __pyx_v_lock); /* "distributed/scheduler.py":5147 * return {"status": "OK"} * * async def replicate( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9replicate_2generator41(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5240 * results = await asyncio.gather( * *( * retry_operation(self.rpc(addr=w).gather, who_has=who_has) # <<<<<<<<<<<<<< * for w, who_has in gathers.items() * ) */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_9replicate_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_41_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_41_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5240, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_9replicate_2generator41, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_replicate_locals_genex, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.replicate.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_9replicate_2generator41(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5240, __pyx_L1_error) /* "distributed/scheduler.py":5241 * *( * retry_operation(self.rpc(addr=w).gather, who_has=who_has) * for w, who_has in gathers.items() # <<<<<<<<<<<<<< * ) * ) */ __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_gathers)) { __Pyx_RaiseClosureNameError("gathers"); __PYX_ERR(0, 5241, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_gathers == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5241, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_gathers, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_w, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_who_has); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_who_has, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5240 * results = await asyncio.gather( * *( * retry_operation(self.rpc(addr=w).gather, who_has=who_has) # <<<<<<<<<<<<<< * for w, who_has in gathers.items() * ) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_retry_operation); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 5240, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_addr, __pyx_cur_scope->__pyx_v_w) < 0) __PYX_ERR(0, 5240, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_gather); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_who_has, __pyx_cur_scope->__pyx_v_who_has) < 0) __PYX_ERR(0, 5240, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5240, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5147 * return {"status": "OK"} * * async def replicate( # <<<<<<<<<<<<<< * self, * comm=None, */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_124replicate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_n, PyObject *__pyx_v_workers, PyObject *__pyx_v_branching_factor, PyObject *__pyx_v_delete, PyObject *__pyx_v_lock) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("replicate", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_40_replicate(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_40_replicate, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5147, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_keys = __pyx_v_keys; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys); __pyx_cur_scope->__pyx_v_n = __pyx_v_n; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_n); __pyx_cur_scope->__pyx_v_workers = __pyx_v_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); __pyx_cur_scope->__pyx_v_branching_factor = __pyx_v_branching_factor; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_branching_factor); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_branching_factor); __pyx_cur_scope->__pyx_v_delete = __pyx_v_delete; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_delete); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_delete); __pyx_cur_scope->__pyx_v_lock = __pyx_v_lock; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lock); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lock); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_126generator15, __pyx_codeobj__76, (PyObject *) __pyx_cur_scope, __pyx_n_s_replicate, __pyx_n_s_Scheduler_replicate, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5147, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.replicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_126generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; Py_ssize_t __pyx_t_13; int __pyx_t_14; int __pyx_t_15; Py_ssize_t __pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_t_21; Py_ssize_t __pyx_t_22; PyObject *(*__pyx_t_23)(PyObject *); PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("replicate", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L35_resume_from_await; case 3: goto __pyx_L46_resume_from_await; case 4: goto __pyx_L55_resume_from_await; case 5: goto __pyx_L56_resume_from_await; case 6: goto __pyx_L57_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5147, __pyx_L1_error) /* "distributed/scheduler.py":5178 * Scheduler.rebalance * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * wws: WorkerState */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5183 * ts: TaskState * * assert branching_factor > 0 # <<<<<<<<<<<<<< * async with self._lock if lock else empty_context: * workers = {parent._workers_dv[w] for w in self.workers_list(workers)} */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_branching_factor, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5183, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 5183, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":5184 * * assert branching_factor > 0 * async with self._lock if lock else empty_context: # <<<<<<<<<<<<<< * workers = {parent._workers_dv[w] for w in self.workers_list(workers)} * if n is None: */ /*with:*/ { __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_lock); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5184, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_empty_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_aexit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_aenter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5184, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5184, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5184, __pyx_L4_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 5184, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "distributed/scheduler.py":5185 * assert branching_factor > 0 * async with self._lock if lock else empty_context: * workers = {parent._workers_dv[w] for w in self.workers_list(workers)} # <<<<<<<<<<<<<< * if n is None: * n = len(workers) */ { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5185, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_workers_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5185, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_workers) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_workers); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5185, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5185, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5185, __pyx_L9_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 5185, __pyx_L9_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5185, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 5185, __pyx_L9_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5185, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5185, __pyx_L9_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr84__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr84__pyx_v_w, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5185, __pyx_L9_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_workers_dv, __pyx_cur_scope->__pyx_9genexpr84__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5185, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5185, __pyx_L9_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5186 * async with self._lock if lock else empty_context: * workers = {parent._workers_dv[w] for w in self.workers_list(workers)} * if n is None: # <<<<<<<<<<<<<< * n = len(workers) * else: */ __pyx_t_2 = (__pyx_cur_scope->__pyx_v_n == Py_None); __pyx_t_12 = (__pyx_t_2 != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":5187 * workers = {parent._workers_dv[w] for w in self.workers_list(workers)} * if n is None: * n = len(workers) # <<<<<<<<<<<<<< * else: * n = min(n, len(workers)) */ __pyx_t_10 = PyObject_Length(__pyx_cur_scope->__pyx_v_workers); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5187, __pyx_L9_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5187, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_n); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5186 * async with self._lock if lock else empty_context: * workers = {parent._workers_dv[w] for w in self.workers_list(workers)} * if n is None: # <<<<<<<<<<<<<< * n = len(workers) * else: */ goto __pyx_L17; } /* "distributed/scheduler.py":5189 * n = len(workers) * else: * n = min(n, len(workers)) # <<<<<<<<<<<<<< * if n == 0: * raise ValueError("Can not use replicate to delete data") */ /*else*/ { __pyx_t_10 = PyObject_Length(__pyx_cur_scope->__pyx_v_workers); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5189, __pyx_L9_error) __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n); __pyx_t_1 = __pyx_cur_scope->__pyx_v_n; __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5189, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5189, __pyx_L9_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5189, __pyx_L9_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_12) { __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5189, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_n); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L17:; /* "distributed/scheduler.py":5190 * else: * n = min(n, len(workers)) * if n == 0: # <<<<<<<<<<<<<< * raise ValueError("Can not use replicate to delete data") * */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_cur_scope->__pyx_v_n, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5190, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5190, __pyx_L9_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_12)) { /* "distributed/scheduler.py":5191 * n = min(n, len(workers)) * if n == 0: * raise ValueError("Can not use replicate to delete data") # <<<<<<<<<<<<<< * * tasks = {parent._tasks[k] for k in keys} */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5191, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 5191, __pyx_L9_error) /* "distributed/scheduler.py":5190 * else: * n = min(n, len(workers)) * if n == 0: # <<<<<<<<<<<<<< * raise ValueError("Can not use replicate to delete data") * */ } /* "distributed/scheduler.py":5193 * raise ValueError("Can not use replicate to delete data") * * tasks = {parent._tasks[k] for k in keys} # <<<<<<<<<<<<<< * missing_data = [ts._key for ts in tasks if not ts._who_has] * if missing_data: */ { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5193, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5193, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5193, __pyx_L9_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 5193, __pyx_L9_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5193, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 5193, __pyx_L9_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5193, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5193, __pyx_L9_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr85__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr85__pyx_v_k, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5193, __pyx_L9_error) } __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_cur_scope->__pyx_9genexpr85__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5193, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 5193, __pyx_L9_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_tasks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5194 * * tasks = {parent._tasks[k] for k in keys} * missing_data = [ts._key for ts in tasks if not ts._who_has] # <<<<<<<<<<<<<< * if missing_data: * return {"status": "missing-data", "keys": missing_data} */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5194, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_tasks, 1, (&__pyx_t_13), (&__pyx_t_14)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5194, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_15 = __Pyx_set_iter_next(__pyx_t_5, __pyx_t_13, &__pyx_t_10, &__pyx_t_6, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5194, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5194, __pyx_L9_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr86__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr86__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = (__pyx_cur_scope->__pyx_9genexpr86__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_cur_scope->__pyx_9genexpr86__pyx_v_ts->_who_has) != 0); __pyx_t_2 = ((!__pyx_t_12) != 0); if (__pyx_t_2) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr86__pyx_v_ts->_key))) __PYX_ERR(0, 5194, __pyx_L9_error) } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_missing_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5195 * tasks = {parent._tasks[k] for k in keys} * missing_data = [ts._key for ts in tasks if not ts._who_has] * if missing_data: # <<<<<<<<<<<<<< * return {"status": "missing-data", "keys": missing_data} * */ __pyx_t_2 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_missing_data) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":5196 * missing_data = [ts._key for ts in tasks if not ts._who_has] * if missing_data: * return {"status": "missing-data", "keys": missing_data} # <<<<<<<<<<<<<< * * # Delete extraneous data */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5196, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_status, __pyx_kp_u_missing_data) < 0) __PYX_ERR(0, 5196, __pyx_L9_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_keys, __pyx_cur_scope->__pyx_v_missing_data) < 0) __PYX_ERR(0, 5196, __pyx_L9_error) __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L13_try_return; /* "distributed/scheduler.py":5195 * tasks = {parent._tasks[k] for k in keys} * missing_data = [ts._key for ts in tasks if not ts._who_has] * if missing_data: # <<<<<<<<<<<<<< * return {"status": "missing-data", "keys": missing_data} * */ } /* "distributed/scheduler.py":5199 * * # Delete extraneous data * if delete: # <<<<<<<<<<<<<< * del_worker_tasks = defaultdict(set) * for ts in tasks: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_delete); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5199, __pyx_L9_error) if (__pyx_t_2) { /* "distributed/scheduler.py":5200 * # Delete extraneous data * if delete: * del_worker_tasks = defaultdict(set) # <<<<<<<<<<<<<< * for ts in tasks: * del_candidates = ts._who_has & workers */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5200, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, ((PyObject *)(&PySet_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)(&PySet_Type))); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5200, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_del_worker_tasks = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5201 * if delete: * del_worker_tasks = defaultdict(set) * for ts in tasks: # <<<<<<<<<<<<<< * del_candidates = ts._who_has & workers * if len(del_candidates) > n: */ __pyx_t_13 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_tasks, 1, (&__pyx_t_10), (&__pyx_t_14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5201, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_15 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_13, &__pyx_t_5, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5201, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5201, __pyx_L9_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5202 * del_worker_tasks = defaultdict(set) * for ts in tasks: * del_candidates = ts._who_has & workers # <<<<<<<<<<<<<< * if len(del_candidates) > n: * for ws in random.sample( */ __pyx_t_5 = PyNumber_And(__pyx_cur_scope->__pyx_v_ts->_who_has, __pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5202, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_del_candidates); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_del_candidates, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5203 * for ts in tasks: * del_candidates = ts._who_has & workers * if len(del_candidates) > n: # <<<<<<<<<<<<<< * for ws in random.sample( * del_candidates, len(del_candidates) - n */ __pyx_t_16 = PyObject_Length(__pyx_cur_scope->__pyx_v_del_candidates); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5203, __pyx_L9_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5203, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_cur_scope->__pyx_v_n, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5203, __pyx_L9_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5203, __pyx_L9_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":5204 * del_candidates = ts._who_has & workers * if len(del_candidates) > n: * for ws in random.sample( # <<<<<<<<<<<<<< * del_candidates, len(del_candidates) - n * ): */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_random); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sample); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5205 * if len(del_candidates) > n: * for ws in random.sample( * del_candidates, len(del_candidates) - n # <<<<<<<<<<<<<< * ): * del_worker_tasks[ws].add(ts) */ __pyx_t_16 = PyObject_Length(__pyx_cur_scope->__pyx_v_del_candidates); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5205, __pyx_L9_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5205, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_17 = PyNumber_Subtract(__pyx_t_5, __pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5205, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_del_candidates, __pyx_t_17}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_del_candidates, __pyx_t_17}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } else #endif { __pyx_t_18 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_del_candidates); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_del_candidates); PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_15, __pyx_cur_scope->__pyx_v_del_candidates); __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_15, __pyx_t_17); __pyx_t_17 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5204 * del_candidates = ts._who_has & workers * if len(del_candidates) > n: * for ws in random.sample( # <<<<<<<<<<<<<< * del_candidates, len(del_candidates) - n * ): */ if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_16 = 0; __pyx_t_11 = NULL; } else { __pyx_t_16 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5204, __pyx_L9_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5204, __pyx_L9_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5204, __pyx_L9_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5204, __pyx_L9_error) } break; } __Pyx_GOTREF(__pyx_t_6); } if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5204, __pyx_L9_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_6)); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5207 * del_candidates, len(del_candidates) - n * ): * del_worker_tasks[ws].add(ts) # <<<<<<<<<<<<<< * * await asyncio.gather( */ __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_del_worker_tasks, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5207, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_add); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5207, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); } } __pyx_t_6 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_18, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_17, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5207, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5204 * del_candidates = ts._who_has & workers * if len(del_candidates) > n: * for ws in random.sample( # <<<<<<<<<<<<<< * del_candidates, len(del_candidates) - n * ): */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5203 * for ts in tasks: * del_candidates = ts._who_has & workers * if len(del_candidates) > n: # <<<<<<<<<<<<<< * for ws in random.sample( * del_candidates, len(del_candidates) - n */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5209 * del_worker_tasks[ws].add(ts) * * await asyncio.gather( # <<<<<<<<<<<<<< * *[ * self._delete_worker_data(ws._address, [t.key for t in tasks]) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5209, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_gather); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5209, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ /* "distributed/scheduler.py":5210 * * await asyncio.gather( * *[ # <<<<<<<<<<<<<< * self._delete_worker_data(ws._address, [t.key for t in tasks]) * for ws, tasks in del_worker_tasks.items() */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5212 * *[ * self._delete_worker_data(ws._address, [t.key for t in tasks]) * for ws, tasks in del_worker_tasks.items() # <<<<<<<<<<<<<< * ] * ) */ __pyx_t_10 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_del_worker_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5212, __pyx_L9_error) } __pyx_t_17 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_del_worker_tasks, 0, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_14)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5212, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_17; __pyx_t_17 = 0; while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_13, &__pyx_t_10, &__pyx_t_17, &__pyx_t_18, NULL, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5212, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GOTREF(__pyx_t_18); if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5212, __pyx_L9_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr87__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr87__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_17)); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr87__pyx_v_tasks); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr87__pyx_v_tasks, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":5211 * await asyncio.gather( * *[ * self._delete_worker_data(ws._address, [t.key for t in tasks]) # <<<<<<<<<<<<<< * for ws, tasks in del_worker_tasks.items() * ] */ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_delete_worker_data); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_17); { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_9genexpr87__pyx_v_tasks)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_9genexpr87__pyx_v_tasks)) { __pyx_t_19 = __pyx_cur_scope->__pyx_9genexpr87__pyx_v_tasks; __Pyx_INCREF(__pyx_t_19); __pyx_t_16 = 0; __pyx_t_11 = NULL; } else { __pyx_t_16 = -1; __pyx_t_19 = PyObject_GetIter(__pyx_cur_scope->__pyx_9genexpr87__pyx_v_tasks); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_11 = Py_TYPE(__pyx_t_19)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5211, __pyx_L9_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_19))) { if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_19)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_20 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_16); __Pyx_INCREF(__pyx_t_20); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5211, __pyx_L9_error) #else __pyx_t_20 = PySequence_ITEM(__pyx_t_19, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); #endif } else { if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_19)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_20 = PyTuple_GET_ITEM(__pyx_t_19, __pyx_t_16); __Pyx_INCREF(__pyx_t_20); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5211, __pyx_L9_error) #else __pyx_t_20 = PySequence_ITEM(__pyx_t_19, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); #endif } } else { __pyx_t_20 = __pyx_t_11(__pyx_t_19); if (unlikely(!__pyx_t_20)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5211, __pyx_L9_error) } break; } __Pyx_GOTREF(__pyx_t_20); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr88__pyx_v_t); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr88__pyx_v_t, __pyx_t_20); __Pyx_GIVEREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr88__pyx_v_t, __pyx_n_s_key); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_20))) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } /* exit inner scope */ __pyx_t_19 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_19)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_17)) { PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_cur_scope->__pyx_9genexpr87__pyx_v_ws->_address, __pyx_t_5}; __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) { PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_cur_scope->__pyx_9genexpr87__pyx_v_ws->_address, __pyx_t_5}; __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_20 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); if (__pyx_t_19) { __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_9genexpr87__pyx_v_ws->_address); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_9genexpr87__pyx_v_ws->_address); PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_15, __pyx_cur_scope->__pyx_9genexpr87__pyx_v_ws->_address); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_15, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_20, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5211, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_18))) __PYX_ERR(0, 5210, __pyx_L9_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* exit inner scope */ /* "distributed/scheduler.py":5209 * del_worker_tasks[ws].add(ts) * * await asyncio.gather( # <<<<<<<<<<<<<< * *[ * self._delete_worker_data(ws._address, [t.key for t in tasks]) */ __pyx_t_6 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5209, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5209, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_3 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L35_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5209, __pyx_L9_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 5209, __pyx_L9_error) } } /* "distributed/scheduler.py":5199 * * # Delete extraneous data * if delete: # <<<<<<<<<<<<<< * del_worker_tasks = defaultdict(set) * for ts in tasks: */ } /* "distributed/scheduler.py":5217 * * # Copy not-yet-filled data * while tasks: # <<<<<<<<<<<<<< * gathers = defaultdict(dict) * for ts in list(tasks): */ while (1) { __pyx_t_2 = (PySet_GET_SIZE(__pyx_cur_scope->__pyx_v_tasks) != 0); if (!__pyx_t_2) break; /* "distributed/scheduler.py":5218 * # Copy not-yet-filled data * while tasks: * gathers = defaultdict(dict) # <<<<<<<<<<<<<< * for ts in list(tasks): * if ts._state == "forgotten": */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5218, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, ((PyObject *)(&PyDict_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)(&PyDict_Type))); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5218, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_gathers); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_gathers, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5219 * while tasks: * gathers = defaultdict(dict) * for ts in list(tasks): # <<<<<<<<<<<<<< * if ts._state == "forgotten": * # task is no longer needed by any client or dependant task */ __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5219, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5219, __pyx_L9_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5219, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); #endif if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5219, __pyx_L9_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5220 * gathers = defaultdict(dict) * for ts in list(tasks): * if ts._state == "forgotten": # <<<<<<<<<<<<<< * # task is no longer needed by any client or dependant task * tasks.remove(ts) */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_ts->_state, __pyx_n_u_forgotten, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5220, __pyx_L9_error) __pyx_t_12 = (__pyx_t_2 != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":5222 * if ts._state == "forgotten": * # task is no longer needed by any client or dependant task * tasks.remove(ts) # <<<<<<<<<<<<<< * continue * n_missing = n - len(ts._who_has & workers) */ __pyx_t_21 = __Pyx_PySet_Remove(__pyx_cur_scope->__pyx_v_tasks, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 5222, __pyx_L9_error) /* "distributed/scheduler.py":5223 * # task is no longer needed by any client or dependant task * tasks.remove(ts) * continue # <<<<<<<<<<<<<< * n_missing = n - len(ts._who_has & workers) * if n_missing <= 0: */ goto __pyx_L38_continue; /* "distributed/scheduler.py":5220 * gathers = defaultdict(dict) * for ts in list(tasks): * if ts._state == "forgotten": # <<<<<<<<<<<<<< * # task is no longer needed by any client or dependant task * tasks.remove(ts) */ } /* "distributed/scheduler.py":5224 * tasks.remove(ts) * continue * n_missing = n - len(ts._who_has & workers) # <<<<<<<<<<<<<< * if n_missing <= 0: * # Already replicated enough */ __pyx_t_1 = PyNumber_And(__pyx_cur_scope->__pyx_v_ts->_who_has, __pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5224, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5224, __pyx_L9_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5224, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5224, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n_missing); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n_missing, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5225 * continue * n_missing = n - len(ts._who_has & workers) * if n_missing <= 0: # <<<<<<<<<<<<<< * # Already replicated enough * tasks.remove(ts) */ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_n_missing, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5225, __pyx_L9_error) __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5225, __pyx_L9_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_12) { /* "distributed/scheduler.py":5227 * if n_missing <= 0: * # Already replicated enough * tasks.remove(ts) # <<<<<<<<<<<<<< * continue * */ __pyx_t_21 = __Pyx_PySet_Remove(__pyx_cur_scope->__pyx_v_tasks, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 5227, __pyx_L9_error) /* "distributed/scheduler.py":5228 * # Already replicated enough * tasks.remove(ts) * continue # <<<<<<<<<<<<<< * * count = min(n_missing, branching_factor * len(ts._who_has)) */ goto __pyx_L38_continue; /* "distributed/scheduler.py":5225 * continue * n_missing = n - len(ts._who_has & workers) * if n_missing <= 0: # <<<<<<<<<<<<<< * # Already replicated enough * tasks.remove(ts) */ } /* "distributed/scheduler.py":5230 * continue * * count = min(n_missing, branching_factor * len(ts._who_has)) # <<<<<<<<<<<<<< * assert count > 0 * */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_ts->_who_has; __Pyx_INCREF(__pyx_t_3); if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 5230, __pyx_L9_error) } __pyx_t_10 = PySet_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5230, __pyx_L9_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5230, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_branching_factor, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5230, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n_missing); __pyx_t_3 = __pyx_cur_scope->__pyx_v_n_missing; __pyx_t_17 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5230, __pyx_L9_error) __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5230, __pyx_L9_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_12) { __Pyx_INCREF(__pyx_t_1); __pyx_t_18 = __pyx_t_1; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_18; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_count, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5231 * * count = min(n_missing, branching_factor * len(ts._who_has)) * assert count > 0 # <<<<<<<<<<<<<< * * for ws in random.sample(workers - ts._who_has, count): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5231, __pyx_L9_error) __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5231, __pyx_L9_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_12)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 5231, __pyx_L9_error) } } #endif /* "distributed/scheduler.py":5233 * assert count > 0 * * for ws in random.sample(workers - ts._who_has, count): # <<<<<<<<<<<<<< * gathers[ws._address][ts._key] = [ * wws._address for wws in ts._who_has */ __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_random); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_sample); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_workers, __pyx_cur_scope->__pyx_v_ts->_who_has); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_17 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_18, __pyx_cur_scope->__pyx_v_count}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_18, __pyx_cur_scope->__pyx_v_count}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } else #endif { __pyx_t_20 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); if (__pyx_t_17) { __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17); __pyx_t_17 = NULL; } __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_14, __pyx_t_18); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_count); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_count); PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_14, __pyx_cur_scope->__pyx_v_count); __pyx_t_18 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5233, __pyx_L9_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 5233, __pyx_L9_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 5233, __pyx_L9_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5233, __pyx_L9_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5233, __pyx_L9_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5234 * * for ws in random.sample(workers - ts._who_has, count): * gathers[ws._address][ts._key] = [ # <<<<<<<<<<<<<< * wws._address for wws in ts._who_has * ] */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5234, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5235 * for ws in random.sample(workers - ts._who_has, count): * gathers[ws._address][ts._key] = [ * wws._address for wws in ts._who_has # <<<<<<<<<<<<<< * ] * */ __pyx_t_16 = 0; __pyx_t_18 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_ts->_who_has, 1, (&__pyx_t_22), (&__pyx_t_14)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5235, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = __pyx_t_18; __pyx_t_18 = 0; while (1) { __pyx_t_15 = __Pyx_set_iter_next(__pyx_t_20, __pyx_t_22, &__pyx_t_16, &__pyx_t_18, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5235, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5235, __pyx_L9_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr89__pyx_v_wws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr89__pyx_v_wws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_18)); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":5234 * * for ws in random.sample(workers - ts._who_has, count): * gathers[ws._address][ts._key] = [ # <<<<<<<<<<<<<< * wws._address for wws in ts._who_has * ] */ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr89__pyx_v_wws->_address))) __PYX_ERR(0, 5234, __pyx_L9_error) } __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } /* exit inner scope */ __pyx_t_20 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_gathers, __pyx_cur_scope->__pyx_v_ws->_address); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5234, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); if (unlikely(PyObject_SetItem(__pyx_t_20, __pyx_cur_scope->__pyx_v_ts->_key, __pyx_t_1) < 0)) __PYX_ERR(0, 5234, __pyx_L9_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5233 * assert count > 0 * * for ws in random.sample(workers - ts._who_has, count): # <<<<<<<<<<<<<< * gathers[ws._address][ts._key] = [ * wws._address for wws in ts._who_has */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5219 * while tasks: * gathers = defaultdict(dict) * for ts in list(tasks): # <<<<<<<<<<<<<< * if ts._state == "forgotten": * # task is no longer needed by any client or dependant task */ __pyx_L38_continue:; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5238 * ] * * results = await asyncio.gather( # <<<<<<<<<<<<<< * *( * retry_operation(self.rpc(addr=w).gather, who_has=who_has) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5238, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_gather); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5238, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5240 * results = await asyncio.gather( * *( * retry_operation(self.rpc(addr=w).gather, who_has=who_has) # <<<<<<<<<<<<<< * for w, who_has in gathers.items() * ) */ __pyx_t_6 = __pyx_pf_11distributed_9scheduler_9Scheduler_9replicate_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5240, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); /* "distributed/scheduler.py":5238 * ] * * results = await asyncio.gather( # <<<<<<<<<<<<<< * *( * retry_operation(self.rpc(addr=w).gather, who_has=who_has) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5238, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5238, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_3 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L46_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5238, __pyx_L9_error) __pyx_t_6 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_6); } else { __pyx_t_6 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_6) < 0) __PYX_ERR(0, 5238, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_results); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_results, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5244 * ) * ) * for w, v in zip(gathers, results): # <<<<<<<<<<<<<< * if v["status"] == "OK": * self.add_keys(worker=w, keys=list(gathers[w])) */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5244, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_gathers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_gathers); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_gathers); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_results); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_results); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_v_results); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5244, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0; __pyx_t_11 = NULL; } else { __pyx_t_13 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5244, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5244, __pyx_L9_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5244, __pyx_L9_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5244, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5244, __pyx_L9_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5244, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5244, __pyx_L9_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 5244, __pyx_L9_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_20 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_20 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_20); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5244, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_20 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5244, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5244, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_23 = Py_TYPE(__pyx_t_18)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_23(__pyx_t_18); if (unlikely(!__pyx_t_3)) goto __pyx_L49_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_20 = __pyx_t_23(__pyx_t_18); if (unlikely(!__pyx_t_20)) goto __pyx_L49_unpacking_failed; __Pyx_GOTREF(__pyx_t_20); if (__Pyx_IternextUnpackEndCheck(__pyx_t_23(__pyx_t_18), 2) < 0) __PYX_ERR(0, 5244, __pyx_L9_error) __pyx_t_23 = NULL; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L50_unpacking_done; __pyx_L49_unpacking_failed:; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_23 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 5244, __pyx_L9_error) __pyx_L50_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_w, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_20); __Pyx_GIVEREF(__pyx_t_20); __pyx_t_20 = 0; /* "distributed/scheduler.py":5245 * ) * for w, v in zip(gathers, results): * if v["status"] == "OK": # <<<<<<<<<<<<<< * self.add_keys(worker=w, keys=list(gathers[w])) * else: */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_v, __pyx_n_u_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5245, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_OK, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5245, __pyx_L9_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_12) { /* "distributed/scheduler.py":5246 * for w, v in zip(gathers, results): * if v["status"] == "OK": * self.add_keys(worker=w, keys=list(gathers[w])) # <<<<<<<<<<<<<< * else: * logger.warning("Communication failed during replication: %s", v) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_add_keys_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5246, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_20 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5246, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_worker, __pyx_cur_scope->__pyx_v_w) < 0) __PYX_ERR(0, 5246, __pyx_L9_error) __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_gathers, __pyx_cur_scope->__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5246, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_18 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5246, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_keys, __pyx_t_18) < 0) __PYX_ERR(0, 5246, __pyx_L9_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_20); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5246, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":5245 * ) * for w, v in zip(gathers, results): * if v["status"] == "OK": # <<<<<<<<<<<<<< * self.add_keys(worker=w, keys=list(gathers[w])) * else: */ goto __pyx_L51; } /* "distributed/scheduler.py":5248 * self.add_keys(worker=w, keys=list(gathers[w])) * else: * logger.warning("Communication failed during replication: %s", v) # <<<<<<<<<<<<<< * * self.log_event(w, {"action": "replicate-add", "keys": gathers[w]}) */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_logger); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5248, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_warning); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5248, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_20 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_kp_u_Communication_failed_during_repl, __pyx_cur_scope->__pyx_v_v}; __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5248, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_18); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_kp_u_Communication_failed_during_repl, __pyx_cur_scope->__pyx_v_v}; __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5248, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_18); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5248, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_20) { __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20); __pyx_t_20 = NULL; } __Pyx_INCREF(__pyx_kp_u_Communication_failed_during_repl); __Pyx_GIVEREF(__pyx_kp_u_Communication_failed_during_repl); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_14, __pyx_kp_u_Communication_failed_during_repl); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_v); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_v); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_14, __pyx_cur_scope->__pyx_v_v); __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5248, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } __pyx_L51:; /* "distributed/scheduler.py":5250 * logger.warning("Communication failed during replication: %s", v) * * self.log_event(w, {"action": "replicate-add", "keys": gathers[w]}) # <<<<<<<<<<<<<< * * self.log_event( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5250, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5250, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_action, __pyx_kp_u_replicate_add) < 0) __PYX_ERR(0, 5250, __pyx_L9_error) __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_gathers, __pyx_cur_scope->__pyx_v_w); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5250, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_20); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_keys, __pyx_t_20) < 0) __PYX_ERR(0, 5250, __pyx_L9_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_20 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_cur_scope->__pyx_v_w, __pyx_t_3}; __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5250, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_cur_scope->__pyx_v_w, __pyx_t_3}; __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5250, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_17 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5250, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_17); if (__pyx_t_20) { __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_20); __pyx_t_20 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_w); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_w); PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_14, __pyx_cur_scope->__pyx_v_w); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_14, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5250, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "distributed/scheduler.py":5244 * ) * ) * for w, v in zip(gathers, results): # <<<<<<<<<<<<<< * if v["status"] == "OK": * self.add_keys(worker=w, keys=list(gathers[w])) */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "distributed/scheduler.py":5252 * self.log_event(w, {"action": "replicate-add", "keys": gathers[w]}) * * self.log_event( # <<<<<<<<<<<<<< * "all", * { */ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5252, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_18); /* "distributed/scheduler.py":5255 * "all", * { * "action": "replicate", # <<<<<<<<<<<<<< * "workers": list(workers), * "key-count": len(keys), */ __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5255, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_action, __pyx_n_u_replicate) < 0) __PYX_ERR(0, 5255, __pyx_L9_error) /* "distributed/scheduler.py":5256 * { * "action": "replicate", * "workers": list(workers), # <<<<<<<<<<<<<< * "key-count": len(keys), * "branching-factor": branching_factor, */ __pyx_t_17 = PySequence_List(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5256, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_workers, __pyx_t_17) < 0) __PYX_ERR(0, 5255, __pyx_L9_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "distributed/scheduler.py":5257 * "action": "replicate", * "workers": list(workers), * "key-count": len(keys), # <<<<<<<<<<<<<< * "branching-factor": branching_factor, * }, */ __pyx_t_13 = PyObject_Length(__pyx_cur_scope->__pyx_v_keys); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5257, __pyx_L9_error) __pyx_t_17 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5257, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_key_count, __pyx_t_17) < 0) __PYX_ERR(0, 5255, __pyx_L9_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "distributed/scheduler.py":5258 * "workers": list(workers), * "key-count": len(keys), * "branching-factor": branching_factor, # <<<<<<<<<<<<<< * }, * ) */ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_branching_factor_2, __pyx_cur_scope->__pyx_v_branching_factor) < 0) __PYX_ERR(0, 5255, __pyx_L9_error) __pyx_t_17 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_18))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_18); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_18, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_18)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_n_u_all, __pyx_t_1}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_18, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5252, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_18)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_n_u_all, __pyx_t_1}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_18, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5252, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5252, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_17) { __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_17); __pyx_t_17 = NULL; } __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_14, __pyx_n_u_all); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_14, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5252, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5184 * * assert branching_factor > 0 * async with self._lock if lock else empty_context: # <<<<<<<<<<<<<< * workers = {parent._workers_dv[w] for w in self.workers_list(workers)} * if n is None: */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L14_try_end; __pyx_L9_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.replicate", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_18, &__pyx_t_3) < 0) __PYX_ERR(0, 5184, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_18); __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_18, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5184, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5184, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_24); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_5 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_6 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_7 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_SwapException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L55_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_18 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_24 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_24); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5184, __pyx_L11_except_error) __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_1 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 5184, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_24 = __pyx_t_1; __pyx_t_1 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (__pyx_t_12 < 0) __PYX_ERR(0, 5184, __pyx_L11_except_error) __pyx_t_2 = ((!(__pyx_t_12 != 0)) != 0); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_18, __pyx_t_3); __pyx_t_6 = 0; __pyx_t_18 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 5184, __pyx_L11_except_error) } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L10_exception_handled; } __pyx_L11_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L13_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L6_return; __pyx_L10_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_1 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L56_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_9 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5184, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 5184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_9 = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L8; } __pyx_L6_return: { __Pyx_PyThreadState_assign __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __pyx_t_27 = __pyx_r; __pyx_r = 0; if (__pyx_t_4) { __pyx_t_28 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 5184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_28); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_3 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_4 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_25); __pyx_cur_scope->__pyx_t_5 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_t_26); __pyx_cur_scope->__pyx_t_6 = __pyx_t_26; __Pyx_XGIVEREF(__pyx_t_27); __pyx_cur_scope->__pyx_t_7 = __pyx_t_27; __Pyx_XGIVEREF(__pyx_t_28); __pyx_cur_scope->__pyx_t_8 = __pyx_t_28; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 6; return __pyx_r; __pyx_L57_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_24 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_25 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_25); __pyx_t_26 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_26); __pyx_t_27 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_27); __pyx_t_28 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_28); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5184, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 5184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_28 = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; } __pyx_r = __pyx_t_27; __pyx_t_27 = 0; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26); } __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_9, __pyx_t_8, __pyx_t_7); __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; goto __pyx_L0; } __pyx_L8:; } goto __pyx_L58; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L58:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":5147 * return {"status": "OK"} * * async def replicate( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("replicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5262 * ) * * def workers_to_close( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_128workers_to_close(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_127workers_to_close[] = "\n Find workers that we can close with low cost\n\n This returns a list of workers that are good candidates to retire.\n These workers are not running anything and are storing\n relatively little data relative to their peers. If all workers are\n idle then we still maintain enough workers to have enough RAM to store\n our data, with a comfortable buffer.\n\n This is for use with systems like ``distributed.deploy.adaptive``.\n\n Parameters\n ----------\n memory_factor : Number\n Amount of extra space we want to have for our stored data.\n Defaults two 2, or that we want to have twice as much memory as we\n currently have data.\n n : int\n Number of workers to close\n minimum : int\n Minimum number of workers to keep around\n key : Callable(WorkerState)\n An optional callable mapping a WorkerState object to a group\n affiliation. Groups will be closed together. This is useful when\n closing workers must be done collectively, such as by hostname.\n target : int\n Target number of workers to have after we close\n attribute : str\n The attribute of the WorkerState object to return, like \"address\"\n or \"name\". Defaults to \"address\".\n\n Examples\n --------\n >>> scheduler.workers_to_close()\n ['tcp://192.168.0.1:1234', 'tcp://192.168.0.2:1234']\n\n Group workers by hostname prior to closing\n\n >>> scheduler.workers_to_close(key=lambda ws: ws.host)\n ['tcp://192.168.0.1:1234', 'tcp://192.168.0.1:4567']\n\n Remove two workers\n\n >>> scheduler.workers_to_close(n=2)\n\n Keep enough workers to have twice as much memory as we we need.\n\n >>> scheduler.workers_to_close(memory_ratio=2)\n\n Returns\n -------\n to_close: list of worker addresses that ""are OK to close\n\n See Also\n --------\n Scheduler.retire_workers\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_128workers_to_close = {"workers_to_close", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_128workers_to_close, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_127workers_to_close}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_128workers_to_close(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_memory_ratio = 0; PyObject *__pyx_v_n = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_minimum = 0; PyObject *__pyx_v_target = 0; PyObject *__pyx_v_attribute = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("workers_to_close (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_memory_ratio,&__pyx_n_s_n,&__pyx_n_s_key,&__pyx_n_s_minimum,&__pyx_n_s_target,&__pyx_n_s_attribute,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":5264 * def workers_to_close( * self, * comm=None, # <<<<<<<<<<<<<< * memory_ratio=None, * n=None, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5265 * self, * comm=None, * memory_ratio=None, # <<<<<<<<<<<<<< * n=None, * key=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5266 * comm=None, * memory_ratio=None, * n=None, # <<<<<<<<<<<<<< * key=None, * minimum=None, */ values[3] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5267 * memory_ratio=None, * n=None, * key=None, # <<<<<<<<<<<<<< * minimum=None, * target=None, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5268 * n=None, * key=None, * minimum=None, # <<<<<<<<<<<<<< * target=None, * attribute="address", */ values[5] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5269 * key=None, * minimum=None, * target=None, # <<<<<<<<<<<<<< * attribute="address", * ): */ values[6] = ((PyObject *)((PyObject *)Py_None)); values[7] = ((PyObject *)((PyObject*)__pyx_n_u_address)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_ratio); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimum); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attribute); if (value) { values[7] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "workers_to_close") < 0)) __PYX_ERR(0, 5262, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_memory_ratio = values[2]; __pyx_v_n = values[3]; __pyx_v_key = values[4]; __pyx_v_minimum = values[5]; __pyx_v_target = values[6]; __pyx_v_attribute = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("workers_to_close", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5262, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.workers_to_close", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_127workers_to_close(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_memory_ratio, __pyx_v_n, __pyx_v_key, __pyx_v_minimum, __pyx_v_target, __pyx_v_attribute); /* "distributed/scheduler.py":5262 * ) * * def workers_to_close( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5362 * total = sum(group_bytes.values()) * * def _key(group): # <<<<<<<<<<<<<< * wws: WorkerState * is_idle = not any([wws._processing for wws in groups[group]]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_16workers_to_close_1_key(PyObject *__pyx_self, PyObject *__pyx_v_group); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_16workers_to_close_1_key = {"_key", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_16workers_to_close_1_key, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_16workers_to_close_1_key(PyObject *__pyx_self, PyObject *__pyx_v_group) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_key (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_16workers_to_close__key(__pyx_self, ((PyObject *)__pyx_v_group)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_16workers_to_close__key(PyObject *__pyx_self, PyObject *__pyx_v_group) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *__pyx_outer_scope; int __pyx_v_is_idle; PyObject *__pyx_v_bytes = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr96__pyx_v_wws = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_key", 0); __pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "distributed/scheduler.py":5364 * def _key(group): * wws: WorkerState * is_idle = not any([wws._processing for wws in groups[group]]) # <<<<<<<<<<<<<< * bytes = -group_bytes[group] * return (is_idle, bytes) */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5364, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(!__pyx_cur_scope->__pyx_v_groups)) { __Pyx_RaiseClosureNameError("groups"); __PYX_ERR(0, 5364, __pyx_L5_error) } __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_groups, __pyx_v_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5364, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5364, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5364, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5364, __pyx_L5_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5364, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5364, __pyx_L5_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5364, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5364, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_2); } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5364, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_9genexpr96__pyx_v_wws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2)); __pyx_t_2 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr96__pyx_v_wws->_processing))) __PYX_ERR(0, 5364, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr96__pyx_v_wws); __pyx_9genexpr96__pyx_v_wws = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr96__pyx_v_wws); __pyx_9genexpr96__pyx_v_wws = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_is_idle = (!__pyx_t_6); /* "distributed/scheduler.py":5365 * wws: WorkerState * is_idle = not any([wws._processing for wws in groups[group]]) * bytes = -group_bytes[group] # <<<<<<<<<<<<<< * return (is_idle, bytes) * */ if (unlikely(!__pyx_cur_scope->__pyx_v_group_bytes)) { __Pyx_RaiseClosureNameError("group_bytes"); __PYX_ERR(0, 5365, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_group_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5365, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_group_bytes, __pyx_v_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_bytes = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5366 * is_idle = not any([wws._processing for wws in groups[group]]) * bytes = -group_bytes[group] * return (is_idle, bytes) # <<<<<<<<<<<<<< * * idle = sorted(groups, key=_key) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_is_idle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_bytes); __Pyx_GIVEREF(__pyx_v_bytes); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_bytes); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5362 * total = sum(group_bytes.values()) * * def _key(group): # <<<<<<<<<<<<<< * wws: WorkerState * is_idle = not any([wws._processing for wws in groups[group]]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.workers_to_close._key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytes); __Pyx_XDECREF((PyObject *)__pyx_9genexpr96__pyx_v_wws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5262 * ) * * def workers_to_close( # <<<<<<<<<<<<<< * self, * comm=None, */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_127workers_to_close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_memory_ratio, PyObject *__pyx_v_n, PyObject *__pyx_v_key, PyObject *__pyx_v_minimum, PyObject *__pyx_v_target, PyObject *__pyx_v_attribute) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_limit_bytes = NULL; PyObject *__pyx_v_limit = NULL; PyObject *__pyx_v_total = NULL; PyObject *__pyx_v__key = 0; PyObject *__pyx_v_idle = NULL; PyObject *__pyx_v_to_close = NULL; PyObject *__pyx_v_n_remain = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_v_result = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr91__pyx_v_ws = NULL; PyObject *__pyx_9genexpr92__pyx_v_k = NULL; PyObject *__pyx_9genexpr92__pyx_v_v = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr93__pyx_v_ws = NULL; PyObject *__pyx_9genexpr94__pyx_v_k = NULL; PyObject *__pyx_9genexpr94__pyx_v_v = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr95__pyx_v_ws = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr97__pyx_v_ws = NULL; PyObject *__pyx_9genexpr98__pyx_v_g = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_9genexpr98__pyx_v_ws = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; Py_ssize_t __pyx_t_13; int __pyx_t_14; int __pyx_t_15; PyObject *__pyx_t_16 = NULL; Py_ssize_t __pyx_t_17; PyObject *(*__pyx_t_18)(PyObject *); int __pyx_t_19; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("workers_to_close", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5262, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __Pyx_INCREF(__pyx_v_memory_ratio); __Pyx_INCREF(__pyx_v_n); __Pyx_INCREF(__pyx_v_key); __Pyx_INCREF(__pyx_v_target); /* "distributed/scheduler.py":5329 * Scheduler.retire_workers * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if target is not None and n is None: * n = len(parent._workers_dv) - target */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5330 * """ * parent: SchedulerState = cast(SchedulerState, self) * if target is not None and n is None: # <<<<<<<<<<<<<< * n = len(parent._workers_dv) - target * if n is not None: */ __pyx_t_3 = (__pyx_v_target != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_n == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "distributed/scheduler.py":5331 * parent: SchedulerState = cast(SchedulerState, self) * if target is not None and n is None: * n = len(parent._workers_dv) - target # <<<<<<<<<<<<<< * if n is not None: * if n < 0: */ __pyx_t_1 = __pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 5331, __pyx_L1_error) } __pyx_t_5 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Subtract(__pyx_t_1, __pyx_v_target); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5330 * """ * parent: SchedulerState = cast(SchedulerState, self) * if target is not None and n is None: # <<<<<<<<<<<<<< * n = len(parent._workers_dv) - target * if n is not None: */ } /* "distributed/scheduler.py":5332 * if target is not None and n is None: * n = len(parent._workers_dv) - target * if n is not None: # <<<<<<<<<<<<<< * if n < 0: * n = 0 */ __pyx_t_2 = (__pyx_v_n != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5333 * n = len(parent._workers_dv) - target * if n is not None: * if n < 0: # <<<<<<<<<<<<<< * n = 0 * target = len(parent._workers_dv) - n */ __pyx_t_6 = PyObject_RichCompare(__pyx_v_n, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5333, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { /* "distributed/scheduler.py":5334 * if n is not None: * if n < 0: * n = 0 # <<<<<<<<<<<<<< * target = len(parent._workers_dv) - n * */ __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_n, __pyx_int_0); /* "distributed/scheduler.py":5333 * n = len(parent._workers_dv) - target * if n is not None: * if n < 0: # <<<<<<<<<<<<<< * n = 0 * target = len(parent._workers_dv) - n */ } /* "distributed/scheduler.py":5335 * if n < 0: * n = 0 * target = len(parent._workers_dv) - n # <<<<<<<<<<<<<< * * if n is None and memory_ratio is None: */ __pyx_t_6 = __pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 5335, __pyx_L1_error) } __pyx_t_5 = PyDict_Size(__pyx_t_6); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_target, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5332 * if target is not None and n is None: * n = len(parent._workers_dv) - target * if n is not None: # <<<<<<<<<<<<<< * if n < 0: * n = 0 */ } /* "distributed/scheduler.py":5337 * target = len(parent._workers_dv) - n * * if n is None and memory_ratio is None: # <<<<<<<<<<<<<< * memory_ratio = 2 * */ __pyx_t_2 = (__pyx_v_n == Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L9_bool_binop_done; } __pyx_t_4 = (__pyx_v_memory_ratio == Py_None); __pyx_t_2 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_2; __pyx_L9_bool_binop_done:; if (__pyx_t_3) { /* "distributed/scheduler.py":5338 * * if n is None and memory_ratio is None: * memory_ratio = 2 # <<<<<<<<<<<<<< * * ws: WorkerState */ __Pyx_INCREF(__pyx_int_2); __Pyx_DECREF_SET(__pyx_v_memory_ratio, __pyx_int_2); /* "distributed/scheduler.py":5337 * target = len(parent._workers_dv) - n * * if n is None and memory_ratio is None: # <<<<<<<<<<<<<< * memory_ratio = 2 * */ } /* "distributed/scheduler.py":5341 * * ws: WorkerState * with log_errors(): # <<<<<<<<<<<<<< * if not n and all([ws._processing for ws in parent._workers_dv.values()]): * return [] */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5341, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5341, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "distributed/scheduler.py":5342 * ws: WorkerState * with log_errors(): * if not n and all([ws._processing for ws in parent._workers_dv.values()]): # <<<<<<<<<<<<<< * return [] * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_n); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5342, __pyx_L15_error) __pyx_t_4 = ((!__pyx_t_2) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L22_bool_binop_done; } { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5342, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 5342, __pyx_L26_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_values, (&__pyx_t_13), (&__pyx_t_14)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5342, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_13, &__pyx_t_5, NULL, &__pyx_t_7, NULL, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5342, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5342, __pyx_L26_error) __Pyx_XDECREF_SET(__pyx_9genexpr91__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_7)); __pyx_t_7 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr91__pyx_v_ws->_processing))) __PYX_ERR(0, 5342, __pyx_L26_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr91__pyx_v_ws); __pyx_9genexpr91__pyx_v_ws = 0; goto __pyx_L29_exit_scope; __pyx_L26_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr91__pyx_v_ws); __pyx_9genexpr91__pyx_v_ws = 0; goto __pyx_L15_error; __pyx_L29_exit_scope:; } /* exit inner scope */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5342, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 5342, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { /* "distributed/scheduler.py":5343 * with log_errors(): * if not n and all([ws._processing for ws in parent._workers_dv.values()]): * return [] # <<<<<<<<<<<<<< * * if key is None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5343, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L19_try_return; /* "distributed/scheduler.py":5342 * ws: WorkerState * with log_errors(): * if not n and all([ws._processing for ws in parent._workers_dv.values()]): # <<<<<<<<<<<<<< * return [] * */ } /* "distributed/scheduler.py":5345 * return [] * * if key is None: # <<<<<<<<<<<<<< * key = operator.attrgetter("address") * if isinstance(key, bytes) and dask.config.get( */ __pyx_t_3 = (__pyx_v_key == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "distributed/scheduler.py":5346 * * if key is None: * key = operator.attrgetter("address") # <<<<<<<<<<<<<< * if isinstance(key, bytes) and dask.config.get( * "distributed.scheduler.pickle" */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5346, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5346, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, __pyx_n_u_address) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_u_address); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5346, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5345 * return [] * * if key is None: # <<<<<<<<<<<<<< * key = operator.attrgetter("address") * if isinstance(key, bytes) and dask.config.get( */ } /* "distributed/scheduler.py":5347 * if key is None: * key = operator.attrgetter("address") * if isinstance(key, bytes) and dask.config.get( # <<<<<<<<<<<<<< * "distributed.scheduler.pickle" * ): */ __pyx_t_3 = PyBytes_Check(__pyx_v_key); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_dask); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5347, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5347, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5347, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, __pyx_kp_u_distributed_scheduler_pickle) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_u_distributed_scheduler_pickle); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5347, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5347, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_4) { /* "distributed/scheduler.py":5350 * "distributed.scheduler.pickle" * ): * key = pickle.loads(key) # <<<<<<<<<<<<<< * * groups = groupby(key, parent._workers.values()) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pickle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5350, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_loads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5350, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_key); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5350, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5347 * if key is None: * key = operator.attrgetter("address") * if isinstance(key, bytes) and dask.config.get( # <<<<<<<<<<<<<< * "distributed.scheduler.pickle" * ): */ } /* "distributed/scheduler.py":5352 * key = pickle.loads(key) * * groups = groupby(key, parent._workers.values()) # <<<<<<<<<<<<<< * * limit_bytes = { */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_groupby); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5352, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent->_workers, __pyx_n_s_values); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5352, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_7 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_9); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5352, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_key, __pyx_t_7}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5352, __pyx_L15_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_key, __pyx_t_7}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5352, __pyx_L15_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5352, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_14, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_14, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5352, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_groups = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":5354 * groups = groupby(key, parent._workers.values()) * * limit_bytes = { # <<<<<<<<<<<<<< * k: sum([ws._memory_limit for ws in v]) for k, v in groups.items() * } */ { /* enter inner scope */ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5354, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_6); /* "distributed/scheduler.py":5355 * * limit_bytes = { * k: sum([ws._memory_limit for ws in v]) for k, v in groups.items() # <<<<<<<<<<<<<< * } * group_bytes = {k: sum([ws._nbytes for ws in v]) for k, v in groups.items()} */ __pyx_t_13 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_groups == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5355, __pyx_L36_error) } __pyx_t_16 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_groups, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_14)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5355, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_16; __pyx_t_16 = 0; while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_13, &__pyx_t_16, &__pyx_t_7, NULL, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5355, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_9genexpr92__pyx_v_k, __pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr92__pyx_v_v, __pyx_t_7); __pyx_t_7 = 0; { /* enter inner scope */ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5355, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_7); if (likely(PyList_CheckExact(__pyx_9genexpr92__pyx_v_v)) || PyTuple_CheckExact(__pyx_9genexpr92__pyx_v_v)) { __pyx_t_16 = __pyx_9genexpr92__pyx_v_v; __Pyx_INCREF(__pyx_t_16); __pyx_t_17 = 0; __pyx_t_18 = NULL; } else { __pyx_t_17 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_9genexpr92__pyx_v_v); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5355, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_18 = Py_TYPE(__pyx_t_16)->tp_iternext; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5355, __pyx_L41_error) } for (;;) { if (likely(!__pyx_t_18)) { if (likely(PyList_CheckExact(__pyx_t_16))) { if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_16)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_17); __Pyx_INCREF(__pyx_t_9); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5355, __pyx_L41_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_16, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5355, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_16)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_17); __Pyx_INCREF(__pyx_t_9); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5355, __pyx_L41_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_16, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5355, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_18(__pyx_t_16); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5355, __pyx_L41_error) } break; } __Pyx_GOTREF(__pyx_t_9); } if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5355, __pyx_L41_error) __Pyx_XDECREF_SET(__pyx_9genexpr93__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_t_9 = PyInt_FromSsize_t(__pyx_9genexpr93__pyx_v_ws->_memory_limit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5355, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 5355, __pyx_L41_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr93__pyx_v_ws); __pyx_9genexpr93__pyx_v_ws = 0; goto __pyx_L44_exit_scope; __pyx_L41_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr93__pyx_v_ws); __pyx_9genexpr93__pyx_v_ws = 0; goto __pyx_L36_error; __pyx_L44_exit_scope:; } /* exit inner scope */ __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5355, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_9genexpr92__pyx_v_k, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 5355, __pyx_L36_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_k); __pyx_9genexpr92__pyx_v_k = 0; __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_v); __pyx_9genexpr92__pyx_v_v = 0; goto __pyx_L45_exit_scope; __pyx_L36_error:; __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_k); __pyx_9genexpr92__pyx_v_k = 0; __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_v); __pyx_9genexpr92__pyx_v_v = 0; goto __pyx_L15_error; __pyx_L45_exit_scope:; } /* exit inner scope */ __pyx_v_limit_bytes = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5357 * k: sum([ws._memory_limit for ws in v]) for k, v in groups.items() * } * group_bytes = {k: sum([ws._nbytes for ws in v]) for k, v in groups.items()} # <<<<<<<<<<<<<< * * limit = sum(limit_bytes.values()) */ { /* enter inner scope */ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5357, __pyx_L48_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_groups == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5357, __pyx_L48_error) } __pyx_t_16 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_groups, 0, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_14)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5357, __pyx_L48_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_16; __pyx_t_16 = 0; while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_13, &__pyx_t_5, &__pyx_t_16, &__pyx_t_7, NULL, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5357, __pyx_L48_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_9genexpr94__pyx_v_k, __pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr94__pyx_v_v, __pyx_t_7); __pyx_t_7 = 0; { /* enter inner scope */ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5357, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_7); if (likely(PyList_CheckExact(__pyx_9genexpr94__pyx_v_v)) || PyTuple_CheckExact(__pyx_9genexpr94__pyx_v_v)) { __pyx_t_16 = __pyx_9genexpr94__pyx_v_v; __Pyx_INCREF(__pyx_t_16); __pyx_t_17 = 0; __pyx_t_18 = NULL; } else { __pyx_t_17 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_9genexpr94__pyx_v_v); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5357, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_18 = Py_TYPE(__pyx_t_16)->tp_iternext; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5357, __pyx_L53_error) } for (;;) { if (likely(!__pyx_t_18)) { if (likely(PyList_CheckExact(__pyx_t_16))) { if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_16)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_17); __Pyx_INCREF(__pyx_t_9); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5357, __pyx_L53_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_16, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5357, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_16)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_17); __Pyx_INCREF(__pyx_t_9); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5357, __pyx_L53_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_16, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5357, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_18(__pyx_t_16); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5357, __pyx_L53_error) } break; } __Pyx_GOTREF(__pyx_t_9); } if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5357, __pyx_L53_error) __Pyx_XDECREF_SET(__pyx_9genexpr95__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_t_9 = PyInt_FromSsize_t(__pyx_9genexpr95__pyx_v_ws->_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5357, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 5357, __pyx_L53_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr95__pyx_v_ws); __pyx_9genexpr95__pyx_v_ws = 0; goto __pyx_L56_exit_scope; __pyx_L53_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr95__pyx_v_ws); __pyx_9genexpr95__pyx_v_ws = 0; goto __pyx_L48_error; __pyx_L56_exit_scope:; } /* exit inner scope */ __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5357, __pyx_L48_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_9genexpr94__pyx_v_k, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 5357, __pyx_L48_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_k); __pyx_9genexpr94__pyx_v_k = 0; __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_v); __pyx_9genexpr94__pyx_v_v = 0; goto __pyx_L57_exit_scope; __pyx_L48_error:; __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_k); __pyx_9genexpr94__pyx_v_k = 0; __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_v); __pyx_9genexpr94__pyx_v_v = 0; goto __pyx_L15_error; __pyx_L57_exit_scope:; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_group_bytes = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5359 * group_bytes = {k: sum([ws._nbytes for ws in v]) for k, v in groups.items()} * * limit = sum(limit_bytes.values()) # <<<<<<<<<<<<<< * total = sum(group_bytes.values()) * */ __pyx_t_6 = __Pyx_PyDict_Values(__pyx_v_limit_bytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5359, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5359, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_limit = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5360 * * limit = sum(limit_bytes.values()) * total = sum(group_bytes.values()) # <<<<<<<<<<<<<< * * def _key(group): */ __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_v_group_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5360, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5360, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_total = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":5362 * total = sum(group_bytes.values()) * * def _key(group): # <<<<<<<<<<<<<< * wws: WorkerState * is_idle = not any([wws._processing for wws in groups[group]]) */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_16workers_to_close_1_key, 0, __pyx_n_s_Scheduler_workers_to_close_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5362, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v__key = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":5368 * return (is_idle, bytes) * * idle = sorted(groups, key=_key) # <<<<<<<<<<<<<< * * to_close = [] */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5368, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_groups); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_groups); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_groups); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5368, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_v__key) < 0) __PYX_ERR(0, 5368, __pyx_L15_error) __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5368, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_idle = __pyx_t_16; __pyx_t_16 = 0; /* "distributed/scheduler.py":5370 * idle = sorted(groups, key=_key) * * to_close = [] # <<<<<<<<<<<<<< * n_remain = len(parent._workers_dv) * */ __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5370, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __pyx_v_to_close = ((PyObject*)__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5371 * * to_close = [] * n_remain = len(parent._workers_dv) # <<<<<<<<<<<<<< * * while idle: */ __pyx_t_16 = __pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_16); if (unlikely(__pyx_t_16 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 5371, __pyx_L15_error) } __pyx_t_13 = PyDict_Size(__pyx_t_16); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5371, __pyx_L15_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5371, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __pyx_v_n_remain = __pyx_t_16; __pyx_t_16 = 0; /* "distributed/scheduler.py":5373 * n_remain = len(parent._workers_dv) * * while idle: # <<<<<<<<<<<<<< * group = idle.pop() * if n is None and any([ws._processing for ws in groups[group]]): */ while (1) { __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_idle); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 5373, __pyx_L15_error) if (!__pyx_t_4) break; /* "distributed/scheduler.py":5374 * * while idle: * group = idle.pop() # <<<<<<<<<<<<<< * if n is None and any([ws._processing for ws in groups[group]]): * break */ __pyx_t_16 = __Pyx_PyObject_Pop(__pyx_v_idle); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5374, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5375 * while idle: * group = idle.pop() * if n is None and any([ws._processing for ws in groups[group]]): # <<<<<<<<<<<<<< * break * */ __pyx_t_2 = (__pyx_v_n == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L61_bool_binop_done; } { /* enter inner scope */ __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5375, __pyx_L65_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_groups, __pyx_v_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5375, __pyx_L65_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0; __pyx_t_18 = NULL; } else { __pyx_t_13 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5375, __pyx_L65_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_18 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5375, __pyx_L65_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_18)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5375, __pyx_L65_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5375, __pyx_L65_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5375, __pyx_L65_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5375, __pyx_L65_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_18(__pyx_t_6); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5375, __pyx_L65_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5375, __pyx_L65_error) __Pyx_XDECREF_SET(__pyx_9genexpr97__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1)); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_16, (PyObject*)__pyx_9genexpr97__pyx_v_ws->_processing))) __PYX_ERR(0, 5375, __pyx_L65_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr97__pyx_v_ws); __pyx_9genexpr97__pyx_v_ws = 0; goto __pyx_L68_exit_scope; __pyx_L65_error:; __Pyx_XDECREF((PyObject *)__pyx_9genexpr97__pyx_v_ws); __pyx_9genexpr97__pyx_v_ws = 0; goto __pyx_L15_error; __pyx_L68_exit_scope:; } /* exit inner scope */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5375, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5375, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L61_bool_binop_done:; if (__pyx_t_4) { /* "distributed/scheduler.py":5376 * group = idle.pop() * if n is None and any([ws._processing for ws in groups[group]]): * break # <<<<<<<<<<<<<< * * if minimum and n_remain - len(groups[group]) < minimum: */ goto __pyx_L59_break; /* "distributed/scheduler.py":5375 * while idle: * group = idle.pop() * if n is None and any([ws._processing for ws in groups[group]]): # <<<<<<<<<<<<<< * break * */ } /* "distributed/scheduler.py":5378 * break * * if minimum and n_remain - len(groups[group]) < minimum: # <<<<<<<<<<<<<< * break * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_minimum); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5378, __pyx_L15_error) if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L70_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_groups, __pyx_v_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5378, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_13 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5378, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5378, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_16 = PyNumber_Subtract(__pyx_v_n_remain, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5378, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyObject_RichCompare(__pyx_t_16, __pyx_v_minimum, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5378, __pyx_L15_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5378, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L70_bool_binop_done:; if (__pyx_t_4) { /* "distributed/scheduler.py":5379 * * if minimum and n_remain - len(groups[group]) < minimum: * break # <<<<<<<<<<<<<< * * limit -= limit_bytes[group] */ goto __pyx_L59_break; /* "distributed/scheduler.py":5378 * break * * if minimum and n_remain - len(groups[group]) < minimum: # <<<<<<<<<<<<<< * break * */ } /* "distributed/scheduler.py":5381 * break * * limit -= limit_bytes[group] # <<<<<<<<<<<<<< * * if (n is not None and n_remain - len(groups[group]) >= target) or ( */ __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_limit_bytes, __pyx_v_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5381, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_16 = PyNumber_InPlaceSubtract(__pyx_v_limit, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5381, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_limit, __pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5383 * limit -= limit_bytes[group] * * if (n is not None and n_remain - len(groups[group]) >= target) or ( # <<<<<<<<<<<<<< * memory_ratio is not None and limit >= memory_ratio * total * ): */ __pyx_t_3 = (__pyx_v_n != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (!__pyx_t_2) { goto __pyx_L74_next_or; } else { } __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_groups, __pyx_v_group); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5383, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_13 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5383, __pyx_L15_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5383, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_6 = PyNumber_Subtract(__pyx_v_n_remain, __pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5383, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyObject_RichCompare(__pyx_t_6, __pyx_v_target, Py_GE); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5383, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5383, __pyx_L15_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (!__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L73_bool_binop_done; } __pyx_L74_next_or:; /* "distributed/scheduler.py":5384 * * if (n is not None and n_remain - len(groups[group]) >= target) or ( * memory_ratio is not None and limit >= memory_ratio * total # <<<<<<<<<<<<<< * ): * to_close.append(group) */ __pyx_t_2 = (__pyx_v_memory_ratio != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L73_bool_binop_done; } __pyx_t_16 = PyNumber_Multiply(__pyx_v_memory_ratio, __pyx_v_total); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5384, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_6 = PyObject_RichCompare(__pyx_v_limit, __pyx_t_16, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5384, __pyx_L15_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5384, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L73_bool_binop_done:; /* "distributed/scheduler.py":5383 * limit -= limit_bytes[group] * * if (n is not None and n_remain - len(groups[group]) >= target) or ( # <<<<<<<<<<<<<< * memory_ratio is not None and limit >= memory_ratio * total * ): */ if (__pyx_t_4) { /* "distributed/scheduler.py":5386 * memory_ratio is not None and limit >= memory_ratio * total * ): * to_close.append(group) # <<<<<<<<<<<<<< * n_remain -= len(groups[group]) * */ __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_to_close, __pyx_v_group); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 5386, __pyx_L15_error) /* "distributed/scheduler.py":5387 * ): * to_close.append(group) * n_remain -= len(groups[group]) # <<<<<<<<<<<<<< * * else: */ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_groups, __pyx_v_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5387, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_13 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5387, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5387, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_16 = PyNumber_InPlaceSubtract(__pyx_v_n_remain, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5387, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_n_remain, __pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5383 * limit -= limit_bytes[group] * * if (n is not None and n_remain - len(groups[group]) >= target) or ( # <<<<<<<<<<<<<< * memory_ratio is not None and limit >= memory_ratio * total * ): */ goto __pyx_L72; } /* "distributed/scheduler.py":5390 * * else: * break # <<<<<<<<<<<<<< * * result = [getattr(ws, attribute) for g in to_close for ws in groups[g]] */ /*else*/ { goto __pyx_L59_break; } __pyx_L72:; } __pyx_L59_break:; /* "distributed/scheduler.py":5392 * break * * result = [getattr(ws, attribute) for g in to_close for ws in groups[g]] # <<<<<<<<<<<<<< * if result: * logger.debug("Suggest closing workers: %s", result) */ { /* enter inner scope */ __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_6 = __pyx_v_to_close; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5392, __pyx_L79_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_9genexpr98__pyx_v_g, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_groups, __pyx_9genexpr98__pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0; __pyx_t_18 = NULL; } else { __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_18 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5392, __pyx_L79_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_18)) { if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5392, __pyx_L79_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5392, __pyx_L79_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_18(__pyx_t_7); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5392, __pyx_L79_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_XDECREF_SET(__pyx_9genexpr98__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetAttr(((PyObject *)__pyx_9genexpr98__pyx_v_ws), __pyx_v_attribute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__Pyx_ListComp_Append(__pyx_t_16, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 5392, __pyx_L79_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_9genexpr98__pyx_v_g); __pyx_9genexpr98__pyx_v_g = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr98__pyx_v_ws); __pyx_9genexpr98__pyx_v_ws = 0; goto __pyx_L84_exit_scope; __pyx_L79_error:; __Pyx_XDECREF(__pyx_9genexpr98__pyx_v_g); __pyx_9genexpr98__pyx_v_g = 0; __Pyx_XDECREF((PyObject *)__pyx_9genexpr98__pyx_v_ws); __pyx_9genexpr98__pyx_v_ws = 0; goto __pyx_L15_error; __pyx_L84_exit_scope:; } /* exit inner scope */ __pyx_v_result = ((PyObject*)__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5393 * * result = [getattr(ws, attribute) for g in to_close for ws in groups[g]] * if result: # <<<<<<<<<<<<<< * logger.debug("Suggest closing workers: %s", result) * */ __pyx_t_4 = (PyList_GET_SIZE(__pyx_v_result) != 0); if (__pyx_t_4) { /* "distributed/scheduler.py":5394 * result = [getattr(ws, attribute) for g in to_close for ws in groups[g]] * if result: * logger.debug("Suggest closing workers: %s", result) # <<<<<<<<<<<<<< * * return result */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5394, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_debug); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5394, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Suggest_closing_workers_s, __pyx_v_result}; __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5394, __pyx_L15_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_16); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Suggest_closing_workers_s, __pyx_v_result}; __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5394, __pyx_L15_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_16); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5394, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_kp_u_Suggest_closing_workers_s); __Pyx_GIVEREF(__pyx_kp_u_Suggest_closing_workers_s); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_14, __pyx_kp_u_Suggest_closing_workers_s); __Pyx_INCREF(__pyx_v_result); __Pyx_GIVEREF(__pyx_v_result); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_14, __pyx_v_result); __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5394, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5393 * * result = [getattr(ws, attribute) for g in to_close for ws in groups[g]] * if result: # <<<<<<<<<<<<<< * logger.debug("Suggest closing workers: %s", result) * */ } /* "distributed/scheduler.py":5396 * logger.debug("Suggest closing workers: %s", result) * * return result # <<<<<<<<<<<<<< * * async def retire_workers( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L19_try_return; /* "distributed/scheduler.py":5341 * * ws: WorkerState * with log_errors(): # <<<<<<<<<<<<<< * if not n and all([ws._processing for ws in parent._workers_dv.values()]): * return [] */ } __pyx_L15_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.workers_to_close", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(0, 5341, __pyx_L17_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_16, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5341, __pyx_L17_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5341, __pyx_L17_except_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_20); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (__pyx_t_4 < 0) __PYX_ERR(0, 5341, __pyx_L17_except_error) __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_16, __pyx_t_7, __pyx_t_1); __pyx_t_16 = 0; __pyx_t_7 = 0; __pyx_t_1 = 0; __PYX_ERR(0, 5341, __pyx_L17_except_error) } __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L16_exception_handled; } __pyx_L17_except_error:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L1_error; __pyx_L19_try_return:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L12_return; __pyx_L16_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_8) { __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } goto __pyx_L14; } __pyx_L12_return: { __pyx_t_12 = __pyx_r; __pyx_r = 0; if (__pyx_t_8) { __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; } __pyx_L14:; } goto __pyx_L89; __pyx_L11_error:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L1_error; __pyx_L89:; } /* "distributed/scheduler.py":5262 * ) * * def workers_to_close( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("distributed.scheduler.Scheduler.workers_to_close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_limit_bytes); __Pyx_XDECREF(__pyx_v_limit); __Pyx_XDECREF(__pyx_v_total); __Pyx_XDECREF(__pyx_v__key); __Pyx_XDECREF(__pyx_v_idle); __Pyx_XDECREF(__pyx_v_to_close); __Pyx_XDECREF(__pyx_v_n_remain); __Pyx_XDECREF(__pyx_v_group); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF((PyObject *)__pyx_9genexpr91__pyx_v_ws); __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_k); __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_v); __Pyx_XDECREF((PyObject *)__pyx_9genexpr93__pyx_v_ws); __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_k); __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_v); __Pyx_XDECREF((PyObject *)__pyx_9genexpr95__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_9genexpr97__pyx_v_ws); __Pyx_XDECREF(__pyx_9genexpr98__pyx_v_g); __Pyx_XDECREF((PyObject *)__pyx_9genexpr98__pyx_v_ws); __Pyx_XDECREF(__pyx_v_memory_ratio); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_target); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_131generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5398 * return result * * async def retire_workers( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_130retire_workers(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_129retire_workers[] = "Gracefully retire workers from cluster\n\n Parameters\n ----------\n workers: list (optional)\n List of worker addresses to retire.\n If not provided we call ``workers_to_close`` which finds a good set\n workers_names: list (optional)\n List of worker names to retire.\n remove: bool (defaults to True)\n Whether or not to remove the worker metadata immediately or else\n wait for the worker to contact us\n close_workers: bool (defaults to False)\n Whether or not to actually close the worker explicitly from here.\n Otherwise we expect some external job scheduler to finish off the\n worker.\n **kwargs: dict\n Extra options to pass to workers_to_close to determine which\n workers we should drop\n\n Returns\n -------\n Dictionary mapping worker ID/address to dictionary of information about\n that worker for each retired worker.\n\n See Also\n --------\n Scheduler.workers_to_close\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_130retire_workers = {"retire_workers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_130retire_workers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_129retire_workers}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_130retire_workers(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_workers = 0; PyObject *__pyx_v_remove = 0; PyObject *__pyx_v_close_workers = 0; PyObject *__pyx_v_names = 0; PyObject *__pyx_v_lock = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("retire_workers (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_workers,&__pyx_n_s_remove,&__pyx_n_s_close_workers,&__pyx_n_s_names,&__pyx_n_s_lock_2,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; /* "distributed/scheduler.py":5400 * async def retire_workers( * self, * comm=None, # <<<<<<<<<<<<<< * workers=None, * remove=True, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5401 * self, * comm=None, * workers=None, # <<<<<<<<<<<<<< * remove=True, * close_workers=False, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5402 * comm=None, * workers=None, * remove=True, # <<<<<<<<<<<<<< * close_workers=False, * names=None, */ values[3] = ((PyObject *)((PyObject *)Py_True)); /* "distributed/scheduler.py":5403 * workers=None, * remove=True, * close_workers=False, # <<<<<<<<<<<<<< * names=None, * lock=True, */ values[4] = ((PyObject *)((PyObject *)Py_False)); /* "distributed/scheduler.py":5404 * remove=True, * close_workers=False, * names=None, # <<<<<<<<<<<<<< * lock=True, * **kwargs, */ values[5] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":5405 * close_workers=False, * names=None, * lock=True, # <<<<<<<<<<<<<< * **kwargs, * ) -> dict: */ values[6] = ((PyObject *)((PyObject *)Py_True)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_workers); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lock_2); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "retire_workers") < 0)) __PYX_ERR(0, 5398, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_workers = values[2]; __pyx_v_remove = values[3]; __pyx_v_close_workers = values[4]; __pyx_v_names = values[5]; __pyx_v_lock = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("retire_workers", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5398, __pyx_L3_error) __pyx_L3_error:; __Pyx_CLEAR(__pyx_v_kwargs); __Pyx_AddTraceback("distributed.scheduler.Scheduler.retire_workers", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_129retire_workers(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_workers, __pyx_v_remove, __pyx_v_close_workers, __pyx_v_names, __pyx_v_lock, __pyx_v_kwargs); /* "distributed/scheduler.py":5398 * return result * * async def retire_workers( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_129retire_workers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers, PyObject *__pyx_v_remove, PyObject *__pyx_v_close_workers, PyObject *__pyx_v_names, PyObject *__pyx_v_lock, PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("retire_workers", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_43_retire_workers(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_43_retire_workers, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5398, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_workers = __pyx_v_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); __pyx_cur_scope->__pyx_v_remove = __pyx_v_remove; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_remove); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_remove); __pyx_cur_scope->__pyx_v_close_workers = __pyx_v_close_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_close_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_close_workers); __pyx_cur_scope->__pyx_v_names = __pyx_v_names; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_names); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_names); __pyx_cur_scope->__pyx_v_lock = __pyx_v_lock; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lock); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lock); __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_131generator16, __pyx_codeobj__80, (PyObject *) __pyx_cur_scope, __pyx_n_s_retire_workers, __pyx_n_s_Scheduler_retire_workers, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5398, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.retire_workers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_131generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_t_15; Py_ssize_t __pyx_t_16; Py_ssize_t __pyx_t_17; int __pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *(*__pyx_t_22)(PyObject *); PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("retire_workers", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L15_resume_from_await; case 2: goto __pyx_L42_resume_from_await; case 3: goto __pyx_L56_resume_from_await; case 4: goto __pyx_L64_resume_from_await; case 5: goto __pyx_L68_resume_from_await; case 6: goto __pyx_L72_resume_from_await; case 7: goto __pyx_L73_resume_from_await; case 8: goto __pyx_L74_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5398, __pyx_L1_error) /* "distributed/scheduler.py":5437 * Scheduler.workers_to_close * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * ts: TaskState */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5440 * ws: WorkerState * ts: TaskState * with log_errors(): # <<<<<<<<<<<<<< * async with self._lock if lock else empty_context: * if names is not None: */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5440, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5440, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":5441 * ts: TaskState * with log_errors(): * async with self._lock if lock else empty_context: # <<<<<<<<<<<<<< * if names is not None: * if names: */ /*with:*/ { __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_lock); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5441, __pyx_L8_error) if (__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5441, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_empty_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5441, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_aexit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5441, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_aenter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5441, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5441, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_5 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L15_resume_from_await:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5441, __pyx_L14_error) __pyx_t_2 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_2 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_2) < 0) __PYX_ERR(0, 5441, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "distributed/scheduler.py":5442 * with log_errors(): * async with self._lock if lock else empty_context: * if names is not None: # <<<<<<<<<<<<<< * if names: * logger.info("Retire worker names %s", names) */ __pyx_t_9 = (__pyx_cur_scope->__pyx_v_names != Py_None); __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":5443 * async with self._lock if lock else empty_context: * if names is not None: * if names: # <<<<<<<<<<<<<< * logger.info("Retire worker names %s", names) * names = set(map(str, names)) */ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_names); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 5443, __pyx_L19_error) if (__pyx_t_14) { /* "distributed/scheduler.py":5444 * if names is not None: * if names: * logger.info("Retire worker names %s", names) # <<<<<<<<<<<<<< * names = set(map(str, names)) * workers = [ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5444, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5444, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Retire_worker_names_s, __pyx_cur_scope->__pyx_v_names}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5444, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Retire_worker_names_s, __pyx_cur_scope->__pyx_v_names}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5444, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5444, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Retire_worker_names_s); __Pyx_GIVEREF(__pyx_kp_u_Retire_worker_names_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_15, __pyx_kp_u_Retire_worker_names_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_names); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_names); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_15, __pyx_cur_scope->__pyx_v_names); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5444, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5443 * async with self._lock if lock else empty_context: * if names is not None: * if names: # <<<<<<<<<<<<<< * logger.info("Retire worker names %s", names) * names = set(map(str, names)) */ } /* "distributed/scheduler.py":5445 * if names: * logger.info("Retire worker names %s", names) * names = set(map(str, names)) # <<<<<<<<<<<<<< * workers = [ * ws._address */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5445, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)(&PyUnicode_Type))); __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type))); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_names); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_names); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_names); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5445, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5445, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_names); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_names, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5446 * logger.info("Retire worker names %s", names) * names = set(map(str, names)) * workers = [ # <<<<<<<<<<<<<< * ws._address * for ws in parent._workers_dv.values() */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5446, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5448 * workers = [ * ws._address * for ws in parent._workers_dv.values() # <<<<<<<<<<<<<< * if str(ws._name) in names * ] */ __pyx_t_16 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 5448, __pyx_L19_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, __pyx_n_s_values, (&__pyx_t_17), (&__pyx_t_15)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5448, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_17, &__pyx_t_16, NULL, &__pyx_t_5, NULL, __pyx_t_15); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5448, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5448, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_9genexpr99__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr99__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_5)); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5449 * ws._address * for ws in parent._workers_dv.values() * if str(ws._name) in names # <<<<<<<<<<<<<< * ] * if workers is None: */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_cur_scope->__pyx_9genexpr99__pyx_v_ws->_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5449, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_cur_scope->__pyx_v_names, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 5449, __pyx_L19_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = (__pyx_t_14 != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":5447 * names = set(map(str, names)) * workers = [ * ws._address # <<<<<<<<<<<<<< * for ws in parent._workers_dv.values() * if str(ws._name) in names */ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_9genexpr99__pyx_v_ws->_address))) __PYX_ERR(0, 5446, __pyx_L19_error) /* "distributed/scheduler.py":5449 * ws._address * for ws in parent._workers_dv.values() * if str(ws._name) in names # <<<<<<<<<<<<<< * ] * if workers is None: */ } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5442 * with log_errors(): * async with self._lock if lock else empty_context: * if names is not None: # <<<<<<<<<<<<<< * if names: * logger.info("Retire worker names %s", names) */ } /* "distributed/scheduler.py":5451 * if str(ws._name) in names * ] * if workers is None: # <<<<<<<<<<<<<< * while True: * try: */ __pyx_t_9 = (__pyx_cur_scope->__pyx_v_workers == Py_None); __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":5452 * ] * if workers is None: * while True: # <<<<<<<<<<<<<< * try: * workers = self.workers_to_close(**kwargs) */ while (1) { /* "distributed/scheduler.py":5453 * if workers is None: * while True: * try: # <<<<<<<<<<<<<< * workers = self.workers_to_close(**kwargs) * if workers: */ { __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); /*try:*/ { /* "distributed/scheduler.py":5454 * while True: * try: * workers = self.workers_to_close(**kwargs) # <<<<<<<<<<<<<< * if workers: * workers = await self.retire_workers( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_workers_to_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5454, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5454, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5455 * try: * workers = self.workers_to_close(**kwargs) * if workers: # <<<<<<<<<<<<<< * workers = await self.retire_workers( * workers=workers, */ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_workers); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 5455, __pyx_L33_error) if (__pyx_t_14) { /* "distributed/scheduler.py":5456 * workers = self.workers_to_close(**kwargs) * if workers: * workers = await self.retire_workers( # <<<<<<<<<<<<<< * workers=workers, * remove=remove, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_retire_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5456, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":5457 * if workers: * workers = await self.retire_workers( * workers=workers, # <<<<<<<<<<<<<< * remove=remove, * close_workers=close_workers, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5457, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_workers, __pyx_cur_scope->__pyx_v_workers) < 0) __PYX_ERR(0, 5457, __pyx_L33_error) /* "distributed/scheduler.py":5458 * workers = await self.retire_workers( * workers=workers, * remove=remove, # <<<<<<<<<<<<<< * close_workers=close_workers, * lock=False, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_remove, __pyx_cur_scope->__pyx_v_remove) < 0) __PYX_ERR(0, 5457, __pyx_L33_error) /* "distributed/scheduler.py":5459 * workers=workers, * remove=remove, * close_workers=close_workers, # <<<<<<<<<<<<<< * lock=False, * ) */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_close_workers, __pyx_cur_scope->__pyx_v_close_workers) < 0) __PYX_ERR(0, 5457, __pyx_L33_error) /* "distributed/scheduler.py":5460 * remove=remove, * close_workers=close_workers, * lock=False, # <<<<<<<<<<<<<< * ) * return workers */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lock_2, Py_False) < 0) __PYX_ERR(0, 5457, __pyx_L33_error) /* "distributed/scheduler.py":5456 * workers = self.workers_to_close(**kwargs) * if workers: * workers = await self.retire_workers( # <<<<<<<<<<<<<< * workers=workers, * remove=remove, */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5456, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_6 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_7 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_8 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_9 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_10 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L42_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_13); __pyx_t_19 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_21); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5456, __pyx_L33_error) __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5); } else { __pyx_t_5 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_5) < 0) __PYX_ERR(0, 5456, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5462 * lock=False, * ) * return workers # <<<<<<<<<<<<<< * else: * return {} */ __Pyx_XDECREF(__pyx_r); if (!(likely(PyDict_CheckExact(__pyx_cur_scope->__pyx_v_workers))||((__pyx_cur_scope->__pyx_v_workers) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_cur_scope->__pyx_v_workers)->tp_name), 0))) __PYX_ERR(0, 5462, __pyx_L33_error) __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_workers); goto __pyx_L37_try_return; /* "distributed/scheduler.py":5455 * try: * workers = self.workers_to_close(**kwargs) * if workers: # <<<<<<<<<<<<<< * workers = await self.retire_workers( * workers=workers, */ } /* "distributed/scheduler.py":5464 * return workers * else: * return {} # <<<<<<<<<<<<<< * except KeyError: # keys left during replicate * pass */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5464, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L37_try_return; } /* "distributed/scheduler.py":5453 * if workers is None: * while True: * try: # <<<<<<<<<<<<<< * workers = self.workers_to_close(**kwargs) * if workers: */ } __pyx_L33_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5465 * else: * return {} * except KeyError: # keys left during replicate # <<<<<<<<<<<<<< * pass * workers = { */ __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_15) { __Pyx_ErrRestore(0,0,0); goto __pyx_L34_exception_handled; } goto __pyx_L35_except_error; __pyx_L35_except_error:; /* "distributed/scheduler.py":5453 * if workers is None: * while True: * try: # <<<<<<<<<<<<<< * workers = self.workers_to_close(**kwargs) * if workers: */ __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); goto __pyx_L19_error; __pyx_L37_try_return:; __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); goto __pyx_L23_try_return; __pyx_L34_exception_handled:; __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } } /* "distributed/scheduler.py":5451 * if str(ws._name) in names * ] * if workers is None: # <<<<<<<<<<<<<< * while True: * try: */ } /* "distributed/scheduler.py":5467 * except KeyError: # keys left during replicate * pass * workers = { # <<<<<<<<<<<<<< * parent._workers_dv[w] for w in workers if w in parent._workers_dv * } */ { /* enter inner scope */ __pyx_t_5 = PySet_New(NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5467, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":5468 * pass * workers = { * parent._workers_dv[w] for w in workers if w in parent._workers_dv # <<<<<<<<<<<<<< * } * if not workers: */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_1); __pyx_t_17 = 0; __pyx_t_22 = NULL; } else { __pyx_t_17 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5468, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_22 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 5468, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_22)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_17); __Pyx_INCREF(__pyx_t_3); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5468, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5468, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_17); __Pyx_INCREF(__pyx_t_3); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5468, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5468, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_22(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5468, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr100__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr100__pyx_v_w, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5468, __pyx_L19_error) } __pyx_t_14 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_10genexpr100__pyx_v_w, __pyx_cur_scope->__pyx_v_parent->_workers_dv, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 5468, __pyx_L19_error) __pyx_t_9 = (__pyx_t_14 != 0); if (__pyx_t_9) { if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5468, __pyx_L19_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_workers_dv, __pyx_cur_scope->__pyx_10genexpr100__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5468, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PySet_Add(__pyx_t_5, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5468, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5470 * parent._workers_dv[w] for w in workers if w in parent._workers_dv * } * if not workers: # <<<<<<<<<<<<<< * return {} * logger.info("Retire workers %s", workers) */ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_workers); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5470, __pyx_L19_error) __pyx_t_14 = ((!__pyx_t_9) != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":5471 * } * if not workers: * return {} # <<<<<<<<<<<<<< * logger.info("Retire workers %s", workers) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5471, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L23_try_return; /* "distributed/scheduler.py":5470 * parent._workers_dv[w] for w in workers if w in parent._workers_dv * } * if not workers: # <<<<<<<<<<<<<< * return {} * logger.info("Retire workers %s", workers) */ } /* "distributed/scheduler.py":5472 * if not workers: * return {} * logger.info("Retire workers %s", workers) # <<<<<<<<<<<<<< * * # Keys orphaned by retiring those workers */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5472, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5472, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Retire_workers_s, __pyx_cur_scope->__pyx_v_workers}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5472, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Retire_workers_s, __pyx_cur_scope->__pyx_v_workers}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5472, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5472, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Retire_workers_s); __Pyx_GIVEREF(__pyx_kp_u_Retire_workers_s); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_15, __pyx_kp_u_Retire_workers_s); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_15, __pyx_cur_scope->__pyx_v_workers); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5472, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5475 * * # Keys orphaned by retiring those workers * keys = set.union(*[w.has_what for w in workers]) # <<<<<<<<<<<<<< * keys = {ts._key for ts in keys if ts._who_has.issubset(workers)} * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PySet_Type)), __pyx_n_s_union); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_2); __pyx_t_17 = 0; __pyx_t_22 = NULL; } else { __pyx_t_17 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_22 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 5475, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_22)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_17); __Pyx_INCREF(__pyx_t_1); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5475, __pyx_L19_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_17); __Pyx_INCREF(__pyx_t_1); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5475, __pyx_L19_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_22(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5475, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr101__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr101__pyx_v_w, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_10genexpr101__pyx_v_w, __pyx_n_s_has_what); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* exit inner scope */ __pyx_t_2 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5475, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_keys = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":5476 * # Keys orphaned by retiring those workers * keys = set.union(*[w.has_what for w in workers]) * keys = {ts._key for ts in keys if ts._who_has.issubset(workers)} # <<<<<<<<<<<<<< * * other_workers = set(parent._workers_dv.values()) - workers */ { /* enter inner scope */ __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5476, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_17 = 0; __pyx_t_22 = NULL; } else { __pyx_t_17 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5476, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_22 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 5476, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_22)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_17); __Pyx_INCREF(__pyx_t_5); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5476, __pyx_L19_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5476, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_17); __Pyx_INCREF(__pyx_t_5); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5476, __pyx_L19_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5476, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_22(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5476, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5476, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_10genexpr102__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr102__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_10genexpr102__pyx_v_ts->_who_has, __pyx_n_s_issubset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5476, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_23 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_23)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_23); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_5 = (__pyx_t_23) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_23, __pyx_cur_scope->__pyx_v_workers) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_workers); __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5476, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 5476, __pyx_L19_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_14) { if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_cur_scope->__pyx_10genexpr102__pyx_v_ts->_key))) __PYX_ERR(0, 5476, __pyx_L19_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_keys, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5478 * keys = {ts._key for ts in keys if ts._who_has.issubset(workers)} * * other_workers = set(parent._workers_dv.values()) - workers # <<<<<<<<<<<<<< * if keys: * if other_workers: */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 5478, __pyx_L19_error) } __pyx_t_3 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_v_parent->_workers_dv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5478, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5478, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5478, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_other_workers = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":5479 * * other_workers = set(parent._workers_dv.values()) - workers * if keys: # <<<<<<<<<<<<<< * if other_workers: * logger.info("Moving %d keys to other workers", len(keys)) */ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_keys); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 5479, __pyx_L19_error) if (__pyx_t_14) { /* "distributed/scheduler.py":5480 * other_workers = set(parent._workers_dv.values()) - workers * if keys: * if other_workers: # <<<<<<<<<<<<<< * logger.info("Moving %d keys to other workers", len(keys)) * await self.replicate( */ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_other_workers); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 5480, __pyx_L19_error) if (__pyx_t_14) { /* "distributed/scheduler.py":5481 * if keys: * if other_workers: * logger.info("Moving %d keys to other workers", len(keys)) # <<<<<<<<<<<<<< * await self.replicate( * keys=keys, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5481, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5481, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_17 = PyObject_Length(__pyx_cur_scope->__pyx_v_keys); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5481, __pyx_L19_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5481, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Moving_d_keys_to_other_workers, __pyx_t_2}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5481, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Moving_d_keys_to_other_workers, __pyx_t_2}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5481, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_23 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5481, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Moving_d_keys_to_other_workers); __Pyx_GIVEREF(__pyx_kp_u_Moving_d_keys_to_other_workers); PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_15, __pyx_kp_u_Moving_d_keys_to_other_workers); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_15, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5481, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5482 * if other_workers: * logger.info("Moving %d keys to other workers", len(keys)) * await self.replicate( # <<<<<<<<<<<<<< * keys=keys, * workers=[ws._address for ws in other_workers], */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_replicate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5482, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":5483 * logger.info("Moving %d keys to other workers", len(keys)) * await self.replicate( * keys=keys, # <<<<<<<<<<<<<< * workers=[ws._address for ws in other_workers], * n=1, */ __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5483, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_keys, __pyx_cur_scope->__pyx_v_keys) < 0) __PYX_ERR(0, 5483, __pyx_L19_error) { /* enter inner scope */ /* "distributed/scheduler.py":5484 * await self.replicate( * keys=keys, * workers=[ws._address for ws in other_workers], # <<<<<<<<<<<<<< * n=1, * delete=False, */ __pyx_t_23 = PyList_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5484, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_other_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_other_workers)) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_other_workers; __Pyx_INCREF(__pyx_t_2); __pyx_t_17 = 0; __pyx_t_22 = NULL; } else { __pyx_t_17 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_other_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5484, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_22 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 5484, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_22)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_17); __Pyx_INCREF(__pyx_t_1); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5484, __pyx_L19_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5484, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_17); __Pyx_INCREF(__pyx_t_1); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5484, __pyx_L19_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5484, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_22(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5484, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5484, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_10genexpr103__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr103__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_23, (PyObject*)__pyx_cur_scope->__pyx_10genexpr103__pyx_v_ws->_address))) __PYX_ERR(0, 5484, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* exit inner scope */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_workers, __pyx_t_23) < 0) __PYX_ERR(0, 5483, __pyx_L19_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_n, __pyx_int_1) < 0) __PYX_ERR(0, 5483, __pyx_L19_error) /* "distributed/scheduler.py":5486 * workers=[ws._address for ws in other_workers], * n=1, * delete=False, # <<<<<<<<<<<<<< * lock=False, * ) */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_delete, Py_False) < 0) __PYX_ERR(0, 5483, __pyx_L19_error) /* "distributed/scheduler.py":5487 * n=1, * delete=False, * lock=False, # <<<<<<<<<<<<<< * ) * else: */ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_lock_2, Py_False) < 0) __PYX_ERR(0, 5483, __pyx_L19_error) /* "distributed/scheduler.py":5482 * if other_workers: * logger.info("Moving %d keys to other workers", len(keys)) * await self.replicate( # <<<<<<<<<<<<<< * keys=keys, * workers=[ws._address for ws in other_workers], */ __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5482, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_23); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_6 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_7 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L56_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5482, __pyx_L19_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 5482, __pyx_L19_error) } } /* "distributed/scheduler.py":5480 * other_workers = set(parent._workers_dv.values()) - workers * if keys: * if other_workers: # <<<<<<<<<<<<<< * logger.info("Moving %d keys to other workers", len(keys)) * await self.replicate( */ goto __pyx_L53; } /* "distributed/scheduler.py":5490 * ) * else: * return {} # <<<<<<<<<<<<<< * * worker_keys = {ws._address: ws.identity() for ws in workers} */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_23 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5490, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_23); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; goto __pyx_L23_try_return; } __pyx_L53:; /* "distributed/scheduler.py":5479 * * other_workers = set(parent._workers_dv.values()) - workers * if keys: # <<<<<<<<<<<<<< * if other_workers: * logger.info("Moving %d keys to other workers", len(keys)) */ } /* "distributed/scheduler.py":5492 * return {} * * worker_keys = {ws._address: ws.identity() for ws in workers} # <<<<<<<<<<<<<< * if close_workers and worker_keys: * await asyncio.gather( */ { /* enter inner scope */ __pyx_t_23 = PyDict_New(); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5492, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_workers)) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_5); __pyx_t_17 = 0; __pyx_t_22 = NULL; } else { __pyx_t_17 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5492, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_22 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 5492, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_22)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_17); __Pyx_INCREF(__pyx_t_3); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5492, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5492, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_17); __Pyx_INCREF(__pyx_t_3); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 5492, __pyx_L19_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5492, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_22(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5492, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5492, __pyx_L19_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_10genexpr104__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr104__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_11distributed_9scheduler_11WorkerState_identity(__pyx_cur_scope->__pyx_10genexpr104__pyx_v_ws, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5492, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_t_23, (PyObject*)__pyx_cur_scope->__pyx_10genexpr104__pyx_v_ws->_address, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5492, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_v_worker_keys = ((PyObject*)__pyx_t_23); __pyx_t_23 = 0; /* "distributed/scheduler.py":5493 * * worker_keys = {ws._address: ws.identity() for ws in workers} * if close_workers and worker_keys: # <<<<<<<<<<<<<< * await asyncio.gather( * *[self.close_worker(worker=w, safe=True) for w in worker_keys] */ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_close_workers); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5493, __pyx_L19_error) if (__pyx_t_9) { } else { __pyx_t_14 = __pyx_t_9; goto __pyx_L60_bool_binop_done; } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_worker_keys); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5493, __pyx_L19_error) __pyx_t_14 = __pyx_t_9; __pyx_L60_bool_binop_done:; if (__pyx_t_14) { /* "distributed/scheduler.py":5494 * worker_keys = {ws._address: ws.identity() for ws in workers} * if close_workers and worker_keys: * await asyncio.gather( # <<<<<<<<<<<<<< * *[self.close_worker(worker=w, safe=True) for w in worker_keys] * ) */ __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5494, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_gather); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5494, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; { /* enter inner scope */ /* "distributed/scheduler.py":5495 * if close_workers and worker_keys: * await asyncio.gather( * *[self.close_worker(worker=w, safe=True) for w in worker_keys] # <<<<<<<<<<<<<< * ) * if remove: */ __pyx_t_23 = PyList_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5495, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_17 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_worker_keys, 1, ((PyObject *)NULL), (&__pyx_t_16), (&__pyx_t_15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5495, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_16, &__pyx_t_17, &__pyx_t_2, NULL, NULL, __pyx_t_15); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5495, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr105__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr105__pyx_v_w, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_close_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5495, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5495, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_worker, __pyx_cur_scope->__pyx_10genexpr105__pyx_v_w) < 0) __PYX_ERR(0, 5495, __pyx_L19_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_safe, Py_True) < 0) __PYX_ERR(0, 5495, __pyx_L19_error) __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5495, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_23, (PyObject*)__pyx_t_24))) __PYX_ERR(0, 5495, __pyx_L19_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ /* "distributed/scheduler.py":5494 * worker_keys = {ws._address: ws.identity() for ws in workers} * if close_workers and worker_keys: * await asyncio.gather( # <<<<<<<<<<<<<< * *[self.close_worker(worker=w, safe=True) for w in worker_keys] * ) */ __pyx_t_3 = PySequence_Tuple(__pyx_t_23); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5494, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5494, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_23); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_6 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_7 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L64_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5494, __pyx_L19_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 5494, __pyx_L19_error) } } /* "distributed/scheduler.py":5493 * * worker_keys = {ws._address: ws.identity() for ws in workers} * if close_workers and worker_keys: # <<<<<<<<<<<<<< * await asyncio.gather( * *[self.close_worker(worker=w, safe=True) for w in worker_keys] */ } /* "distributed/scheduler.py":5497 * *[self.close_worker(worker=w, safe=True) for w in worker_keys] * ) * if remove: # <<<<<<<<<<<<<< * await asyncio.gather( * *[self.remove_worker(address=w, safe=True) for w in worker_keys] */ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_remove); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 5497, __pyx_L19_error) if (__pyx_t_14) { /* "distributed/scheduler.py":5498 * ) * if remove: * await asyncio.gather( # <<<<<<<<<<<<<< * *[self.remove_worker(address=w, safe=True) for w in worker_keys] * ) */ __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5498, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_gather); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5498, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; { /* enter inner scope */ /* "distributed/scheduler.py":5499 * if remove: * await asyncio.gather( * *[self.remove_worker(address=w, safe=True) for w in worker_keys] # <<<<<<<<<<<<<< * ) * */ __pyx_t_23 = PyList_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5499, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_16 = 0; __pyx_t_24 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_worker_keys, 1, ((PyObject *)NULL), (&__pyx_t_17), (&__pyx_t_15)); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5499, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_24; __pyx_t_24 = 0; while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_17, &__pyx_t_16, &__pyx_t_24, NULL, NULL, __pyx_t_15); if (unlikely(__pyx_t_18 == 0)) break; if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 5499, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr106__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr106__pyx_v_w, __pyx_t_24); __Pyx_GIVEREF(__pyx_t_24); __pyx_t_24 = 0; __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5499, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5499, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_address, __pyx_cur_scope->__pyx_10genexpr106__pyx_v_w) < 0) __PYX_ERR(0, 5499, __pyx_L19_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_safe, Py_True) < 0) __PYX_ERR(0, 5499, __pyx_L19_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5499, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_23, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 5499, __pyx_L19_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* exit inner scope */ /* "distributed/scheduler.py":5498 * ) * if remove: * await asyncio.gather( # <<<<<<<<<<<<<< * *[self.remove_worker(address=w, safe=True) for w in worker_keys] * ) */ __pyx_t_5 = PySequence_Tuple(__pyx_t_23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5498, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5498, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_23); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_6 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_7 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L68_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5498, __pyx_L19_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 5498, __pyx_L19_error) } } /* "distributed/scheduler.py":5497 * *[self.close_worker(worker=w, safe=True) for w in worker_keys] * ) * if remove: # <<<<<<<<<<<<<< * await asyncio.gather( * *[self.remove_worker(address=w, safe=True) for w in worker_keys] */ } /* "distributed/scheduler.py":5502 * ) * * self.log_event( # <<<<<<<<<<<<<< * "all", * { */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5502, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":5505 * "all", * { * "action": "retire-workers", # <<<<<<<<<<<<<< * "workers": worker_keys, * "moved-keys": len(keys), */ __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5505, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_action, __pyx_kp_u_retire_workers_2) < 0) __PYX_ERR(0, 5505, __pyx_L19_error) /* "distributed/scheduler.py":5506 * { * "action": "retire-workers", * "workers": worker_keys, # <<<<<<<<<<<<<< * "moved-keys": len(keys), * }, */ if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_workers, __pyx_cur_scope->__pyx_v_worker_keys) < 0) __PYX_ERR(0, 5505, __pyx_L19_error) /* "distributed/scheduler.py":5507 * "action": "retire-workers", * "workers": worker_keys, * "moved-keys": len(keys), # <<<<<<<<<<<<<< * }, * ) */ __pyx_t_17 = PyObject_Length(__pyx_cur_scope->__pyx_v_keys); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5507, __pyx_L19_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5507, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_moved_keys_2, __pyx_t_2) < 0) __PYX_ERR(0, 5505, __pyx_L19_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_n_u_all, __pyx_t_3}; __pyx_t_23 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5502, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_n_u_all, __pyx_t_3}; __pyx_t_23 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5502, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5502, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_15, __pyx_n_u_all); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_15, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5502, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; /* "distributed/scheduler.py":5510 * }, * ) * self.log_event(list(worker_keys), {"action": "retired"}) # <<<<<<<<<<<<<< * * return worker_keys */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5510, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_worker_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5510, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5510, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_action, __pyx_n_u_retired) < 0) __PYX_ERR(0, 5510, __pyx_L19_error) __pyx_t_2 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_1, __pyx_t_3}; __pyx_t_23 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5510, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_1, __pyx_t_3}; __pyx_t_23 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5510, __pyx_L19_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_24 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5510, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_24); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0+__pyx_t_15, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_24, 1+__pyx_t_15, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_24, NULL); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5510, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; /* "distributed/scheduler.py":5512 * self.log_event(list(worker_keys), {"action": "retired"}) * * return worker_keys # <<<<<<<<<<<<<< * * def add_keys(self, comm=None, worker=None, keys=()): */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_worker_keys); goto __pyx_L23_try_return; /* "distributed/scheduler.py":5441 * ts: TaskState * with log_errors(): * async with self._lock if lock else empty_context: # <<<<<<<<<<<<<< * if names is not None: * if names: */ } __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.retire_workers", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_23, &__pyx_t_5, &__pyx_t_24) < 0) __PYX_ERR(0, 5441, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_24); __pyx_t_3 = PyTuple_Pack(3, __pyx_t_23, __pyx_t_5, __pyx_t_24); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5441, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5441, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_21); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_21); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_5 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_6 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_7 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_8 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_9 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_10 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_11 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_SwapException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 6; return __pyx_r; __pyx_L72_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_13); __pyx_t_21 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_23 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_24); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5441, __pyx_L21_except_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 5441, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_21 = __pyx_t_3; __pyx_t_3 = 0; __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_21); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (__pyx_t_14 < 0) __PYX_ERR(0, 5441, __pyx_L21_except_error) __pyx_t_9 = ((!(__pyx_t_14 != 0)) != 0); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_23); __Pyx_GIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ErrRestoreWithState(__pyx_t_23, __pyx_t_5, __pyx_t_24); __pyx_t_23 = 0; __pyx_t_5 = 0; __pyx_t_24 = 0; __PYX_ERR(0, 5441, __pyx_L21_except_error) } __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; goto __pyx_L20_exception_handled; } __pyx_L21_except_error:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L8_error; __pyx_L23_try_return:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L16_return; __pyx_L20_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_10) { __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 5441, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_5 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 7; return __pyx_r; __pyx_L73_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_13 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5441, __pyx_L8_error) __pyx_t_24 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_24); } else { __pyx_t_24 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_24) < 0) __PYX_ERR(0, 5441, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_24); } __pyx_t_13 = __pyx_t_24; __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } goto __pyx_L18; } __pyx_L16_return: { __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_25 = __pyx_r; __pyx_r = 0; if (__pyx_t_10) { __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 5441, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_26); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_26); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_6 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_7 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_8 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_9 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_10 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_25); __pyx_cur_scope->__pyx_t_12 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_t_26); __pyx_cur_scope->__pyx_t_11 = __pyx_t_26; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 8; return __pyx_r; __pyx_L74_resume_from_await:; __pyx_t_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_13); __pyx_t_19 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_25 = __pyx_cur_scope->__pyx_t_12; __pyx_cur_scope->__pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_t_25); __pyx_t_26 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5441, __pyx_L8_error) __pyx_t_24 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_24); } else { __pyx_t_24 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_24) < 0) __PYX_ERR(0, 5441, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_24); } __pyx_t_26 = __pyx_t_24; __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; } __pyx_r = __pyx_t_25; __pyx_t_25 = 0; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_12, __pyx_t_11); __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; goto __pyx_L12_try_return; } __pyx_L18:; } goto __pyx_L75; __pyx_L14_error:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_error; __pyx_L75:; } /* "distributed/scheduler.py":5440 * ws: WorkerState * ts: TaskState * with log_errors(): # <<<<<<<<<<<<<< * async with self._lock if lock else empty_context: * if names is not None: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.retire_workers", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_24, &__pyx_t_5, &__pyx_t_23) < 0) __PYX_ERR(0, 5440, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_23); __pyx_t_3 = PyTuple_Pack(3, __pyx_t_24, __pyx_t_5, __pyx_t_23); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5440, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5440, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_9 < 0) __PYX_ERR(0, 5440, __pyx_L10_except_error) __pyx_t_14 = ((!(__pyx_t_9 != 0)) != 0); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_24); __Pyx_GIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ErrRestoreWithState(__pyx_t_24, __pyx_t_5, __pyx_t_23); __pyx_t_24 = 0; __pyx_t_5 = 0; __pyx_t_23 = 0; __PYX_ERR(0, 5440, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L12_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L5_return; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L7; } __pyx_L5_return: { __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_25 = __pyx_r; __pyx_r = 0; if (__pyx_t_4) { __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } __pyx_r = __pyx_t_25; __pyx_t_25 = 0; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; goto __pyx_L0; } __pyx_L7:; } goto __pyx_L79; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L79:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":5398 * return result * * async def retire_workers( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_23); __Pyx_XDECREF(__pyx_t_24); __Pyx_AddTraceback("retire_workers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5514 * return worker_keys * * def add_keys(self, comm=None, worker=None, keys=()): # <<<<<<<<<<<<<< * """ * Learn that a worker has certain keys */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_133add_keys(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_132add_keys[] = "\n Learn that a worker has certain keys\n\n This should not be used in practice and is mostly here for legacy\n reasons. However, it is sent by workers from time to time.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_133add_keys = {"add_keys", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_133add_keys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_132add_keys}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_133add_keys(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_keys = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_keys (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_worker,&__pyx_n_s_keys,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject*)__pyx_empty_tuple)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_keys") < 0)) __PYX_ERR(0, 5514, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_worker = values[2]; __pyx_v_keys = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_keys", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_132add_keys(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_worker, __pyx_v_keys); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_132add_keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_worker, PyObject *__pyx_v_keys) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_key = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_keys", 0); /* "distributed/scheduler.py":5521 * reasons. However, it is sent by workers from time to time. * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if worker not in parent._workers_dv: * return "not found" */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5522 * """ * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: # <<<<<<<<<<<<<< * return "not found" * ws: WorkerState = parent._workers_dv[worker] */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5522, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_worker, __pyx_v_parent->_workers_dv, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5522, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5523 * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: * return "not found" # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[worker] * for key in keys: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_u_not_found); __pyx_r = __pyx_kp_u_not_found; goto __pyx_L0; /* "distributed/scheduler.py":5522 * """ * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: # <<<<<<<<<<<<<< * return "not found" * ws: WorkerState = parent._workers_dv[worker] */ } /* "distributed/scheduler.py":5524 * if worker not in parent._workers_dv: * return "not found" * ws: WorkerState = parent._workers_dv[worker] # <<<<<<<<<<<<<< * for key in keys: * ts: TaskState = parent._tasks.get(key) */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5524, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_v_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5524, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5525 * return "not found" * ws: WorkerState = parent._workers_dv[worker] * for key in keys: # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks.get(key) * if ts is not None and ts._state == "memory": */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_1 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5525, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5525, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5525, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5525, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5526 * ws: WorkerState = parent._workers_dv[worker] * for key in keys: * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is not None and ts._state == "memory": * if ts not in ws._has_what: */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 5526, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5526, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":5527 * for key in keys: * ts: TaskState = parent._tasks.get(key) * if ts is not None and ts._state == "memory": # <<<<<<<<<<<<<< * if ts not in ws._has_what: * ws._nbytes += ts.get_nbytes() */ __pyx_t_2 = (((PyObject *)__pyx_v_ts) != Py_None); __pyx_t_7 = (__pyx_t_2 != 0); if (__pyx_t_7) { } else { __pyx_t_3 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5527, __pyx_L1_error) __pyx_t_2 = (__pyx_t_7 != 0); __pyx_t_3 = __pyx_t_2; __pyx_L7_bool_binop_done:; if (__pyx_t_3) { /* "distributed/scheduler.py":5528 * ts: TaskState = parent._tasks.get(key) * if ts is not None and ts._state == "memory": * if ts not in ws._has_what: # <<<<<<<<<<<<<< * ws._nbytes += ts.get_nbytes() * ws._has_what.add(ts) */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5528, __pyx_L1_error) } __pyx_t_3 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_ws->_has_what, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5528, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":5529 * if ts is not None and ts._state == "memory": * if ts not in ws._has_what: * ws._nbytes += ts.get_nbytes() # <<<<<<<<<<<<<< * ws._has_what.add(ts) * ts._who_has.add(ws) */ __pyx_t_8 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5529, __pyx_L1_error) __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes + __pyx_t_8); /* "distributed/scheduler.py":5530 * if ts not in ws._has_what: * ws._nbytes += ts.get_nbytes() * ws._has_what.add(ts) # <<<<<<<<<<<<<< * ts._who_has.add(ws) * else: */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 5530, __pyx_L1_error) } __pyx_t_9 = PySet_Add(__pyx_v_ws->_has_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 5530, __pyx_L1_error) /* "distributed/scheduler.py":5531 * ws._nbytes += ts.get_nbytes() * ws._has_what.add(ts) * ts._who_has.add(ws) # <<<<<<<<<<<<<< * else: * self.worker_send( */ if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 5531, __pyx_L1_error) } __pyx_t_9 = PySet_Add(__pyx_v_ts->_who_has, ((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 5531, __pyx_L1_error) /* "distributed/scheduler.py":5528 * ts: TaskState = parent._tasks.get(key) * if ts is not None and ts._state == "memory": * if ts not in ws._has_what: # <<<<<<<<<<<<<< * ws._nbytes += ts.get_nbytes() * ws._has_what.add(ts) */ } /* "distributed/scheduler.py":5527 * for key in keys: * ts: TaskState = parent._tasks.get(key) * if ts is not None and ts._state == "memory": # <<<<<<<<<<<<<< * if ts not in ws._has_what: * ws._nbytes += ts.get_nbytes() */ goto __pyx_L6; } /* "distributed/scheduler.py":5533 * ts._who_has.add(ws) * else: * self.worker_send( # <<<<<<<<<<<<<< * worker, {"op": "delete-data", "keys": [key], "report": False} * ) */ /*else*/ { __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_worker_send); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); /* "distributed/scheduler.py":5534 * else: * self.worker_send( * worker, {"op": "delete-data", "keys": [key], "report": False} # <<<<<<<<<<<<<< * ) * */ __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_op, __pyx_kp_u_delete_data) < 0) __PYX_ERR(0, 5534, __pyx_L1_error) __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyList_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_keys, __pyx_t_12) < 0) __PYX_ERR(0, 5534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_report, Py_False) < 0) __PYX_ERR(0, 5534, __pyx_L1_error) __pyx_t_12 = NULL; __pyx_t_13 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_13 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_worker, __pyx_t_11}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5533, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_worker, __pyx_t_11}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5533, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL; } __Pyx_INCREF(__pyx_v_worker); __Pyx_GIVEREF(__pyx_v_worker); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_v_worker); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L6:; /* "distributed/scheduler.py":5525 * return "not found" * ws: WorkerState = parent._workers_dv[worker] * for key in keys: # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks.get(key) * if ts is not None and ts._state == "memory": */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5537 * ) * * return "OK" # <<<<<<<<<<<<<< * * def update_data( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_u_OK); __pyx_r = __pyx_n_u_OK; goto __pyx_L0; /* "distributed/scheduler.py":5514 * return worker_keys * * def add_keys(self, comm=None, worker=None, keys=()): # <<<<<<<<<<<<<< * """ * Learn that a worker has certain keys */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5539 * return "OK" * * def update_data( # <<<<<<<<<<<<<< * self, comm=None, who_has=None, nbytes=None, client=None, serializers=None * ): */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_135update_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_134update_data[] = "\n Learn that new data has entered the network from an external source\n\n See Also\n --------\n Scheduler.mark_key_in_memory\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_135update_data = {"update_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_135update_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_134update_data}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_135update_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_who_has = 0; PyObject *__pyx_v_nbytes = 0; PyObject *__pyx_v_client = 0; CYTHON_UNUSED PyObject *__pyx_v_serializers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update_data (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_who_has,&__pyx_n_s_nbytes,&__pyx_n_s_client,&__pyx_n_s_serializers,0}; PyObject* values[6] = {0,0,0,0,0,0}; /* "distributed/scheduler.py":5540 * * def update_data( * self, comm=None, who_has=None, nbytes=None, client=None, serializers=None # <<<<<<<<<<<<<< * ): * """ */ values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_None)); values[5] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_who_has); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serializers); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_data") < 0)) __PYX_ERR(0, 5539, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_who_has = values[2]; __pyx_v_nbytes = values[3]; __pyx_v_client = values[4]; __pyx_v_serializers = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update_data", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5539, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_134update_data(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_who_has, __pyx_v_nbytes, __pyx_v_client, __pyx_v_serializers); /* "distributed/scheduler.py":5539 * return "OK" * * def update_data( # <<<<<<<<<<<<<< * self, comm=None, who_has=None, nbytes=None, client=None, serializers=None * ): */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_134update_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_who_has, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_client, CYTHON_UNUSED PyObject *__pyx_v_serializers) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_workers = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_w = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_10genexpr107__pyx_v_k = NULL; PyObject *__pyx_10genexpr107__pyx_v_v = NULL; PyObject *__pyx_10genexpr108__pyx_v_vv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; Py_ssize_t __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; int __pyx_t_19; Py_ssize_t __pyx_t_20; int __pyx_t_21; PyObject *__pyx_t_22 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update_data", 0); __Pyx_INCREF(__pyx_v_who_has); /* "distributed/scheduler.py":5549 * Scheduler.mark_key_in_memory * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * with log_errors(): * who_has = { */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5550 * """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * who_has = { * k: [self.coerce_address(vv) for vv in v] for k, v in who_has.items() */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5550, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5550, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":5551 * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): * who_has = { # <<<<<<<<<<<<<< * k: [self.coerce_address(vv) for vv in v] for k, v in who_has.items() * } */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5551, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5552 * with log_errors(): * who_has = { * k: [self.coerce_address(vv) for vv in v] for k, v in who_has.items() # <<<<<<<<<<<<<< * } * logger.debug("Update data %s", who_has) */ __pyx_t_9 = 0; if (unlikely(__pyx_v_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5552, __pyx_L15_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_who_has, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5552, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_10, &__pyx_t_9, &__pyx_t_3, &__pyx_t_5, NULL, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 5552, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_10genexpr107__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_10genexpr107__pyx_v_v, __pyx_t_5); __pyx_t_5 = 0; { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5552, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_10genexpr107__pyx_v_v)) || PyTuple_CheckExact(__pyx_10genexpr107__pyx_v_v)) { __pyx_t_3 = __pyx_10genexpr107__pyx_v_v; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_10genexpr107__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5552, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5552, __pyx_L20_error) } for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_15 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5552, __pyx_L20_error) #else __pyx_t_15 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5552, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_15); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5552, __pyx_L20_error) #else __pyx_t_15 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5552, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_15); #endif } } else { __pyx_t_15 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_15)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5552, __pyx_L20_error) } break; } __Pyx_GOTREF(__pyx_t_15); } __Pyx_XDECREF_SET(__pyx_10genexpr108__pyx_v_vv, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5552, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_15 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, __pyx_10genexpr108__pyx_v_vv) : __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_10genexpr108__pyx_v_vv); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5552, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_15))) __PYX_ERR(0, 5552, __pyx_L20_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_10genexpr108__pyx_v_vv); __pyx_10genexpr108__pyx_v_vv = 0; goto __pyx_L23_exit_scope; __pyx_L20_error:; __Pyx_XDECREF(__pyx_10genexpr108__pyx_v_vv); __pyx_10genexpr108__pyx_v_vv = 0; goto __pyx_L15_error; __pyx_L23_exit_scope:; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr107__pyx_v_k, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 5552, __pyx_L15_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_10genexpr107__pyx_v_k); __pyx_10genexpr107__pyx_v_k = 0; __Pyx_XDECREF(__pyx_10genexpr107__pyx_v_v); __pyx_10genexpr107__pyx_v_v = 0; goto __pyx_L24_exit_scope; __pyx_L15_error:; __Pyx_XDECREF(__pyx_10genexpr107__pyx_v_k); __pyx_10genexpr107__pyx_v_k = 0; __Pyx_XDECREF(__pyx_10genexpr107__pyx_v_v); __pyx_10genexpr107__pyx_v_v = 0; goto __pyx_L7_error; __pyx_L24_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_who_has, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5554 * k: [self.coerce_address(vv) for vv in v] for k, v in who_has.items() * } * logger.debug("Update data %s", who_has) # <<<<<<<<<<<<<< * * for key, workers in who_has.items(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5554, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5554, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Update_data_s, __pyx_v_who_has}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5554, __pyx_L7_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Update_data_s, __pyx_v_who_has}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5554, __pyx_L7_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5554, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Update_data_s); __Pyx_GIVEREF(__pyx_kp_u_Update_data_s); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_11, __pyx_kp_u_Update_data_s); __Pyx_INCREF(__pyx_v_who_has); __Pyx_GIVEREF(__pyx_v_who_has); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_11, __pyx_v_who_has); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5554, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5556 * logger.debug("Update data %s", who_has) * * for key, workers in who_has.items(): # <<<<<<<<<<<<<< * ts: TaskState = parent._tasks.get(key) * if ts is None: */ __pyx_t_10 = 0; __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_who_has, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_11)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5556, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, &__pyx_t_5, &__pyx_t_3, NULL, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 5556, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_workers, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5557 * * for key, workers in who_has.items(): * ts: TaskState = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is None: * ts: TaskState = self.new_task(key, None, "memory") */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 5557, __pyx_L7_error) } __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5557, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5557, __pyx_L7_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":5558 * for key, workers in who_has.items(): * ts: TaskState = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * ts: TaskState = self.new_task(key, None, "memory") * ts.state = "memory" */ __pyx_t_18 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_19 = (__pyx_t_18 != 0); if (__pyx_t_19) { /* "distributed/scheduler.py":5559 * ts: TaskState = parent._tasks.get(key) * if ts is None: * ts: TaskState = self.new_task(key, None, "memory") # <<<<<<<<<<<<<< * ts.state = "memory" * if key in nbytes: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_new_task); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5559, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_key, Py_None, __pyx_n_u_memory_2}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5559, __pyx_L7_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_key, Py_None, __pyx_n_u_memory_2}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5559, __pyx_L7_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_15 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5559, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_12, __pyx_v_key); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_12, Py_None); __Pyx_INCREF(__pyx_n_u_memory_2); __Pyx_GIVEREF(__pyx_n_u_memory_2); PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_12, __pyx_n_u_memory_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5559, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5559, __pyx_L7_error) __Pyx_DECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":5558 * for key, workers in who_has.items(): * ts: TaskState = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * ts: TaskState = self.new_task(key, None, "memory") * ts.state = "memory" */ } /* "distributed/scheduler.py":5560 * if ts is None: * ts: TaskState = self.new_task(key, None, "memory") * ts.state = "memory" # <<<<<<<<<<<<<< * if key in nbytes: * ts.set_nbytes(nbytes[key]) */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_memory_2) < 0) __PYX_ERR(0, 5560, __pyx_L7_error) /* "distributed/scheduler.py":5561 * ts: TaskState = self.new_task(key, None, "memory") * ts.state = "memory" * if key in nbytes: # <<<<<<<<<<<<<< * ts.set_nbytes(nbytes[key]) * for w in workers: */ __pyx_t_19 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_nbytes, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 5561, __pyx_L7_error) __pyx_t_18 = (__pyx_t_19 != 0); if (__pyx_t_18) { /* "distributed/scheduler.py":5562 * ts.state = "memory" * if key in nbytes: * ts.set_nbytes(nbytes[key]) # <<<<<<<<<<<<<< * for w in workers: * ws: WorkerState = parent._workers_dv[w] */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nbytes, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5562, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5562, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_11distributed_9scheduler_9TaskState_set_nbytes(__pyx_v_ts, __pyx_t_13, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5562, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5561 * ts: TaskState = self.new_task(key, None, "memory") * ts.state = "memory" * if key in nbytes: # <<<<<<<<<<<<<< * ts.set_nbytes(nbytes[key]) * for w in workers: */ } /* "distributed/scheduler.py":5563 * if key in nbytes: * ts.set_nbytes(nbytes[key]) * for w in workers: # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[w] * if ts not in ws._has_what: */ if (likely(PyList_CheckExact(__pyx_v_workers)) || PyTuple_CheckExact(__pyx_v_workers)) { __pyx_t_3 = __pyx_v_workers; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5563, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5563, __pyx_L7_error) } for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5563, __pyx_L7_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5563, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5563, __pyx_L7_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5563, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5563, __pyx_L7_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5564 * ts.set_nbytes(nbytes[key]) * for w in workers: * ws: WorkerState = parent._workers_dv[w] # <<<<<<<<<<<<<< * if ts not in ws._has_what: * ws._nbytes += ts.get_nbytes() */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5564, __pyx_L7_error) } __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_v_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5564, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5564, __pyx_L7_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":5565 * for w in workers: * ws: WorkerState = parent._workers_dv[w] * if ts not in ws._has_what: # <<<<<<<<<<<<<< * ws._nbytes += ts.get_nbytes() * ws._has_what.add(ts) */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5565, __pyx_L7_error) } __pyx_t_18 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_ws->_has_what, Py_NE)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 5565, __pyx_L7_error) __pyx_t_19 = (__pyx_t_18 != 0); if (__pyx_t_19) { /* "distributed/scheduler.py":5566 * ws: WorkerState = parent._workers_dv[w] * if ts not in ws._has_what: * ws._nbytes += ts.get_nbytes() # <<<<<<<<<<<<<< * ws._has_what.add(ts) * ts._who_has.add(ws) */ __pyx_t_20 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5566, __pyx_L7_error) __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes + __pyx_t_20); /* "distributed/scheduler.py":5567 * if ts not in ws._has_what: * ws._nbytes += ts.get_nbytes() * ws._has_what.add(ts) # <<<<<<<<<<<<<< * ts._who_has.add(ws) * self.report( */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 5567, __pyx_L7_error) } __pyx_t_21 = PySet_Add(__pyx_v_ws->_has_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 5567, __pyx_L7_error) /* "distributed/scheduler.py":5568 * ws._nbytes += ts.get_nbytes() * ws._has_what.add(ts) * ts._who_has.add(ws) # <<<<<<<<<<<<<< * self.report( * {"op": "key-in-memory", "key": key, "workers": list(workers)} */ if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 5568, __pyx_L7_error) } __pyx_t_21 = PySet_Add(__pyx_v_ts->_who_has, ((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 5568, __pyx_L7_error) /* "distributed/scheduler.py":5565 * for w in workers: * ws: WorkerState = parent._workers_dv[w] * if ts not in ws._has_what: # <<<<<<<<<<<<<< * ws._nbytes += ts.get_nbytes() * ws._has_what.add(ts) */ } /* "distributed/scheduler.py":5563 * if key in nbytes: * ts.set_nbytes(nbytes[key]) * for w in workers: # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[w] * if ts not in ws._has_what: */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5569 * ws._has_what.add(ts) * ts._who_has.add(ws) * self.report( # <<<<<<<<<<<<<< * {"op": "key-in-memory", "key": key, "workers": list(workers)} * ) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_report); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5569, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":5570 * ts._who_has.add(ws) * self.report( * {"op": "key-in-memory", "key": key, "workers": list(workers)} # <<<<<<<<<<<<<< * ) * */ __pyx_t_15 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5570, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_15, __pyx_n_u_op, __pyx_kp_u_key_in_memory) < 0) __PYX_ERR(0, 5570, __pyx_L7_error) if (PyDict_SetItem(__pyx_t_15, __pyx_n_u_key, __pyx_v_key) < 0) __PYX_ERR(0, 5570, __pyx_L7_error) __pyx_t_2 = PySequence_List(__pyx_v_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5570, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_15, __pyx_n_u_workers, __pyx_t_2) < 0) __PYX_ERR(0, 5570, __pyx_L7_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_15) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_15); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5569, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5573 * ) * * if client: # <<<<<<<<<<<<<< * self.client_desires_keys(keys=list(who_has), client=client) * */ __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_client); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 5573, __pyx_L7_error) if (__pyx_t_19) { /* "distributed/scheduler.py":5574 * * if client: * self.client_desires_keys(keys=list(who_has), client=client) # <<<<<<<<<<<<<< * * def report_on_key(self, key: str = None, ts: TaskState = None, client: str = None): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client_desires_keys_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5574, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5574, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_List(__pyx_v_who_has); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5574, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_keys, __pyx_t_5) < 0) __PYX_ERR(0, 5574, __pyx_L7_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 5574, __pyx_L7_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5574, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5573 * ) * * if client: # <<<<<<<<<<<<<< * self.client_desires_keys(keys=list(who_has), client=client) * */ } /* "distributed/scheduler.py":5550 * """ * parent: SchedulerState = cast(SchedulerState, self) * with log_errors(): # <<<<<<<<<<<<<< * who_has = { * k: [self.coerce_address(vv) for vv in v] for k, v in who_has.items() */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_data", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 5550, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __pyx_t_15 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5550, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 5550, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_22); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (__pyx_t_19 < 0) __PYX_ERR(0, 5550, __pyx_L9_except_error) __pyx_t_18 = ((!(__pyx_t_19 != 0)) != 0); if (__pyx_t_18) { __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_3, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; __PYX_ERR(0, 5550, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L36; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L36:; } /* "distributed/scheduler.py":5539 * return "OK" * * def update_data( # <<<<<<<<<<<<<< * self, comm=None, who_has=None, nbytes=None, client=None, serializers=None * ): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("distributed.scheduler.Scheduler.update_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_workers); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_10genexpr107__pyx_v_k); __Pyx_XDECREF(__pyx_10genexpr107__pyx_v_v); __Pyx_XDECREF(__pyx_10genexpr108__pyx_v_vv); __Pyx_XDECREF(__pyx_v_who_has); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5576 * self.client_desires_keys(keys=list(who_has), client=client) * * def report_on_key(self, key: str = None, ts: TaskState = None, client: str = None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_137report_on_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_137report_on_key = {"report_on_key", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_137report_on_key, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_137report_on_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_client = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("report_on_key (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_ts,&__pyx_n_s_client,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject*)((PyObject *)Py_None)); values[2] = (PyObject *)((struct __pyx_obj_11distributed_9scheduler_TaskState *)((PyObject *)Py_None)); values[3] = ((PyObject*)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "report_on_key") < 0)) __PYX_ERR(0, 5576, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = ((PyObject*)values[1]); __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)values[2]); __pyx_v_client = ((PyObject*)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("report_on_key", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5576, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.report_on_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 5576, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 5576, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), (&PyUnicode_Type), 1, "client", 1))) __PYX_ERR(0, 5576, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_136report_on_key(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_ts, __pyx_v_client); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_136report_on_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, PyObject *__pyx_v_client) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_tasks = 0; PyObject *__pyx_v_report_msg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("report_on_key", 0); __Pyx_INCREF(__pyx_v_key); __Pyx_INCREF((PyObject *)__pyx_v_ts); /* "distributed/scheduler.py":5577 * * def report_on_key(self, key: str = None, ts: TaskState = None, client: str = None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if ts is None: * tasks: dict = parent._tasks */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5578 * def report_on_key(self, key: str = None, ts: TaskState = None, client: str = None): * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: # <<<<<<<<<<<<<< * tasks: dict = parent._tasks * ts = tasks.get(key) */ __pyx_t_2 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5579 * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: * tasks: dict = parent._tasks # <<<<<<<<<<<<<< * ts = tasks.get(key) * elif key is None: */ __pyx_t_1 = __pyx_v_parent->_tasks; __Pyx_INCREF(__pyx_t_1); __pyx_v_tasks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5580 * if ts is None: * tasks: dict = parent._tasks * ts = tasks.get(key) # <<<<<<<<<<<<<< * elif key is None: * key = ts._key */ if (unlikely(__pyx_v_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 5580, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5580, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":5578 * def report_on_key(self, key: str = None, ts: TaskState = None, client: str = None): * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: # <<<<<<<<<<<<<< * tasks: dict = parent._tasks * ts = tasks.get(key) */ goto __pyx_L3; } /* "distributed/scheduler.py":5581 * tasks: dict = parent._tasks * ts = tasks.get(key) * elif key is None: # <<<<<<<<<<<<<< * key = ts._key * else: */ __pyx_t_3 = (__pyx_v_key == ((PyObject*)Py_None)); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":5582 * ts = tasks.get(key) * elif key is None: * key = ts._key # <<<<<<<<<<<<<< * else: * assert False, (key, ts) */ __pyx_t_1 = __pyx_v_ts->_key; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_key, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":5581 * tasks: dict = parent._tasks * ts = tasks.get(key) * elif key is None: # <<<<<<<<<<<<<< * key = ts._key * else: */ goto __pyx_L3; } /* "distributed/scheduler.py":5584 * key = ts._key * else: * assert False, (key, ts) # <<<<<<<<<<<<<< * return * */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!0)) { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_ts)); __pyx_t_4 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 5584, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":5585 * else: * assert False, (key, ts) * return # <<<<<<<<<<<<<< * * report_msg: dict = _task_to_report_msg(parent, ts) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_L3:; /* "distributed/scheduler.py":5587 * return * * report_msg: dict = _task_to_report_msg(parent, ts) # <<<<<<<<<<<<<< * if report_msg is not None: * self.report(report_msg, ts=ts, client=client) */ __pyx_t_4 = __pyx_f_11distributed_9scheduler__task_to_report_msg(__pyx_v_parent, __pyx_v_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_report_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":5588 * * report_msg: dict = _task_to_report_msg(parent, ts) * if report_msg is not None: # <<<<<<<<<<<<<< * self.report(report_msg, ts=ts, client=client) * */ __pyx_t_2 = (__pyx_v_report_msg != ((PyObject*)Py_None)); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5589 * report_msg: dict = _task_to_report_msg(parent, ts) * if report_msg is not None: * self.report(report_msg, ts=ts, client=client) # <<<<<<<<<<<<<< * * async def feed( */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_report); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_report_msg); __Pyx_GIVEREF(__pyx_v_report_msg); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_report_msg); __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_ts, ((PyObject *)__pyx_v_ts)) < 0) __PYX_ERR(0, 5589, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 5589, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":5588 * * report_msg: dict = _task_to_report_msg(parent, ts) * if report_msg is not None: # <<<<<<<<<<<<<< * self.report(report_msg, ts=ts, client=client) * */ } /* "distributed/scheduler.py":5576 * self.client_desires_keys(keys=list(who_has), client=client) * * def report_on_key(self, key: str = None, ts: TaskState = None, client: str = None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.report_on_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_tasks); __Pyx_XDECREF(__pyx_v_report_msg); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_140generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5591 * self.report(report_msg, ts=ts, client=client) * * async def feed( # <<<<<<<<<<<<<< * self, comm, function=None, setup=None, teardown=None, interval="1s", **kwargs * ): */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_139feed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_138feed[] = "\n Provides a data Comm to external requester\n\n Caution: this runs arbitrary Python code on the scheduler. This should\n eventually be phased out. It is mostly used by diagnostics.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_139feed = {"feed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_139feed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_138feed}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_139feed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_function = 0; PyObject *__pyx_v_setup = 0; PyObject *__pyx_v_teardown = 0; PyObject *__pyx_v_interval = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("feed (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_function,&__pyx_n_s_setup,&__pyx_n_s_teardown,&__pyx_n_s_interval,0}; PyObject* values[6] = {0,0,0,0,0,0}; /* "distributed/scheduler.py":5592 * * async def feed( * self, comm, function=None, setup=None, teardown=None, interval="1s", **kwargs # <<<<<<<<<<<<<< * ): * """ */ values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_None)); values[5] = ((PyObject *)((PyObject*)__pyx_kp_u_1s)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 6, 1); __PYX_ERR(0, 5591, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_setup); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_teardown); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "feed") < 0)) __PYX_ERR(0, 5591, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_function = values[2]; __pyx_v_setup = values[3]; __pyx_v_teardown = values[4]; __pyx_v_interval = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5591, __pyx_L3_error) __pyx_L3_error:; __Pyx_CLEAR(__pyx_v_kwargs); __Pyx_AddTraceback("distributed.scheduler.Scheduler.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_138feed(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_function, __pyx_v_setup, __pyx_v_teardown, __pyx_v_interval, __pyx_v_kwargs); /* "distributed/scheduler.py":5591 * self.report(report_msg, ts=ts, client=client) * * async def feed( # <<<<<<<<<<<<<< * self, comm, function=None, setup=None, teardown=None, interval="1s", **kwargs * ): */ /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_138feed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm, PyObject *__pyx_v_function, PyObject *__pyx_v_setup, PyObject *__pyx_v_teardown, PyObject *__pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("feed", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_44_feed(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_44_feed, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5591, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_function = __pyx_v_function; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_function); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_function); __pyx_cur_scope->__pyx_v_setup = __pyx_v_setup; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_setup); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_setup); __pyx_cur_scope->__pyx_v_teardown = __pyx_v_teardown; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_teardown); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_teardown); __pyx_cur_scope->__pyx_v_interval = __pyx_v_interval; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_interval); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_interval); __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_140generator17, __pyx_codeobj__81, (PyObject *) __pyx_cur_scope, __pyx_n_s_feed, __pyx_n_s_Scheduler_feed, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5591, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_140generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_t_20; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("feed", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L19_resume_from_await; case 2: goto __pyx_L32_resume_from_await; case 3: goto __pyx_L33_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5591, __pyx_L1_error) /* "distributed/scheduler.py":5600 * eventually be phased out. It is mostly used by diagnostics. * """ * if not dask.config.get("distributed.scheduler.pickle"): # <<<<<<<<<<<<<< * logger.warn( * "Tried to call 'feed' route with custom functions, but " */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_distributed_scheduler_pickle) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_distributed_scheduler_pickle); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 5600, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = ((!__pyx_t_4) != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":5601 * """ * if not dask.config.get("distributed.scheduler.pickle"): * logger.warn( # <<<<<<<<<<<<<< * "Tried to call 'feed' route with custom functions, but " * "pickle is disallowed. Set the 'distributed.scheduler.pickle'" */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_Tried_to_call_feed_route_with_cu) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Tried_to_call_feed_route_with_cu); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5607 * "commonly used with progress bars)" * ) * return # <<<<<<<<<<<<<< * * interval = parse_timedelta(interval) */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L0; /* "distributed/scheduler.py":5600 * eventually be phased out. It is mostly used by diagnostics. * """ * if not dask.config.get("distributed.scheduler.pickle"): # <<<<<<<<<<<<<< * logger.warn( * "Tried to call 'feed' route with custom functions, but " */ } /* "distributed/scheduler.py":5609 * return * * interval = parse_timedelta(interval) # <<<<<<<<<<<<<< * with log_errors(): * if function: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_interval) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_interval); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_interval); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_interval, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5610 * * interval = parse_timedelta(interval) * with log_errors(): # <<<<<<<<<<<<<< * if function: * function = pickle.loads(function) */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5610, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5610, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "distributed/scheduler.py":5611 * interval = parse_timedelta(interval) * with log_errors(): * if function: # <<<<<<<<<<<<<< * function = pickle.loads(function) * if setup: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_function); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5611, __pyx_L9_error) if (__pyx_t_5) { /* "distributed/scheduler.py":5612 * with log_errors(): * if function: * function = pickle.loads(function) # <<<<<<<<<<<<<< * if setup: * setup = pickle.loads(setup) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5612, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5612, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_function) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_function); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5612, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_function); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_function, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5611 * interval = parse_timedelta(interval) * with log_errors(): * if function: # <<<<<<<<<<<<<< * function = pickle.loads(function) * if setup: */ } /* "distributed/scheduler.py":5613 * if function: * function = pickle.loads(function) * if setup: # <<<<<<<<<<<<<< * setup = pickle.loads(setup) * if teardown: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_setup); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5613, __pyx_L9_error) if (__pyx_t_5) { /* "distributed/scheduler.py":5614 * function = pickle.loads(function) * if setup: * setup = pickle.loads(setup) # <<<<<<<<<<<<<< * if teardown: * teardown = pickle.loads(teardown) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5614, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5614, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_setup) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_setup); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5614, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_setup); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_setup, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5613 * if function: * function = pickle.loads(function) * if setup: # <<<<<<<<<<<<<< * setup = pickle.loads(setup) * if teardown: */ } /* "distributed/scheduler.py":5615 * if setup: * setup = pickle.loads(setup) * if teardown: # <<<<<<<<<<<<<< * teardown = pickle.loads(teardown) * state = setup(self) if setup else None */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_teardown); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5615, __pyx_L9_error) if (__pyx_t_5) { /* "distributed/scheduler.py":5616 * setup = pickle.loads(setup) * if teardown: * teardown = pickle.loads(teardown) # <<<<<<<<<<<<<< * state = setup(self) if setup else None * if inspect.isawaitable(state): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5616, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5616, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_teardown) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_teardown); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5616, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_teardown); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_teardown, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5615 * if setup: * setup = pickle.loads(setup) * if teardown: # <<<<<<<<<<<<<< * teardown = pickle.loads(teardown) * state = setup(self) if setup else None */ } /* "distributed/scheduler.py":5617 * if teardown: * teardown = pickle.loads(teardown) * state = setup(self) if setup else None # <<<<<<<<<<<<<< * if inspect.isawaitable(state): * state = await state */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_setup); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5617, __pyx_L9_error) if (__pyx_t_5) { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_setup); __pyx_t_3 = __pyx_cur_scope->__pyx_v_setup; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_cur_scope->__pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_self); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5617, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_state = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5618 * teardown = pickle.loads(teardown) * state = setup(self) if setup else None * if inspect.isawaitable(state): # <<<<<<<<<<<<<< * state = await state * try: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_inspect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5618, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isawaitable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5618, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_state) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_state); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5618, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5618, __pyx_L9_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":5619 * state = setup(self) if setup else None * if inspect.isawaitable(state): * state = await state # <<<<<<<<<<<<<< * try: * while self.status == Status.running: */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_state); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L19_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5619, __pyx_L9_error) __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_1 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 5619, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_state); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_state, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5618 * teardown = pickle.loads(teardown) * state = setup(self) if setup else None * if inspect.isawaitable(state): # <<<<<<<<<<<<<< * state = await state * try: */ } /* "distributed/scheduler.py":5620 * if inspect.isawaitable(state): * state = await state * try: # <<<<<<<<<<<<<< * while self.status == Status.running: * if state is None: */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "distributed/scheduler.py":5621 * state = await state * try: * while self.status == Status.running: # <<<<<<<<<<<<<< * if state is None: * response = function(self) */ while (1) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5621, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5621, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_running); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5621, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5621, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5621, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_5) break; /* "distributed/scheduler.py":5622 * try: * while self.status == Status.running: * if state is None: # <<<<<<<<<<<<<< * response = function(self) * else: */ __pyx_t_5 = (__pyx_cur_scope->__pyx_v_state == Py_None); __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { /* "distributed/scheduler.py":5623 * while self.status == Status.running: * if state is None: * response = function(self) # <<<<<<<<<<<<<< * else: * response = function(self, state) */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_function); __pyx_t_2 = __pyx_cur_scope->__pyx_v_function; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_cur_scope->__pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_self); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5623, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_response); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_response, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5622 * try: * while self.status == Status.running: * if state is None: # <<<<<<<<<<<<<< * response = function(self) * else: */ goto __pyx_L31; } /* "distributed/scheduler.py":5625 * response = function(self) * else: * response = function(self, state) # <<<<<<<<<<<<<< * await comm.write(response) * await asyncio.sleep(interval) */ /*else*/ { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_function); __pyx_t_2 = __pyx_cur_scope->__pyx_v_function; __pyx_t_1 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_state}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5625, __pyx_L23_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_state}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5625, __pyx_L23_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5625, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_14, __pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_14, __pyx_cur_scope->__pyx_v_state); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5625, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_response); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_response, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L31:; /* "distributed/scheduler.py":5626 * else: * response = function(self, state) * await comm.write(response) # <<<<<<<<<<<<<< * await asyncio.sleep(interval) * except (EnvironmentError, CommClosedError): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_comm, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5626, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_cur_scope->__pyx_v_response) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_response); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5626, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_4 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_5 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_6 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L32_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5626, __pyx_L23_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 5626, __pyx_L23_error) } } /* "distributed/scheduler.py":5627 * response = function(self, state) * await comm.write(response) * await asyncio.sleep(interval) # <<<<<<<<<<<<<< * except (EnvironmentError, CommClosedError): * pass */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5627, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sleep); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5627, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_cur_scope->__pyx_v_interval) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_cur_scope->__pyx_v_interval); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5627, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_4 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_5 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_6 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L33_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5627, __pyx_L23_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 5627, __pyx_L23_error) } } } /* "distributed/scheduler.py":5620 * if inspect.isawaitable(state): * state = await state * try: # <<<<<<<<<<<<<< * while self.status == Status.running: * if state is None: */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L28_try_end; __pyx_L23_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":5628 * await comm.write(response) * await asyncio.sleep(interval) * except (EnvironmentError, CommClosedError): # <<<<<<<<<<<<<< * pass * finally: */ __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_7, &__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5628, __pyx_L25_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_builtin_EnvironmentError) || __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_ErrRestore(__pyx_t_3, __pyx_t_7, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_2 = 0; if (__pyx_t_14) { __Pyx_ErrRestore(0,0,0); goto __pyx_L24_exception_handled; } goto __pyx_L25_except_error; __pyx_L25_except_error:; /* "distributed/scheduler.py":5620 * if inspect.isawaitable(state): * state = await state * try: # <<<<<<<<<<<<<< * while self.status == Status.running: * if state is None: */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L21_error; __pyx_L24_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L28_try_end:; } } /* "distributed/scheduler.py":5631 * pass * finally: * if teardown: # <<<<<<<<<<<<<< * teardown(self, state) * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_teardown); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 5631, __pyx_L9_error) if (__pyx_t_4) { /* "distributed/scheduler.py":5632 * finally: * if teardown: * teardown(self, state) # <<<<<<<<<<<<<< * * def log_worker_event(self, worker=None, topic=None, msg=None): */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_teardown); __pyx_t_7 = __pyx_cur_scope->__pyx_v_teardown; __pyx_t_3 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_state}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5632, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_state}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5632, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5632, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_14, __pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_14, __pyx_cur_scope->__pyx_v_state); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5632, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5631 * pass * finally: * if teardown: # <<<<<<<<<<<<<< * teardown(self, state) * */ } goto __pyx_L22; } __pyx_L21_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_teardown); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 5631, __pyx_L36_error) if (__pyx_t_4) { /* "distributed/scheduler.py":5632 * finally: * if teardown: * teardown(self, state) # <<<<<<<<<<<<<< * * def log_worker_event(self, worker=None, topic=None, msg=None): */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_teardown); __pyx_t_7 = __pyx_cur_scope->__pyx_v_teardown; __pyx_t_1 = NULL; __pyx_t_20 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_20 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_state}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5632, __pyx_L36_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_state}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5632, __pyx_L36_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5632, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_20, __pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_20, __pyx_cur_scope->__pyx_v_state); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5632, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5631 * pass * finally: * if teardown: # <<<<<<<<<<<<<< * teardown(self, state) * */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_12, __pyx_t_11); __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L9_error; __pyx_L36_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; goto __pyx_L9_error; } __pyx_L22:; } /* "distributed/scheduler.py":5610 * * interval = parse_timedelta(interval) * with log_errors(): # <<<<<<<<<<<<<< * if function: * function = pickle.loads(function) */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L14_try_end; __pyx_L9_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(0, 5610, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5610, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 5610, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_19); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (__pyx_t_4 < 0) __PYX_ERR(0, 5610, __pyx_L11_except_error) __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_7, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 5610, __pyx_L11_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L10_exception_handled; } __pyx_L11_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L10_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L8; } __pyx_L8:; } goto __pyx_L41; __pyx_L5_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L41:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":5591 * self.report(report_msg, ts=ts, client=client) * * async def feed( # <<<<<<<<<<<<<< * self, comm, function=None, setup=None, teardown=None, interval="1s", **kwargs * ): */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("feed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5634 * teardown(self, state) * * def log_worker_event(self, worker=None, topic=None, msg=None): # <<<<<<<<<<<<<< * self.log_event(topic, msg) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_142log_worker_event(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_142log_worker_event = {"log_worker_event", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_142log_worker_event, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_142log_worker_event(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_topic = 0; PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("log_worker_event (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker,&__pyx_n_s_topic,&__pyx_n_s_msg,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_topic); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "log_worker_event") < 0)) __PYX_ERR(0, 5634, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_worker = values[1]; __pyx_v_topic = values[2]; __pyx_v_msg = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("log_worker_event", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5634, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.log_worker_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_141log_worker_event(__pyx_self, __pyx_v_self, __pyx_v_worker, __pyx_v_topic, __pyx_v_msg); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_141log_worker_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_worker, PyObject *__pyx_v_topic, PyObject *__pyx_v_msg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("log_worker_event", 0); /* "distributed/scheduler.py":5635 * * def log_worker_event(self, worker=None, topic=None, msg=None): * self.log_event(topic, msg) # <<<<<<<<<<<<<< * * def subscribe_worker_status(self, comm=None): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_topic, __pyx_v_msg}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5635, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_topic, __pyx_v_msg}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5635, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_topic); __Pyx_GIVEREF(__pyx_v_topic); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_topic); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_msg); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5634 * teardown(self, state) * * def log_worker_event(self, worker=None, topic=None, msg=None): # <<<<<<<<<<<<<< * self.log_event(topic, msg) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.log_worker_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5637 * self.log_event(topic, msg) * * def subscribe_worker_status(self, comm=None): # <<<<<<<<<<<<<< * WorkerStatusPlugin(self, comm) * ident = self.identity() */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_144subscribe_worker_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_144subscribe_worker_status = {"subscribe_worker_status", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_144subscribe_worker_status, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_144subscribe_worker_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subscribe_worker_status (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subscribe_worker_status") < 0)) __PYX_ERR(0, 5637, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("subscribe_worker_status", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5637, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.subscribe_worker_status", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_143subscribe_worker_status(__pyx_self, __pyx_v_self, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_143subscribe_worker_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_comm) { PyObject *__pyx_v_ident = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subscribe_worker_status", 0); /* "distributed/scheduler.py":5638 * * def subscribe_worker_status(self, comm=None): * WorkerStatusPlugin(self, comm) # <<<<<<<<<<<<<< * ident = self.identity() * for v in ident["workers"].values(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WorkerStatusPlugin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_comm}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5638, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_comm}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5638, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self); __Pyx_INCREF(__pyx_v_comm); __Pyx_GIVEREF(__pyx_v_comm); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_comm); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5639 * def subscribe_worker_status(self, comm=None): * WorkerStatusPlugin(self, comm) * ident = self.identity() # <<<<<<<<<<<<<< * for v in ident["workers"].values(): * del v["metrics"] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_identity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ident = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5640 * WorkerStatusPlugin(self, comm) * ident = self.identity() * for v in ident["workers"].values(): # <<<<<<<<<<<<<< * del v["metrics"] * del v["last_seen"] */ __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ident, __pyx_n_u_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 5640, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_n_s_values, (&__pyx_t_7), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_6, NULL, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5641 * ident = self.identity() * for v in ident["workers"].values(): * del v["metrics"] # <<<<<<<<<<<<<< * del v["last_seen"] * return ident */ if (unlikely(PyObject_DelItem(__pyx_v_v, __pyx_n_u_metrics) < 0)) __PYX_ERR(0, 5641, __pyx_L1_error) /* "distributed/scheduler.py":5642 * for v in ident["workers"].values(): * del v["metrics"] * del v["last_seen"] # <<<<<<<<<<<<<< * return ident * */ if (unlikely(PyObject_DelItem(__pyx_v_v, __pyx_n_u_last_seen) < 0)) __PYX_ERR(0, 5642, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5643 * del v["metrics"] * del v["last_seen"] * return ident # <<<<<<<<<<<<<< * * def get_processing(self, comm=None, workers=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ident); __pyx_r = __pyx_v_ident; goto __pyx_L0; /* "distributed/scheduler.py":5637 * self.log_event(topic, msg) * * def subscribe_worker_status(self, comm=None): # <<<<<<<<<<<<<< * WorkerStatusPlugin(self, comm) * ident = self.identity() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.subscribe_worker_status", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ident); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5645 * return ident * * def get_processing(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_146get_processing(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_146get_processing = {"get_processing", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_146get_processing, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_146get_processing(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_workers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_processing (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_workers,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_processing") < 0)) __PYX_ERR(0, 5645, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_workers = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_processing", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5645, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_processing", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_145get_processing(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_workers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_145get_processing(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_10genexpr109__pyx_v_w = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr110__pyx_v_ts = NULL; PyObject *__pyx_10genexpr111__pyx_v_w = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr111__pyx_v_ws = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr112__pyx_v_ts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; int __pyx_t_13; Py_ssize_t __pyx_t_14; Py_ssize_t __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_processing", 0); __Pyx_INCREF(__pyx_v_workers); /* "distributed/scheduler.py":5646 * * def get_processing(self, comm=None, workers=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * ts: TaskState */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5649 * ws: WorkerState * ts: TaskState * if workers is not None: # <<<<<<<<<<<<<< * workers = set(map(self.coerce_address, workers)) * return { */ __pyx_t_2 = (__pyx_v_workers != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5650 * ts: TaskState * if workers is not None: * workers = set(map(self.coerce_address, workers)) # <<<<<<<<<<<<<< * return { * w: [ts._key for ts in parent._workers_dv[w].processing] for w in workers */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_workers); __Pyx_GIVEREF(__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_workers); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_workers, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":5651 * if workers is not None: * workers = set(map(self.coerce_address, workers)) * return { # <<<<<<<<<<<<<< * w: [ts._key for ts in parent._workers_dv[w].processing] for w in workers * } */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5651, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":5652 * workers = set(map(self.coerce_address, workers)) * return { * w: [ts._key for ts in parent._workers_dv[w].processing] for w in workers # <<<<<<<<<<<<<< * } * else: */ if (likely(PyList_CheckExact(__pyx_v_workers)) || PyTuple_CheckExact(__pyx_v_workers)) { __pyx_t_1 = __pyx_v_workers; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5652, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5652, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5652, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5652, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5652, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5652, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5652, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_10genexpr109__pyx_v_w, __pyx_t_7); __pyx_t_7 = 0; { /* enter inner scope */ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5652, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5652, __pyx_L11_error) } __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_10genexpr109__pyx_v_w); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5652, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_processing_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5652, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5652, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5652, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 5652, __pyx_L11_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5652, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 5652, __pyx_L11_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5652, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5652, __pyx_L11_error) } break; } __Pyx_GOTREF(__pyx_t_9); } if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5652, __pyx_L11_error) __Pyx_XDECREF_SET(__pyx_10genexpr110__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_10genexpr110__pyx_v_ts->_key))) __PYX_ERR(0, 5652, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr110__pyx_v_ts); __pyx_10genexpr110__pyx_v_ts = 0; goto __pyx_L14_exit_scope; __pyx_L11_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr110__pyx_v_ts); __pyx_10genexpr110__pyx_v_ts = 0; goto __pyx_L6_error; __pyx_L14_exit_scope:; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_10genexpr109__pyx_v_w, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 5652, __pyx_L6_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_10genexpr109__pyx_v_w); __pyx_10genexpr109__pyx_v_w = 0; goto __pyx_L15_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_10genexpr109__pyx_v_w); __pyx_10genexpr109__pyx_v_w = 0; goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5649 * ws: WorkerState * ts: TaskState * if workers is not None: # <<<<<<<<<<<<<< * workers = set(map(self.coerce_address, workers)) * return { */ } /* "distributed/scheduler.py":5655 * } * else: * return { # <<<<<<<<<<<<<< * w: [ts._key for ts in ws._processing] * for w, ws in parent._workers_dv.items() */ /*else*/ { __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5655, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":5657 * return { * w: [ts._key for ts in ws._processing] * for w, ws in parent._workers_dv.items() # <<<<<<<<<<<<<< * } * */ __pyx_t_5 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5657, __pyx_L18_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_12)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5657, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_5, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_12); if (unlikely(__pyx_t_13 == 0)) break; if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 5657, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5657, __pyx_L18_error) __Pyx_XDECREF_SET(__pyx_10genexpr111__pyx_v_w, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_10genexpr111__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_8)); __pyx_t_8 = 0; /* "distributed/scheduler.py":5656 * else: * return { * w: [ts._key for ts in ws._processing] # <<<<<<<<<<<<<< * for w, ws in parent._workers_dv.items() * } */ { /* enter inner scope */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5656, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_14 = 0; if (unlikely(__pyx_10genexpr111__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5656, __pyx_L23_error) } __pyx_t_9 = __Pyx_dict_iterator(__pyx_10genexpr111__pyx_v_ws->_processing, 1, ((PyObject *)NULL), (&__pyx_t_15), (&__pyx_t_13)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5656, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_15, &__pyx_t_14, &__pyx_t_9, NULL, NULL, __pyx_t_13); if (unlikely(__pyx_t_16 == 0)) break; if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 5656, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5656, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_10genexpr112__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_10genexpr112__pyx_v_ts->_key))) __PYX_ERR(0, 5656, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr112__pyx_v_ts); __pyx_10genexpr112__pyx_v_ts = 0; goto __pyx_L26_exit_scope; __pyx_L23_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr112__pyx_v_ts); __pyx_10genexpr112__pyx_v_ts = 0; goto __pyx_L18_error; __pyx_L26_exit_scope:; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_10genexpr111__pyx_v_w, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 5656, __pyx_L18_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_10genexpr111__pyx_v_w); __pyx_10genexpr111__pyx_v_w = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr111__pyx_v_ws); __pyx_10genexpr111__pyx_v_ws = 0; goto __pyx_L27_exit_scope; __pyx_L18_error:; __Pyx_XDECREF(__pyx_10genexpr111__pyx_v_w); __pyx_10genexpr111__pyx_v_w = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr111__pyx_v_ws); __pyx_10genexpr111__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L27_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":5645 * return ident * * def get_processing(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_processing", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_10genexpr109__pyx_v_w); __Pyx_XDECREF((PyObject *)__pyx_10genexpr110__pyx_v_ts); __Pyx_XDECREF(__pyx_10genexpr111__pyx_v_w); __Pyx_XDECREF((PyObject *)__pyx_10genexpr111__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_10genexpr112__pyx_v_ts); __Pyx_XDECREF(__pyx_v_workers); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5660 * } * * def get_who_has(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_148get_who_has(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_148get_who_has = {"get_who_has", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_148get_who_has, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_148get_who_has(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_who_has (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_who_has") < 0)) __PYX_ERR(0, 5660, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_who_has", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5660, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_who_has", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_147get_who_has(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_147get_who_has(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_10genexpr113__pyx_v_k = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr114__pyx_v_ws = NULL; PyObject *__pyx_10genexpr115__pyx_v_key = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr115__pyx_v_ts = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr116__pyx_v_ws = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); int __pyx_t_13; int __pyx_t_14; Py_ssize_t __pyx_t_15; Py_ssize_t __pyx_t_16; int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_who_has", 0); /* "distributed/scheduler.py":5661 * * def get_who_has(self, comm=None, keys=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * ts: TaskState */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5664 * ws: WorkerState * ts: TaskState * if keys is not None: # <<<<<<<<<<<<<< * return { * k: [ws._address for ws in parent._tasks[k].who_has] */ __pyx_t_2 = (__pyx_v_keys != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5665 * ts: TaskState * if keys is not None: * return { # <<<<<<<<<<<<<< * k: [ws._address for ws in parent._tasks[k].who_has] * if k in parent._tasks */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5669 * if k in parent._tasks * else [] * for k in keys # <<<<<<<<<<<<<< * } * else: */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_4 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5669, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5669, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5669, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5669, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5669, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5669, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5669, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_10genexpr113__pyx_v_k, __pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":5667 * return { * k: [ws._address for ws in parent._tasks[k].who_has] * if k in parent._tasks # <<<<<<<<<<<<<< * else [] * for k in keys */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5667, __pyx_L6_error) } __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_10genexpr113__pyx_v_k, __pyx_v_parent->_tasks, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5667, __pyx_L6_error) if ((__pyx_t_3 != 0)) { { /* enter inner scope */ /* "distributed/scheduler.py":5666 * if keys is not None: * return { * k: [ws._address for ws in parent._tasks[k].who_has] # <<<<<<<<<<<<<< * if k in parent._tasks * else [] */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5666, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5666, __pyx_L11_error) } __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_10genexpr113__pyx_v_k); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5666, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_who_has); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5666, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5666, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5666, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 5666, __pyx_L11_error) #else __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5666, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 5666, __pyx_L11_error) #else __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5666, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); #endif } } else { __pyx_t_10 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5666, __pyx_L11_error) } break; } __Pyx_GOTREF(__pyx_t_10); } if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5666, __pyx_L11_error) __Pyx_XDECREF_SET(__pyx_10genexpr114__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_10)); __pyx_t_10 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_10genexpr114__pyx_v_ws->_address))) __PYX_ERR(0, 5666, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr114__pyx_v_ws); __pyx_10genexpr114__pyx_v_ws = 0; goto __pyx_L14_exit_scope; __pyx_L11_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr114__pyx_v_ws); __pyx_10genexpr114__pyx_v_ws = 0; goto __pyx_L6_error; __pyx_L14_exit_scope:; } /* exit inner scope */ __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } else { /* "distributed/scheduler.py":5668 * k: [ws._address for ws in parent._tasks[k].who_has] * if k in parent._tasks * else [] # <<<<<<<<<<<<<< * for k in keys * } */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5668, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr113__pyx_v_k, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 5666, __pyx_L6_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":5669 * if k in parent._tasks * else [] * for k in keys # <<<<<<<<<<<<<< * } * else: */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_10genexpr113__pyx_v_k); __pyx_10genexpr113__pyx_v_k = 0; goto __pyx_L15_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_10genexpr113__pyx_v_k); __pyx_10genexpr113__pyx_v_k = 0; goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5664 * ws: WorkerState * ts: TaskState * if keys is not None: # <<<<<<<<<<<<<< * return { * k: [ws._address for ws in parent._tasks[k].who_has] */ } /* "distributed/scheduler.py":5672 * } * else: * return { # <<<<<<<<<<<<<< * key: [ws._address for ws in ts._who_has] * for key, ts in parent._tasks.items() */ /*else*/ { __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5672, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5674 * return { * key: [ws._address for ws in ts._who_has] * for key, ts in parent._tasks.items() # <<<<<<<<<<<<<< * } * */ __pyx_t_5 = 0; if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5674, __pyx_L18_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_parent->_tasks, 1, __pyx_n_s_items, (&__pyx_t_11), (&__pyx_t_13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5674, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_11, &__pyx_t_5, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_13); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5674, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5674, __pyx_L18_error) __Pyx_XDECREF_SET(__pyx_10genexpr115__pyx_v_key, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_10genexpr115__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_8)); __pyx_t_8 = 0; /* "distributed/scheduler.py":5673 * else: * return { * key: [ws._address for ws in ts._who_has] # <<<<<<<<<<<<<< * for key, ts in parent._tasks.items() * } */ { /* enter inner scope */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5673, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_15 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_10genexpr115__pyx_v_ts->_who_has, 1, (&__pyx_t_16), (&__pyx_t_14)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5673, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_17 = __Pyx_set_iter_next(__pyx_t_7, __pyx_t_16, &__pyx_t_15, &__pyx_t_9, __pyx_t_14); if (unlikely(__pyx_t_17 == 0)) break; if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 5673, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5673, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_10genexpr116__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_9)); __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_10genexpr116__pyx_v_ws->_address))) __PYX_ERR(0, 5673, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr116__pyx_v_ws); __pyx_10genexpr116__pyx_v_ws = 0; goto __pyx_L26_exit_scope; __pyx_L23_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr116__pyx_v_ws); __pyx_10genexpr116__pyx_v_ws = 0; goto __pyx_L18_error; __pyx_L26_exit_scope:; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr115__pyx_v_key, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 5673, __pyx_L18_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_10genexpr115__pyx_v_key); __pyx_10genexpr115__pyx_v_key = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr115__pyx_v_ts); __pyx_10genexpr115__pyx_v_ts = 0; goto __pyx_L27_exit_scope; __pyx_L18_error:; __Pyx_XDECREF(__pyx_10genexpr115__pyx_v_key); __pyx_10genexpr115__pyx_v_key = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr115__pyx_v_ts); __pyx_10genexpr115__pyx_v_ts = 0; goto __pyx_L1_error; __pyx_L27_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":5660 * } * * def get_who_has(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_who_has", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_10genexpr113__pyx_v_k); __Pyx_XDECREF((PyObject *)__pyx_10genexpr114__pyx_v_ws); __Pyx_XDECREF(__pyx_10genexpr115__pyx_v_key); __Pyx_XDECREF((PyObject *)__pyx_10genexpr115__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_10genexpr116__pyx_v_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5677 * } * * def get_has_what(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_150get_has_what(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_150get_has_what = {"get_has_what", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_150get_has_what, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_150get_has_what(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_workers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_has_what (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_workers,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_has_what") < 0)) __PYX_ERR(0, 5677, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_workers = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_has_what", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5677, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_has_what", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_149get_has_what(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_workers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_149get_has_what(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_10genexpr117__pyx_v_w = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr118__pyx_v_ts = NULL; PyObject *__pyx_10genexpr119__pyx_v_w = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr119__pyx_v_ws = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr120__pyx_v_ts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); int __pyx_t_13; int __pyx_t_14; Py_ssize_t __pyx_t_15; Py_ssize_t __pyx_t_16; int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_has_what", 0); __Pyx_INCREF(__pyx_v_workers); /* "distributed/scheduler.py":5678 * * def get_has_what(self, comm=None, workers=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * ts: TaskState */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5681 * ws: WorkerState * ts: TaskState * if workers is not None: # <<<<<<<<<<<<<< * workers = map(self.coerce_address, workers) * return { */ __pyx_t_2 = (__pyx_v_workers != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5682 * ts: TaskState * if workers is not None: * workers = map(self.coerce_address, workers) # <<<<<<<<<<<<<< * return { * w: [ts._key for ts in parent._workers_dv[w].has_what] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_workers); __Pyx_GIVEREF(__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_workers); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_workers, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5683 * if workers is not None: * workers = map(self.coerce_address, workers) * return { # <<<<<<<<<<<<<< * w: [ts._key for ts in parent._workers_dv[w].has_what] * if w in parent._workers_dv */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5683, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5687 * if w in parent._workers_dv * else [] * for w in workers # <<<<<<<<<<<<<< * } * else: */ if (likely(PyList_CheckExact(__pyx_v_workers)) || PyTuple_CheckExact(__pyx_v_workers)) { __pyx_t_4 = __pyx_v_workers; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_workers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5687, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5687, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5687, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5687, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5687, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5687, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5687, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_10genexpr117__pyx_v_w, __pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":5685 * return { * w: [ts._key for ts in parent._workers_dv[w].has_what] * if w in parent._workers_dv # <<<<<<<<<<<<<< * else [] * for w in workers */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5685, __pyx_L6_error) } __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_10genexpr117__pyx_v_w, __pyx_v_parent->_workers_dv, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5685, __pyx_L6_error) if ((__pyx_t_3 != 0)) { { /* enter inner scope */ /* "distributed/scheduler.py":5684 * workers = map(self.coerce_address, workers) * return { * w: [ts._key for ts in parent._workers_dv[w].has_what] # <<<<<<<<<<<<<< * if w in parent._workers_dv * else [] */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5684, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5684, __pyx_L11_error) } __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_10genexpr117__pyx_v_w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5684, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_has_what); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5684, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5684, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5684, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 5684, __pyx_L11_error) #else __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5684, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 5684, __pyx_L11_error) #else __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5684, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); #endif } } else { __pyx_t_10 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5684, __pyx_L11_error) } break; } __Pyx_GOTREF(__pyx_t_10); } if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5684, __pyx_L11_error) __Pyx_XDECREF_SET(__pyx_10genexpr118__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_10)); __pyx_t_10 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_10genexpr118__pyx_v_ts->_key))) __PYX_ERR(0, 5684, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr118__pyx_v_ts); __pyx_10genexpr118__pyx_v_ts = 0; goto __pyx_L14_exit_scope; __pyx_L11_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr118__pyx_v_ts); __pyx_10genexpr118__pyx_v_ts = 0; goto __pyx_L6_error; __pyx_L14_exit_scope:; } /* exit inner scope */ __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } else { /* "distributed/scheduler.py":5686 * w: [ts._key for ts in parent._workers_dv[w].has_what] * if w in parent._workers_dv * else [] # <<<<<<<<<<<<<< * for w in workers * } */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5686, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr117__pyx_v_w, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 5684, __pyx_L6_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":5687 * if w in parent._workers_dv * else [] * for w in workers # <<<<<<<<<<<<<< * } * else: */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_10genexpr117__pyx_v_w); __pyx_10genexpr117__pyx_v_w = 0; goto __pyx_L15_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_10genexpr117__pyx_v_w); __pyx_10genexpr117__pyx_v_w = 0; goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5681 * ws: WorkerState * ts: TaskState * if workers is not None: # <<<<<<<<<<<<<< * workers = map(self.coerce_address, workers) * return { */ } /* "distributed/scheduler.py":5690 * } * else: * return { # <<<<<<<<<<<<<< * w: [ts._key for ts in ws._has_what] * for w, ws in parent._workers_dv.items() */ /*else*/ { __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5690, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5692 * return { * w: [ts._key for ts in ws._has_what] * for w, ws in parent._workers_dv.items() # <<<<<<<<<<<<<< * } * */ __pyx_t_5 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5692, __pyx_L18_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_11), (&__pyx_t_13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5692, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_11, &__pyx_t_5, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_13); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5692, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5692, __pyx_L18_error) __Pyx_XDECREF_SET(__pyx_10genexpr119__pyx_v_w, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_10genexpr119__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_8)); __pyx_t_8 = 0; /* "distributed/scheduler.py":5691 * else: * return { * w: [ts._key for ts in ws._has_what] # <<<<<<<<<<<<<< * for w, ws in parent._workers_dv.items() * } */ { /* enter inner scope */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5691, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_15 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_10genexpr119__pyx_v_ws->_has_what, 1, (&__pyx_t_16), (&__pyx_t_14)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5691, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_17 = __Pyx_set_iter_next(__pyx_t_7, __pyx_t_16, &__pyx_t_15, &__pyx_t_9, __pyx_t_14); if (unlikely(__pyx_t_17 == 0)) break; if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 5691, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5691, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_10genexpr120__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_10genexpr120__pyx_v_ts->_key))) __PYX_ERR(0, 5691, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr120__pyx_v_ts); __pyx_10genexpr120__pyx_v_ts = 0; goto __pyx_L26_exit_scope; __pyx_L23_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr120__pyx_v_ts); __pyx_10genexpr120__pyx_v_ts = 0; goto __pyx_L18_error; __pyx_L26_exit_scope:; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr119__pyx_v_w, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 5691, __pyx_L18_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_10genexpr119__pyx_v_w); __pyx_10genexpr119__pyx_v_w = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr119__pyx_v_ws); __pyx_10genexpr119__pyx_v_ws = 0; goto __pyx_L27_exit_scope; __pyx_L18_error:; __Pyx_XDECREF(__pyx_10genexpr119__pyx_v_w); __pyx_10genexpr119__pyx_v_w = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr119__pyx_v_ws); __pyx_10genexpr119__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L27_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":5677 * } * * def get_has_what(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_has_what", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_10genexpr117__pyx_v_w); __Pyx_XDECREF((PyObject *)__pyx_10genexpr118__pyx_v_ts); __Pyx_XDECREF(__pyx_10genexpr119__pyx_v_w); __Pyx_XDECREF((PyObject *)__pyx_10genexpr119__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_10genexpr120__pyx_v_ts); __Pyx_XDECREF(__pyx_v_workers); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5695 * } * * def get_ncores(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_152get_ncores(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_152get_ncores = {"get_ncores", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_152get_ncores, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_152get_ncores(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_workers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ncores (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_workers,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_ncores") < 0)) __PYX_ERR(0, 5695, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_workers = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_ncores", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5695, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_ncores", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_151get_ncores(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_workers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_151get_ncores(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_10genexpr121__pyx_v_w = NULL; PyObject *__pyx_10genexpr122__pyx_v_w = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr122__pyx_v_ws = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ncores", 0); __Pyx_INCREF(__pyx_v_workers); /* "distributed/scheduler.py":5696 * * def get_ncores(self, comm=None, workers=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * if workers is not None: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5698 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState * if workers is not None: # <<<<<<<<<<<<<< * workers = map(self.coerce_address, workers) * return { */ __pyx_t_2 = (__pyx_v_workers != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5699 * ws: WorkerState * if workers is not None: * workers = map(self.coerce_address, workers) # <<<<<<<<<<<<<< * return { * w: parent._workers_dv[w].nthreads */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coerce_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_workers); __Pyx_GIVEREF(__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_workers); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_workers, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5700 * if workers is not None: * workers = map(self.coerce_address, workers) * return { # <<<<<<<<<<<<<< * w: parent._workers_dv[w].nthreads * for w in workers */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5700, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5702 * return { * w: parent._workers_dv[w].nthreads * for w in workers # <<<<<<<<<<<<<< * if w in parent._workers_dv * } */ if (likely(PyList_CheckExact(__pyx_v_workers)) || PyTuple_CheckExact(__pyx_v_workers)) { __pyx_t_4 = __pyx_v_workers; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_workers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5702, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5702, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5702, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5702, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5702, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5702, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5702, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_10genexpr121__pyx_v_w, __pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":5703 * w: parent._workers_dv[w].nthreads * for w in workers * if w in parent._workers_dv # <<<<<<<<<<<<<< * } * else: */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5703, __pyx_L6_error) } __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_10genexpr121__pyx_v_w, __pyx_v_parent->_workers_dv, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5703, __pyx_L6_error) __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":5701 * workers = map(self.coerce_address, workers) * return { * w: parent._workers_dv[w].nthreads # <<<<<<<<<<<<<< * for w in workers * if w in parent._workers_dv */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5701, __pyx_L6_error) } __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_10genexpr121__pyx_v_w); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5701, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_nthreads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5701, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr121__pyx_v_w, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 5701, __pyx_L6_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":5703 * w: parent._workers_dv[w].nthreads * for w in workers * if w in parent._workers_dv # <<<<<<<<<<<<<< * } * else: */ } /* "distributed/scheduler.py":5702 * return { * w: parent._workers_dv[w].nthreads * for w in workers # <<<<<<<<<<<<<< * if w in parent._workers_dv * } */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_10genexpr121__pyx_v_w); __pyx_10genexpr121__pyx_v_w = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_10genexpr121__pyx_v_w); __pyx_10genexpr121__pyx_v_w = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5698 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState * if workers is not None: # <<<<<<<<<<<<<< * workers = map(self.coerce_address, workers) * return { */ } /* "distributed/scheduler.py":5706 * } * else: * return {w: ws._nthreads for w, ws in parent._workers_dv.items()} # <<<<<<<<<<<<<< * * async def get_call_stack(self, comm=None, keys=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5706, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5706, __pyx_L13_error) } __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5706, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_9, &__pyx_t_5, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 5706, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 5706, __pyx_L13_error) __Pyx_XDECREF_SET(__pyx_10genexpr122__pyx_v_w, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_10genexpr122__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_7)); __pyx_t_7 = 0; __pyx_t_7 = PyInt_FromSsize_t(__pyx_10genexpr122__pyx_v_ws->_nthreads); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5706, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr122__pyx_v_w, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 5706, __pyx_L13_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_10genexpr122__pyx_v_w); __pyx_10genexpr122__pyx_v_w = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr122__pyx_v_ws); __pyx_10genexpr122__pyx_v_ws = 0; goto __pyx_L16_exit_scope; __pyx_L13_error:; __Pyx_XDECREF(__pyx_10genexpr122__pyx_v_w); __pyx_10genexpr122__pyx_v_w = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr122__pyx_v_ws); __pyx_10genexpr122__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L16_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":5695 * } * * def get_ncores(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_ncores", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_10genexpr121__pyx_v_w); __Pyx_XDECREF(__pyx_10genexpr122__pyx_v_w); __Pyx_XDECREF((PyObject *)__pyx_10genexpr122__pyx_v_ws); __Pyx_XDECREF(__pyx_v_workers); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_155generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5708 * return {w: ws._nthreads for w, ws in parent._workers_dv.items()} * * async def get_call_stack(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_154get_call_stack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_154get_call_stack = {"get_call_stack", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_154get_call_stack, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_154get_call_stack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_call_stack (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_call_stack") < 0)) __PYX_ERR(0, 5708, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_call_stack", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5708, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_call_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_153get_call_stack(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_14get_call_stack_2generator42(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5734 * * results = await asyncio.gather( * *(self.rpc(w).call_stack(keys=v) for w, v in workers.items()) # <<<<<<<<<<<<<< * ) * response = {w: r for w, r in zip(workers, results) if r} */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_14get_call_stack_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_46_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_46_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5734, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_14get_call_stack_2generator42, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_get_call_stack_locals, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_call_stack.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_14get_call_stack_2generator42(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5734, __pyx_L1_error) __pyx_t_2 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers)) { __Pyx_RaiseClosureNameError("workers"); __PYX_ERR(0, 5734, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5734, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_w, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 5734, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_cur_scope->__pyx_v_w) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_call_stack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_keys, __pyx_cur_scope->__pyx_v_v) < 0) __PYX_ERR(0, 5734, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5734, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5708 * return {w: ws._nthreads for w, ws in parent._workers_dv.items()} * * async def get_call_stack(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_153get_call_stack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_call_stack", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5708, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_keys = __pyx_v_keys; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_155generator18, __pyx_codeobj__82, (PyObject *) __pyx_cur_scope, __pyx_n_s_get_call_stack, __pyx_n_s_Scheduler_get_call_stack, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5708, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_call_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_155generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *(*__pyx_t_15)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_call_stack", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L16_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5708, __pyx_L1_error) /* "distributed/scheduler.py":5709 * * async def get_call_stack(self, comm=None, keys=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState * dts: TaskState */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5712 * ts: TaskState * dts: TaskState * if keys is not None: # <<<<<<<<<<<<<< * stack = list(keys) * processing = set() */ __pyx_t_2 = (__pyx_cur_scope->__pyx_v_keys != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5713 * dts: TaskState * if keys is not None: * stack = list(keys) # <<<<<<<<<<<<<< * processing = set() * while stack: */ __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_stack = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5714 * if keys is not None: * stack = list(keys) * processing = set() # <<<<<<<<<<<<<< * while stack: * key = stack.pop() */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_processing = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5715 * stack = list(keys) * processing = set() * while stack: # <<<<<<<<<<<<<< * key = stack.pop() * ts = parent._tasks[key] */ while (1) { __pyx_t_3 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_stack) != 0); if (!__pyx_t_3) break; /* "distributed/scheduler.py":5716 * processing = set() * while stack: * key = stack.pop() # <<<<<<<<<<<<<< * ts = parent._tasks[key] * if ts._state == "waiting": */ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_stack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5717 * while stack: * key = stack.pop() * ts = parent._tasks[key] # <<<<<<<<<<<<<< * if ts._state == "waiting": * stack.extend([dts._key for dts in ts._dependencies]) */ if (unlikely(__pyx_cur_scope->__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5717, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_parent->_tasks, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5717, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5718 * key = stack.pop() * ts = parent._tasks[key] * if ts._state == "waiting": # <<<<<<<<<<<<<< * stack.extend([dts._key for dts in ts._dependencies]) * elif ts._state == "processing": */ __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_ts->_state, __pyx_n_u_waiting, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5718, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":5719 * ts = parent._tasks[key] * if ts._state == "waiting": * stack.extend([dts._key for dts in ts._dependencies]) # <<<<<<<<<<<<<< * elif ts._state == "processing": * processing.add(ts) */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_ts->_dependencies, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 5719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5719, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_10genexpr123__pyx_v_dts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr123__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_8)); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_10genexpr123__pyx_v_dts->_key))) __PYX_ERR(0, 5719, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* exit inner scope */ __pyx_t_10 = __Pyx_PyList_Extend(__pyx_cur_scope->__pyx_v_stack, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 5719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5718 * key = stack.pop() * ts = parent._tasks[key] * if ts._state == "waiting": # <<<<<<<<<<<<<< * stack.extend([dts._key for dts in ts._dependencies]) * elif ts._state == "processing": */ goto __pyx_L7; } /* "distributed/scheduler.py":5720 * if ts._state == "waiting": * stack.extend([dts._key for dts in ts._dependencies]) * elif ts._state == "processing": # <<<<<<<<<<<<<< * processing.add(ts) * */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_ts->_state, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5720, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":5721 * stack.extend([dts._key for dts in ts._dependencies]) * elif ts._state == "processing": * processing.add(ts) # <<<<<<<<<<<<<< * * workers = defaultdict(list) */ __pyx_t_10 = PySet_Add(__pyx_cur_scope->__pyx_v_processing, ((PyObject *)__pyx_cur_scope->__pyx_v_ts)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 5721, __pyx_L1_error) /* "distributed/scheduler.py":5720 * if ts._state == "waiting": * stack.extend([dts._key for dts in ts._dependencies]) * elif ts._state == "processing": # <<<<<<<<<<<<<< * processing.add(ts) * */ } __pyx_L7:; } /* "distributed/scheduler.py":5723 * processing.add(ts) * * workers = defaultdict(list) # <<<<<<<<<<<<<< * for ts in processing: * if ts._processing_on: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_workers = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5724 * * workers = defaultdict(list) * for ts in processing: # <<<<<<<<<<<<<< * if ts._processing_on: * workers[ts._processing_on.address].append(ts._key) */ __pyx_t_6 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_processing, 1, (&__pyx_t_5), (&__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_6, &__pyx_t_4, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 5724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5724, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":5725 * workers = defaultdict(list) * for ts in processing: * if ts._processing_on: # <<<<<<<<<<<<<< * workers[ts._processing_on.address].append(ts._key) * else: */ __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_cur_scope->__pyx_v_ts->_processing_on)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5725, __pyx_L1_error) if (__pyx_t_3) { /* "distributed/scheduler.py":5726 * for ts in processing: * if ts._processing_on: * workers[ts._processing_on.address].append(ts._key) # <<<<<<<<<<<<<< * else: * workers = {w: None for w in parent._workers_dv} */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_ts->_processing_on), __pyx_n_s_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_workers, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_cur_scope->__pyx_v_ts->_key); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 5726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":5725 * workers = defaultdict(list) * for ts in processing: * if ts._processing_on: # <<<<<<<<<<<<<< * workers[ts._processing_on.address].append(ts._key) * else: */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5712 * ts: TaskState * dts: TaskState * if keys is not None: # <<<<<<<<<<<<<< * stack = list(keys) * processing = set() */ goto __pyx_L4; } /* "distributed/scheduler.py":5728 * workers[ts._processing_on.address].append(ts._key) * else: * workers = {w: None for w in parent._workers_dv} # <<<<<<<<<<<<<< * * if not workers: */ /*else*/ { { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5728, __pyx_L1_error) } __pyx_t_4 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, ((PyObject *)NULL), (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_6, &__pyx_t_5, &__pyx_t_4, NULL, NULL, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 5728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr124__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr124__pyx_v_w, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_10genexpr124__pyx_v_w, (PyObject*)Py_None))) __PYX_ERR(0, 5728, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_workers = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L4:; /* "distributed/scheduler.py":5730 * workers = {w: None for w in parent._workers_dv} * * if not workers: # <<<<<<<<<<<<<< * return {} * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_workers); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5730, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":5731 * * if not workers: * return {} # <<<<<<<<<<<<<< * * results = await asyncio.gather( */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5730 * workers = {w: None for w in parent._workers_dv} * * if not workers: # <<<<<<<<<<<<<< * return {} * */ } /* "distributed/scheduler.py":5733 * return {} * * results = await asyncio.gather( # <<<<<<<<<<<<<< * *(self.rpc(w).call_stack(keys=v) for w, v in workers.items()) * ) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_gather); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5734 * * results = await asyncio.gather( * *(self.rpc(w).call_stack(keys=v) for w, v in workers.items()) # <<<<<<<<<<<<<< * ) * response = {w: r for w, r in zip(workers, results) if r} */ __pyx_t_1 = __pyx_pf_11distributed_9scheduler_9Scheduler_14get_call_stack_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5733 * return {} * * results = await asyncio.gather( # <<<<<<<<<<<<<< * *(self.rpc(w).call_stack(keys=v) for w, v in workers.items()) * ) */ __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L16_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5733, __pyx_L1_error) __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_1 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 5733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_results = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5736 * *(self.rpc(w).call_stack(keys=v) for w, v in workers.items()) * ) * response = {w: r for w, r in zip(workers, results) if r} # <<<<<<<<<<<<<< * return response * */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_workers); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_results); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_results); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_results); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_11 = NULL; } else { __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5736, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 5736, __pyx_L1_error) #else __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 5736, __pyx_L1_error) #else __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5736, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_8); } if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 5736, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_12 = PyList_GET_ITEM(sequence, 0); __pyx_t_13 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); #else __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext; index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 5736, __pyx_L1_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; __pyx_L19_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 5736, __pyx_L1_error) __pyx_L20_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr126__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr126__pyx_v_w, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr126__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr126__pyx_v_r, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_10genexpr126__pyx_v_r); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5736, __pyx_L1_error) if (__pyx_t_2) { if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_10genexpr126__pyx_v_w, (PyObject*)__pyx_cur_scope->__pyx_10genexpr126__pyx_v_r))) __PYX_ERR(0, 5736, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_response = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5737 * ) * response = {w: r for w, r in zip(workers, results) if r} * return response # <<<<<<<<<<<<<< * * def get_nbytes(self, comm=None, keys=None, summary=True): */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_response); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":5708 * return {w: ws._nthreads for w, ws in parent._workers_dv.items()} * * async def get_call_stack(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("get_call_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5739 * return response * * def get_nbytes(self, comm=None, keys=None, summary=True): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_157get_nbytes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_157get_nbytes = {"get_nbytes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_157get_nbytes, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_157get_nbytes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_summary = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_nbytes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_summary,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_True)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_summary); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_nbytes") < 0)) __PYX_ERR(0, 5739, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_summary = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_nbytes", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5739, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_nbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_156get_nbytes(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_summary); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5751 * * if summary: * out = defaultdict(lambda: 0) # <<<<<<<<<<<<<< * for k, v in result.items(): * out[key_split(k)] += v */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_10get_nbytes_lambda21(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_10get_nbytes_lambda21 = {"lambda21", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_10get_nbytes_lambda21, METH_NOARGS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_10get_nbytes_lambda21(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda21 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda21(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda21(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda21", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5739 * return response * * def get_nbytes(self, comm=None, keys=None, summary=True): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_156get_nbytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_summary) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_10genexpr127__pyx_v_k = NULL; PyObject *__pyx_10genexpr128__pyx_v_k = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr128__pyx_v_ts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; Py_ssize_t __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); Py_ssize_t __pyx_t_13; int __pyx_t_14; int __pyx_t_15; PyObject *__pyx_t_16 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_nbytes", 0); /* "distributed/scheduler.py":5740 * * def get_nbytes(self, comm=None, keys=None, summary=True): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState * with log_errors(): */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5742 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState * with log_errors(): # <<<<<<<<<<<<<< * if keys is not None: * result = {k: parent._tasks[k].nbytes for k in keys} */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5742, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5742, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "distributed/scheduler.py":5743 * ts: TaskState * with log_errors(): * if keys is not None: # <<<<<<<<<<<<<< * result = {k: parent._tasks[k].nbytes for k in keys} * else: */ __pyx_t_9 = (__pyx_v_keys != Py_None); __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":5744 * with log_errors(): * if keys is not None: * result = {k: parent._tasks[k].nbytes for k in keys} # <<<<<<<<<<<<<< * else: * result = { */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5744, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_2 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5744, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5744, __pyx_L16_error) } for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 5744, __pyx_L16_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5744, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 5744, __pyx_L16_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5744, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5744, __pyx_L16_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_10genexpr127__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5744, __pyx_L16_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_10genexpr127__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5744, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5744, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr127__pyx_v_k, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 5744, __pyx_L16_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_10genexpr127__pyx_v_k); __pyx_10genexpr127__pyx_v_k = 0; goto __pyx_L19_exit_scope; __pyx_L16_error:; __Pyx_XDECREF(__pyx_10genexpr127__pyx_v_k); __pyx_10genexpr127__pyx_v_k = 0; goto __pyx_L7_error; __pyx_L19_exit_scope:; } /* exit inner scope */ __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5743 * ts: TaskState * with log_errors(): * if keys is not None: # <<<<<<<<<<<<<< * result = {k: parent._tasks[k].nbytes for k in keys} * else: */ goto __pyx_L13; } /* "distributed/scheduler.py":5746 * result = {k: parent._tasks[k].nbytes for k in keys} * else: * result = { # <<<<<<<<<<<<<< * k: ts._nbytes for k, ts in parent._tasks.items() if ts._nbytes >= 0 * } */ /*else*/ { { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5746, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5747 * else: * result = { * k: ts._nbytes for k, ts in parent._tasks.items() if ts._nbytes >= 0 # <<<<<<<<<<<<<< * } * */ __pyx_t_11 = 0; if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5747, __pyx_L22_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_parent->_tasks, 1, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5747, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_13, &__pyx_t_11, &__pyx_t_5, &__pyx_t_3, NULL, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5747, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5747, __pyx_L22_error) __Pyx_XDECREF_SET(__pyx_10genexpr128__pyx_v_k, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_10genexpr128__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_10 = ((__pyx_10genexpr128__pyx_v_ts->_nbytes >= 0) != 0); if (__pyx_t_10) { __pyx_t_3 = PyInt_FromSsize_t(__pyx_10genexpr128__pyx_v_ts->_nbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5747, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr128__pyx_v_k, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5747, __pyx_L22_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_10genexpr128__pyx_v_k); __pyx_10genexpr128__pyx_v_k = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr128__pyx_v_ts); __pyx_10genexpr128__pyx_v_ts = 0; goto __pyx_L26_exit_scope; __pyx_L22_error:; __Pyx_XDECREF(__pyx_10genexpr128__pyx_v_k); __pyx_10genexpr128__pyx_v_k = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr128__pyx_v_ts); __pyx_10genexpr128__pyx_v_ts = 0; goto __pyx_L7_error; __pyx_L26_exit_scope:; } /* exit inner scope */ __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L13:; /* "distributed/scheduler.py":5750 * } * * if summary: # <<<<<<<<<<<<<< * out = defaultdict(lambda: 0) * for k, v in result.items(): */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_summary); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5750, __pyx_L7_error) if (__pyx_t_10) { /* "distributed/scheduler.py":5751 * * if summary: * out = defaultdict(lambda: 0) # <<<<<<<<<<<<<< * for k, v in result.items(): * out[key_split(k)] += v */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5751, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_10get_nbytes_lambda21, 0, __pyx_n_s_Scheduler_get_nbytes_locals_lamb, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5751, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5751, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_out = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5752 * if summary: * out = defaultdict(lambda: 0) * for k, v in result.items(): # <<<<<<<<<<<<<< * out[key_split(k)] += v * result = dict(out) */ __pyx_t_13 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_result, 1, __pyx_n_s_items, (&__pyx_t_11), (&__pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5752, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_11, &__pyx_t_13, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5752, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5753 * out = defaultdict(lambda: 0) * for k, v in result.items(): * out[key_split(k)] += v # <<<<<<<<<<<<<< * result = dict(out) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_key_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5753, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_k); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5753, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_out, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5753, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5753, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyObject_SetItem(__pyx_v_out, __pyx_t_3, __pyx_t_5) < 0)) __PYX_ERR(0, 5753, __pyx_L7_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5754 * for k, v in result.items(): * out[key_split(k)] += v * result = dict(out) # <<<<<<<<<<<<<< * * return result */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5754, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":5750 * } * * if summary: # <<<<<<<<<<<<<< * out = defaultdict(lambda: 0) * for k, v in result.items(): */ } /* "distributed/scheduler.py":5756 * result = dict(out) * * return result # <<<<<<<<<<<<<< * * def run_function(self, stream, function, args=(), kwargs={}, wait=True): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L11_try_return; /* "distributed/scheduler.py":5742 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState * with log_errors(): # <<<<<<<<<<<<<< * if keys is not None: * result = {k: parent._tasks[k].nbytes for k in keys} */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_nbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 5742, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5742, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5742, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_16); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 5742, __pyx_L9_except_error) __pyx_t_9 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; __PYX_ERR(0, 5742, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_4) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L33; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L33:; } /* "distributed/scheduler.py":5739 * return response * * def get_nbytes(self, comm=None, keys=None, summary=True): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_nbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_out); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XDECREF(__pyx_10genexpr127__pyx_v_k); __Pyx_XDECREF(__pyx_10genexpr128__pyx_v_k); __Pyx_XDECREF((PyObject *)__pyx_10genexpr128__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5758 * return result * * def run_function(self, stream, function, args=(), kwargs={}, wait=True): # <<<<<<<<<<<<<< * """Run a function within this process * */ static PyObject *__pyx_pf_11distributed_9scheduler_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject*)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)__pyx_empty_tuple)); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_kwargs); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_kwargs); PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_kwargs); __Pyx_INCREF(((PyObject *)Py_True)); __Pyx_GIVEREF(((PyObject *)Py_True)); PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_True)); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_159run_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_158run_function[] = "Run a function within this process\n\n See Also\n --------\n Client.run_on_scheduler\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_159run_function = {"run_function", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_159run_function, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_158run_function}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_159run_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_stream = 0; PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_v_wait = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("run_function (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_wait,0}; PyObject* values[6] = {0,0,0,0,0,0}; __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); values[3] = ((PyObject *)((PyObject*)__pyx_empty_tuple)); values[4] = __pyx_dynamic_args->__pyx_arg_kwargs; values[5] = ((PyObject *)((PyObject *)Py_True)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("run_function", 0, 3, 6, 1); __PYX_ERR(0, 5758, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("run_function", 0, 3, 6, 2); __PYX_ERR(0, 5758, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wait); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_function") < 0)) __PYX_ERR(0, 5758, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_stream = values[1]; __pyx_v_function = values[2]; __pyx_v_args = values[3]; __pyx_v_kwargs = values[4]; __pyx_v_wait = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("run_function", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5758, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.run_function", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_158run_function(__pyx_self, __pyx_v_self, __pyx_v_stream, __pyx_v_function, __pyx_v_args, __pyx_v_kwargs, __pyx_v_wait); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_158run_function(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_wait) { PyObject *__pyx_v_run = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("run_function", 0); /* "distributed/scheduler.py":5765 * Client.run_on_scheduler * """ * from .worker import run # <<<<<<<<<<<<<< * * self.log_event("all", {"action": "run-function", "function": function}) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_run); __Pyx_GIVEREF(__pyx_n_s_run); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_run); __pyx_t_2 = __Pyx_Import(__pyx_n_s_worker, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_run); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_run = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5767 * from .worker import run * * self.log_event("all", {"action": "run-function", "function": function}) # <<<<<<<<<<<<<< * return run(self, stream, function=function, args=args, kwargs=kwargs, wait=wait) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_log_event_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_action, __pyx_kp_u_run_function_2) < 0) __PYX_ERR(0, 5767, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_function, __pyx_v_function) < 0) __PYX_ERR(0, 5767, __pyx_L1_error) __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_all, __pyx_t_3}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5767, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_all, __pyx_t_3}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5767, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_n_u_all); __Pyx_GIVEREF(__pyx_n_u_all); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_u_all); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5768 * * self.log_event("all", {"action": "run-function", "function": function}) * return run(self, stream, function=function, args=args, kwargs=kwargs, wait=wait) # <<<<<<<<<<<<<< * * def set_metadata(self, comm=None, keys=None, value=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); __Pyx_INCREF(__pyx_v_stream); __Pyx_GIVEREF(__pyx_v_stream); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_stream); __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_function, __pyx_v_function) < 0) __PYX_ERR(0, 5768, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_args, __pyx_v_args) < 0) __PYX_ERR(0, 5768, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_kwargs, __pyx_v_kwargs) < 0) __PYX_ERR(0, 5768, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_wait, __pyx_v_wait) < 0) __PYX_ERR(0, 5768, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_run, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5758 * return result * * def run_function(self, stream, function, args=(), kwargs={}, wait=True): # <<<<<<<<<<<<<< * """Run a function within this process * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.run_function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_run); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5770 * return run(self, stream, function=function, args=args, kwargs=kwargs, wait=wait) * * def set_metadata(self, comm=None, keys=None, value=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * try: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_161set_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_161set_metadata = {"set_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_161set_metadata, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_161set_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_metadata (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_value,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_metadata") < 0)) __PYX_ERR(0, 5770, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_value = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_metadata", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5770, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.set_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_160set_metadata(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_160set_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_value) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_metadata = NULL; PyObject *__pyx_v_key = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_t_17; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_metadata", 0); /* "distributed/scheduler.py":5771 * * def set_metadata(self, comm=None, keys=None, value=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * try: * metadata = parent._task_metadata */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5772 * def set_metadata(self, comm=None, keys=None, value=None): * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * metadata = parent._task_metadata * for key in keys[:-1]: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":5773 * parent: SchedulerState = cast(SchedulerState, self) * try: * metadata = parent._task_metadata # <<<<<<<<<<<<<< * for key in keys[:-1]: * if key not in metadata or not isinstance(metadata[key], (dict, list)): */ __pyx_t_1 = __pyx_v_parent->_task_metadata; __Pyx_INCREF(__pyx_t_1); __pyx_v_metadata = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5774 * try: * metadata = parent._task_metadata * for key in keys[:-1]: # <<<<<<<<<<<<<< * if key not in metadata or not isinstance(metadata[key], (dict, list)): * metadata[key] = dict() */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_keys, 0, -1L, NULL, NULL, &__pyx_slice__83, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5774, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5774, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5774, __pyx_L3_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 5774, __pyx_L3_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5774, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 5774, __pyx_L3_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5774, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5774, __pyx_L3_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5775 * metadata = parent._task_metadata * for key in keys[:-1]: * if key not in metadata or not isinstance(metadata[key], (dict, list)): # <<<<<<<<<<<<<< * metadata[key] = dict() * metadata = metadata[key] */ __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_metadata, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5775, __pyx_L3_error) __pyx_t_10 = (__pyx_t_9 != 0); if (!__pyx_t_10) { } else { __pyx_t_8 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_metadata, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5775, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyDict_Check(__pyx_t_1); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L14_bool_binop_done; } __pyx_t_11 = PyList_Check(__pyx_t_1); __pyx_t_9 = (__pyx_t_11 != 0); __pyx_t_10 = __pyx_t_9; __pyx_L14_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = ((!(__pyx_t_10 != 0)) != 0); __pyx_t_8 = __pyx_t_9; __pyx_L12_bool_binop_done:; if (__pyx_t_8) { /* "distributed/scheduler.py":5776 * for key in keys[:-1]: * if key not in metadata or not isinstance(metadata[key], (dict, list)): * metadata[key] = dict() # <<<<<<<<<<<<<< * metadata = metadata[key] * metadata[keys[-1]] = value */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5776, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_v_metadata, __pyx_v_key, __pyx_t_1) < 0)) __PYX_ERR(0, 5776, __pyx_L3_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5775 * metadata = parent._task_metadata * for key in keys[:-1]: * if key not in metadata or not isinstance(metadata[key], (dict, list)): # <<<<<<<<<<<<<< * metadata[key] = dict() * metadata = metadata[key] */ } /* "distributed/scheduler.py":5777 * if key not in metadata or not isinstance(metadata[key], (dict, list)): * metadata[key] = dict() * metadata = metadata[key] # <<<<<<<<<<<<<< * metadata[keys[-1]] = value * except Exception as e: */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_metadata, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5777, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_metadata, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5774 * try: * metadata = parent._task_metadata * for key in keys[:-1]: # <<<<<<<<<<<<<< * if key not in metadata or not isinstance(metadata[key], (dict, list)): * metadata[key] = dict() */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5778 * metadata[key] = dict() * metadata = metadata[key] * metadata[keys[-1]] = value # <<<<<<<<<<<<<< * except Exception as e: * import pdb */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_keys, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5778, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyObject_SetItem(__pyx_v_metadata, __pyx_t_5, __pyx_v_value) < 0)) __PYX_ERR(0, 5778, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5772 * def set_metadata(self, comm=None, keys=None, value=None): * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * metadata = parent._task_metadata * for key in keys[:-1]: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5779 * metadata = metadata[key] * metadata[keys[-1]] = value * except Exception as e: # <<<<<<<<<<<<<< * import pdb * */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_12) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.set_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 5779, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_v_e = __pyx_t_1; /*try:*/ { /* "distributed/scheduler.py":5780 * metadata[keys[-1]] = value * except Exception as e: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_14 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5780, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_14); __pyx_v_pdb = __pyx_t_14; __pyx_t_14 = 0; /* "distributed/scheduler.py":5782 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * * def get_metadata(self, comm=None, keys=None, default=no_default): */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5782, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } __pyx_t_14 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5782, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } /* "distributed/scheduler.py":5779 * metadata = metadata[key] * metadata[keys[-1]] = value * except Exception as e: # <<<<<<<<<<<<<< * import pdb * */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; goto __pyx_L22; } __pyx_L21_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_12 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18; goto __pyx_L5_except_error; } __pyx_L22:; } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":5772 * def set_metadata(self, comm=None, keys=None, value=None): * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * metadata = parent._task_metadata * for key in keys[:-1]: */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); __pyx_L8_try_end:; } /* "distributed/scheduler.py":5770 * return run(self, stream, function=function, args=args, kwargs=kwargs, wait=wait) * * def set_metadata(self, comm=None, keys=None, value=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * try: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("distributed.scheduler.Scheduler.set_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_metadata); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5784 * pdb.set_trace() * * def get_metadata(self, comm=None, keys=None, default=no_default): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * metadata = parent._task_metadata */ static PyObject *__pyx_pf_11distributed_9scheduler_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_None)); __Pyx_GIVEREF(((PyObject *)Py_None)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None)); __Pyx_INCREF(((PyObject *)Py_None)); __Pyx_GIVEREF(((PyObject *)Py_None)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_None)); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_default); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_default); PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_default); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_163get_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_163get_metadata = {"get_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_163get_metadata, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_163get_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_default = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_metadata (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,&__pyx_n_s_default,0}; PyObject* values[4] = {0,0,0,0}; __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = __pyx_dynamic_args->__pyx_arg_default; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_metadata") < 0)) __PYX_ERR(0, 5784, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; __pyx_v_default = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_metadata", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5784, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_162get_metadata(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_162get_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys, PyObject *__pyx_v_default) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_metadata = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_metadata", 0); /* "distributed/scheduler.py":5785 * * def get_metadata(self, comm=None, keys=None, default=no_default): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * metadata = parent._task_metadata * for key in keys[:-1]: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5786 * def get_metadata(self, comm=None, keys=None, default=no_default): * parent: SchedulerState = cast(SchedulerState, self) * metadata = parent._task_metadata # <<<<<<<<<<<<<< * for key in keys[:-1]: * metadata = metadata[key] */ __pyx_t_1 = __pyx_v_parent->_task_metadata; __Pyx_INCREF(__pyx_t_1); __pyx_v_metadata = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5787 * parent: SchedulerState = cast(SchedulerState, self) * metadata = parent._task_metadata * for key in keys[:-1]: # <<<<<<<<<<<<<< * metadata = metadata[key] * try: */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_keys, 0, -1L, NULL, NULL, &__pyx_slice__83, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5787, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5787, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5787, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5787, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5788 * metadata = parent._task_metadata * for key in keys[:-1]: * metadata = metadata[key] # <<<<<<<<<<<<<< * try: * return metadata[keys[-1]] */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_metadata, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_metadata, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5787 * parent: SchedulerState = cast(SchedulerState, self) * metadata = parent._task_metadata * for key in keys[:-1]: # <<<<<<<<<<<<<< * metadata = metadata[key] * try: */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5789 * for key in keys[:-1]: * metadata = metadata[key] * try: # <<<<<<<<<<<<<< * return metadata[keys[-1]] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "distributed/scheduler.py":5790 * metadata = metadata[key] * try: * return metadata[keys[-1]] # <<<<<<<<<<<<<< * except KeyError: * if default != no_default: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_keys, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5790, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_metadata, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5790, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L9_try_return; /* "distributed/scheduler.py":5789 * for key in keys[:-1]: * metadata = metadata[key] * try: # <<<<<<<<<<<<<< * return metadata[keys[-1]] * except KeyError: */ } __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5791 * try: * return metadata[keys[-1]] * except KeyError: # <<<<<<<<<<<<<< * if default != no_default: * return default */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_9) < 0) __PYX_ERR(0, 5791, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_9); /* "distributed/scheduler.py":5792 * return metadata[keys[-1]] * except KeyError: * if default != no_default: # <<<<<<<<<<<<<< * return default * else: */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_no_default); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5792, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyObject_RichCompare(__pyx_v_default, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5792, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5792, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (likely(__pyx_t_12)) { /* "distributed/scheduler.py":5793 * except KeyError: * if default != no_default: * return default # <<<<<<<<<<<<<< * else: * raise */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_except_return; /* "distributed/scheduler.py":5792 * return metadata[keys[-1]] * except KeyError: * if default != no_default: # <<<<<<<<<<<<<< * return default * else: */ } /* "distributed/scheduler.py":5795 * return default * else: * raise # <<<<<<<<<<<<<< * * def get_task_status(self, comm=None, keys=None): */ /*else*/ { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_9); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_9 = 0; __PYX_ERR(0, 5795, __pyx_L7_except_error) } } goto __pyx_L7_except_error; __pyx_L7_except_error:; /* "distributed/scheduler.py":5789 * for key in keys[:-1]: * metadata = metadata[key] * try: # <<<<<<<<<<<<<< * return metadata[keys[-1]] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L9_try_return:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L0; __pyx_L8_except_return:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L0; } /* "distributed/scheduler.py":5784 * pdb.set_trace() * * def get_metadata(self, comm=None, keys=None, default=no_default): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * metadata = parent._task_metadata */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_metadata); __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5797 * raise * * def get_task_status(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * return { */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_165get_task_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_165get_task_status = {"get_task_status", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_165get_task_status, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_165get_task_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_keys = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_task_status (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_keys,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_task_status") < 0)) __PYX_ERR(0, 5797, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_keys = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_task_status", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5797, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_task_status", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_164get_task_status(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_keys); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_164get_task_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_keys) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_10genexpr129__pyx_v_key = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_task_status", 0); /* "distributed/scheduler.py":5798 * * def get_task_status(self, comm=None, keys=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * return { * key: (parent._tasks[key].state if key in parent._tasks else None) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5799 * def get_task_status(self, comm=None, keys=None): * parent: SchedulerState = cast(SchedulerState, self) * return { # <<<<<<<<<<<<<< * key: (parent._tasks[key].state if key in parent._tasks else None) * for key in keys */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5799, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5801 * return { * key: (parent._tasks[key].state if key in parent._tasks else None) * for key in keys # <<<<<<<<<<<<<< * } * */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_2 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5801, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5801, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5801, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5801, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5801, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5801, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5801, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_10genexpr129__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5800 * parent: SchedulerState = cast(SchedulerState, self) * return { * key: (parent._tasks[key].state if key in parent._tasks else None) # <<<<<<<<<<<<<< * for key in keys * } */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5800, __pyx_L5_error) } __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_10genexpr129__pyx_v_key, __pyx_v_parent->_tasks, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5800, __pyx_L5_error) if ((__pyx_t_6 != 0)) { if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5800, __pyx_L5_error) } __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_10genexpr129__pyx_v_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5800, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5800, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __pyx_t_8; __pyx_t_8 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_5 = Py_None; } if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr129__pyx_v_key, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 5800, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":5801 * return { * key: (parent._tasks[key].state if key in parent._tasks else None) * for key in keys # <<<<<<<<<<<<<< * } * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_10genexpr129__pyx_v_key); __pyx_10genexpr129__pyx_v_key = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_10genexpr129__pyx_v_key); __pyx_10genexpr129__pyx_v_key = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5797 * raise * * def get_task_status(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * return { */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_task_status", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_10genexpr129__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5804 * } * * def get_task_stream(self, comm=None, start=None, stop=None, count=None): # <<<<<<<<<<<<<< * from distributed.diagnostics.task_stream import TaskStreamPlugin * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_167get_task_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_167get_task_stream = {"get_task_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_167get_task_stream, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_167get_task_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_stop = 0; PyObject *__pyx_v_count = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_task_stream (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_count,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_task_stream") < 0)) __PYX_ERR(0, 5804, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_start = values[2]; __pyx_v_stop = values[3]; __pyx_v_count = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_task_stream", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5804, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_task_stream", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_166get_task_stream(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_start, __pyx_v_stop, __pyx_v_count); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_166get_task_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_count) { PyObject *__pyx_v_TaskStreamPlugin = NULL; PyObject *__pyx_v_tsp = NULL; PyObject *__pyx_10genexpr130__pyx_v_p = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_task_stream", 0); /* "distributed/scheduler.py":5805 * * def get_task_stream(self, comm=None, start=None, stop=None, count=None): * from distributed.diagnostics.task_stream import TaskStreamPlugin # <<<<<<<<<<<<<< * * self.add_plugin(TaskStreamPlugin, idempotent=True) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_TaskStreamPlugin); __Pyx_GIVEREF(__pyx_n_s_TaskStreamPlugin); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_TaskStreamPlugin); __pyx_t_2 = __Pyx_Import(__pyx_n_s_distributed_diagnostics_task_str, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_TaskStreamPlugin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_TaskStreamPlugin = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5807 * from distributed.diagnostics.task_stream import TaskStreamPlugin * * self.add_plugin(TaskStreamPlugin, idempotent=True) # <<<<<<<<<<<<<< * tsp = [p for p in self.plugins if isinstance(p, TaskStreamPlugin)][0] * return tsp.collect(start=start, stop=stop, count=count) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_plugin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_TaskStreamPlugin); __Pyx_GIVEREF(__pyx_v_TaskStreamPlugin); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_TaskStreamPlugin); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_idempotent, Py_True) < 0) __PYX_ERR(0, 5807, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":5808 * * self.add_plugin(TaskStreamPlugin, idempotent=True) * tsp = [p for p in self.plugins if isinstance(p, TaskStreamPlugin)][0] # <<<<<<<<<<<<<< * return tsp.collect(start=start, stop=stop, count=count) * */ { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5808, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5808, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5808, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5808, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5808, __pyx_L5_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5808, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5808, __pyx_L5_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5808, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5808, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_10genexpr130__pyx_v_p, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = PyObject_IsInstance(__pyx_10genexpr130__pyx_v_p, __pyx_v_TaskStreamPlugin); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 5808, __pyx_L5_error) __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_10genexpr130__pyx_v_p))) __PYX_ERR(0, 5808, __pyx_L5_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_10genexpr130__pyx_v_p); __pyx_10genexpr130__pyx_v_p = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_10genexpr130__pyx_v_p); __pyx_10genexpr130__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_tsp = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5809 * self.add_plugin(TaskStreamPlugin, idempotent=True) * tsp = [p for p in self.plugins if isinstance(p, TaskStreamPlugin)][0] * return tsp.collect(start=start, stop=stop, count=count) # <<<<<<<<<<<<<< * * def start_task_metadata(self, comm=None, name=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tsp, __pyx_n_s_collect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_start, __pyx_v_start) < 0) __PYX_ERR(0, 5809, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_stop, __pyx_v_stop) < 0) __PYX_ERR(0, 5809, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 5809, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5804 * } * * def get_task_stream(self, comm=None, start=None, stop=None, count=None): # <<<<<<<<<<<<<< * from distributed.diagnostics.task_stream import TaskStreamPlugin * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_task_stream", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_TaskStreamPlugin); __Pyx_XDECREF(__pyx_v_tsp); __Pyx_XDECREF(__pyx_10genexpr130__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5811 * return tsp.collect(start=start, stop=stop, count=count) * * def start_task_metadata(self, comm=None, name=None): # <<<<<<<<<<<<<< * plugin = CollectTaskMetaDataPlugin(scheduler=self, name=name) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_169start_task_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_169start_task_metadata = {"start_task_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_169start_task_metadata, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_169start_task_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start_task_metadata (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_name,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start_task_metadata") < 0)) __PYX_ERR(0, 5811, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_name = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("start_task_metadata", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5811, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.start_task_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_168start_task_metadata(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_168start_task_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_name) { PyObject *__pyx_v_plugin = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start_task_metadata", 0); /* "distributed/scheduler.py":5812 * * def start_task_metadata(self, comm=None, name=None): * plugin = CollectTaskMetaDataPlugin(scheduler=self, name=name) # <<<<<<<<<<<<<< * * self.add_plugin(plugin) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CollectTaskMetaDataPlugin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_scheduler, __pyx_v_self) < 0) __PYX_ERR(0, 5812, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 5812, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_plugin = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":5814 * plugin = CollectTaskMetaDataPlugin(scheduler=self, name=name) * * self.add_plugin(plugin) # <<<<<<<<<<<<<< * * def stop_task_metadata(self, comm=None, name=None): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_plugin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_plugin) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_plugin); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":5811 * return tsp.collect(start=start, stop=stop, count=count) * * def start_task_metadata(self, comm=None, name=None): # <<<<<<<<<<<<<< * plugin = CollectTaskMetaDataPlugin(scheduler=self, name=name) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.Scheduler.start_task_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_plugin); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5816 * self.add_plugin(plugin) * * def stop_task_metadata(self, comm=None, name=None): # <<<<<<<<<<<<<< * plugins = [ * p */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_171stop_task_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_171stop_task_metadata = {"stop_task_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_171stop_task_metadata, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_171stop_task_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop_task_metadata (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_name,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stop_task_metadata") < 0)) __PYX_ERR(0, 5816, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_name = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stop_task_metadata", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5816, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.stop_task_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_170stop_task_metadata(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_170stop_task_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_name) { PyObject *__pyx_v_plugins = NULL; PyObject *__pyx_v_plugin = NULL; PyObject *__pyx_10genexpr131__pyx_v_p = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; Py_UCS4 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stop_task_metadata", 0); /* "distributed/scheduler.py":5817 * * def stop_task_metadata(self, comm=None, name=None): * plugins = [ # <<<<<<<<<<<<<< * p * for p in self.plugins */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5817, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":5819 * plugins = [ * p * for p in self.plugins # <<<<<<<<<<<<<< * if isinstance(p, CollectTaskMetaDataPlugin) and p.name == name * ] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5819, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5819, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5819, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5819, __pyx_L5_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5819, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5819, __pyx_L5_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5819, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 5819, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_10genexpr131__pyx_v_p, __pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5820 * p * for p in self.plugins * if isinstance(p, CollectTaskMetaDataPlugin) and p.name == name # <<<<<<<<<<<<<< * ] * if len(plugins) != 1: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CollectTaskMetaDataPlugin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5820, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyObject_IsInstance(__pyx_10genexpr131__pyx_v_p, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 5820, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { } else { __pyx_t_6 = __pyx_t_8; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_10genexpr131__pyx_v_p, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5820, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_v_name, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5820, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 5820, __pyx_L5_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = __pyx_t_8; __pyx_L9_bool_binop_done:; if (__pyx_t_6) { /* "distributed/scheduler.py":5818 * def stop_task_metadata(self, comm=None, name=None): * plugins = [ * p # <<<<<<<<<<<<<< * for p in self.plugins * if isinstance(p, CollectTaskMetaDataPlugin) and p.name == name */ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_10genexpr131__pyx_v_p))) __PYX_ERR(0, 5817, __pyx_L5_error) /* "distributed/scheduler.py":5820 * p * for p in self.plugins * if isinstance(p, CollectTaskMetaDataPlugin) and p.name == name # <<<<<<<<<<<<<< * ] * if len(plugins) != 1: */ } /* "distributed/scheduler.py":5819 * plugins = [ * p * for p in self.plugins # <<<<<<<<<<<<<< * if isinstance(p, CollectTaskMetaDataPlugin) and p.name == name * ] */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_10genexpr131__pyx_v_p); __pyx_10genexpr131__pyx_v_p = 0; goto __pyx_L11_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_10genexpr131__pyx_v_p); __pyx_10genexpr131__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ __pyx_v_plugins = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5822 * if isinstance(p, CollectTaskMetaDataPlugin) and p.name == name * ] * if len(plugins) != 1: # <<<<<<<<<<<<<< * raise ValueError( * "Expected to find exactly one CollectTaskMetaDataPlugin " */ __pyx_t_4 = PyList_GET_SIZE(__pyx_v_plugins); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5822, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_4 != 1) != 0); if (unlikely(__pyx_t_6)) { /* "distributed/scheduler.py":5824 * if len(plugins) != 1: * raise ValueError( * "Expected to find exactly one CollectTaskMetaDataPlugin " # <<<<<<<<<<<<<< * f"with name {name} but found {len(plugins)}." * ) */ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_10 = 127; __Pyx_INCREF(__pyx_kp_u_Expected_to_find_exactly_one_Col); __pyx_t_4 += 65; __Pyx_GIVEREF(__pyx_kp_u_Expected_to_find_exactly_one_Col); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Expected_to_find_exactly_one_Col); /* "distributed/scheduler.py":5825 * raise ValueError( * "Expected to find exactly one CollectTaskMetaDataPlugin " * f"with name {name} but found {len(plugins)}." # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_10; __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u_but_found); __pyx_t_4 += 11; __Pyx_GIVEREF(__pyx_kp_u_but_found); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_but_found); __pyx_t_11 = PyList_GET_SIZE(__pyx_v_plugins); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5825, __pyx_L1_error) __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_11, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u__84); __pyx_t_4 += 1; __Pyx_GIVEREF(__pyx_kp_u__84); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__84); /* "distributed/scheduler.py":5824 * if len(plugins) != 1: * raise ValueError( * "Expected to find exactly one CollectTaskMetaDataPlugin " # <<<<<<<<<<<<<< * f"with name {name} but found {len(plugins)}." * ) */ __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5823 * ] * if len(plugins) != 1: * raise ValueError( # <<<<<<<<<<<<<< * "Expected to find exactly one CollectTaskMetaDataPlugin " * f"with name {name} but found {len(plugins)}." */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 5823, __pyx_L1_error) /* "distributed/scheduler.py":5822 * if isinstance(p, CollectTaskMetaDataPlugin) and p.name == name * ] * if len(plugins) != 1: # <<<<<<<<<<<<<< * raise ValueError( * "Expected to find exactly one CollectTaskMetaDataPlugin " */ } /* "distributed/scheduler.py":5828 * ) * * plugin = plugins[0] # <<<<<<<<<<<<<< * self.remove_plugin(plugin) * return {"metadata": plugin.metadata, "state": plugin.state} */ __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_plugins, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_plugin = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5829 * * plugin = plugins[0] * self.remove_plugin(plugin) # <<<<<<<<<<<<<< * return {"metadata": plugin.metadata, "state": plugin.state} * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_plugin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_v_plugin) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_plugin); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5830 * plugin = plugins[0] * self.remove_plugin(plugin) * return {"metadata": plugin.metadata, "state": plugin.state} # <<<<<<<<<<<<<< * * async def register_worker_plugin(self, comm, plugin, name=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_plugin, __pyx_n_s_metadata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_metadata, __pyx_t_3) < 0) __PYX_ERR(0, 5830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_plugin, __pyx_n_s_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_state, __pyx_t_3) < 0) __PYX_ERR(0, 5830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":5816 * self.add_plugin(plugin) * * def stop_task_metadata(self, comm=None, name=None): # <<<<<<<<<<<<<< * plugins = [ * p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("distributed.scheduler.Scheduler.stop_task_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_plugins); __Pyx_XDECREF(__pyx_v_plugin); __Pyx_XDECREF(__pyx_10genexpr131__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_174generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":5832 * return {"metadata": plugin.metadata, "state": plugin.state} * * async def register_worker_plugin(self, comm, plugin, name=None): # <<<<<<<<<<<<<< * """ Registers a setup function, and call it on every worker """ * self.worker_plugins.append({"plugin": plugin, "name": name}) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_173register_worker_plugin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_172register_worker_plugin[] = " Registers a setup function, and call it on every worker "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_173register_worker_plugin = {"register_worker_plugin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_173register_worker_plugin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_172register_worker_plugin}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_173register_worker_plugin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_plugin = 0; PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("register_worker_plugin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_plugin,&__pyx_n_s_name,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("register_worker_plugin", 0, 3, 4, 1); __PYX_ERR(0, 5832, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_plugin)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("register_worker_plugin", 0, 3, 4, 2); __PYX_ERR(0, 5832, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_worker_plugin") < 0)) __PYX_ERR(0, 5832, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_plugin = values[2]; __pyx_v_name = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("register_worker_plugin", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5832, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.register_worker_plugin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_172register_worker_plugin(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_plugin, __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_172register_worker_plugin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_plugin, PyObject *__pyx_v_name) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register_worker_plugin", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 5832, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_plugin = __pyx_v_plugin; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_plugin); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_plugin); __pyx_cur_scope->__pyx_v_name = __pyx_v_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_174generator19, __pyx_codeobj__85, (PyObject *) __pyx_cur_scope, __pyx_n_s_register_worker_plugin, __pyx_n_s_Scheduler_register_worker_plugin, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 5832, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.register_worker_plugin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_174generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("register_worker_plugin", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L4_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5832, __pyx_L1_error) /* "distributed/scheduler.py":5834 * async def register_worker_plugin(self, comm, plugin, name=None): * """ Registers a setup function, and call it on every worker """ * self.worker_plugins.append({"plugin": plugin, "name": name}) # <<<<<<<<<<<<<< * * responses = await self.broadcast( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_worker_plugins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_plugin, __pyx_cur_scope->__pyx_v_plugin) < 0) __PYX_ERR(0, 5834, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_name, __pyx_cur_scope->__pyx_v_name) < 0) __PYX_ERR(0, 5834, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 5834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5836 * self.worker_plugins.append({"plugin": plugin, "name": name}) * * responses = await self.broadcast( # <<<<<<<<<<<<<< * msg=dict(op="plugin-add", plugin=plugin, name=name) * ) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":5837 * * responses = await self.broadcast( * msg=dict(op="plugin-add", plugin=plugin, name=name) # <<<<<<<<<<<<<< * ) * return responses */ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_op, __pyx_kp_u_plugin_add) < 0) __PYX_ERR(0, 5837, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_plugin, __pyx_cur_scope->__pyx_v_plugin) < 0) __PYX_ERR(0, 5837, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_cur_scope->__pyx_v_name) < 0) __PYX_ERR(0, 5837, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_msg, __pyx_t_4) < 0) __PYX_ERR(0, 5837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":5836 * self.worker_plugins.append({"plugin": plugin, "name": name}) * * responses = await self.broadcast( # <<<<<<<<<<<<<< * msg=dict(op="plugin-add", plugin=plugin, name=name) * ) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 5836, __pyx_L1_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_4 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(0, 5836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_responses = __pyx_t_4; __pyx_t_4 = 0; /* "distributed/scheduler.py":5839 * msg=dict(op="plugin-add", plugin=plugin, name=name) * ) * return responses # <<<<<<<<<<<<<< * * ##################### */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_responses); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":5832 * return {"metadata": plugin.metadata, "state": plugin.state} * * async def register_worker_plugin(self, comm, plugin, name=None): # <<<<<<<<<<<<<< * """ Registers a setup function, and call it on every worker """ * self.worker_plugins.append({"plugin": plugin, "name": name}) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("register_worker_plugin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5845 * ##################### * * def _transition(self, key, finish: str, *args, **kwargs): # <<<<<<<<<<<<<< * """Transition a key from its current state to the finish state * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_176_transition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_175_transition[] = "Transition a key from its current state to the finish state\n\n Examples\n --------\n >>> self._transition('x', 'waiting')\n {'x': 'processing'}\n\n Returns\n -------\n Dictionary of recommendations for future transitions\n\n See Also\n --------\n Scheduler.transitions : transitive version of this function\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_176_transition = {"_transition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_176_transition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_175_transition}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_176_transition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_finish = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_transition (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); if (PyTuple_GET_SIZE(__pyx_args) > 3) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 3, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_finish,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_transition", 0, 3, 3, 1); __PYX_ERR(0, 5845, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_finish)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_transition", 0, 3, 3, 2); __PYX_ERR(0, 5845, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 3) ? pos_args : 3; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "_transition") < 0)) __PYX_ERR(0, 5845, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_finish = ((PyObject*)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_transition", 0, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5845, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler._transition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_finish), (&PyUnicode_Type), 1, "finish", 1))) __PYX_ERR(0, 5845, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_175_transition(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_finish, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_175_transition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_finish, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_start_finish = 0; PyObject *__pyx_v_finish2 = 0; PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_msgs = 0; PyObject *__pyx_v_new_msgs = 0; PyObject *__pyx_v_dependents = 0; PyObject *__pyx_v_dependencies = 0; PyObject *__pyx_v_func = NULL; PyObject *__pyx_v_a = 0; PyObject *__pyx_v_a_recs = 0; PyObject *__pyx_v_a_wmsgs = 0; PyObject *__pyx_v_a_cmsgs = 0; PyObject *__pyx_v_v = NULL; PyObject *__pyx_v_b_recs = 0; PyObject *__pyx_v_b_wmsgs = 0; PyObject *__pyx_v_b_cmsgs = 0; PyObject *__pyx_v_b = 0; PyObject *__pyx_v_w = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_plugin = NULL; struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v_tg = 0; int __pyx_v_all_forgotten; PyObject *__pyx_v_s = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pdb = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; Py_ssize_t __pyx_t_13; int __pyx_t_14; int __pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; char const *__pyx_t_22; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_transition", 0); /* "distributed/scheduler.py":5861 * Scheduler.transitions : transitive version of this function * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState * start: str */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5873 * dependents: set * dependencies: set * try: # <<<<<<<<<<<<<< * recommendations = {} * worker_msgs = {} */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":5874 * dependencies: set * try: * recommendations = {} # <<<<<<<<<<<<<< * worker_msgs = {} * client_msgs = {} */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5874, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_recommendations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5875 * try: * recommendations = {} * worker_msgs = {} # <<<<<<<<<<<<<< * client_msgs = {} * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5875, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5876 * recommendations = {} * worker_msgs = {} * client_msgs = {} # <<<<<<<<<<<<<< * * ts = parent._tasks.get(key) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5876, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_client_msgs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5878 * client_msgs = {} * * ts = parent._tasks.get(key) # <<<<<<<<<<<<<< * if ts is None: * return recommendations, worker_msgs, client_msgs */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 5878, __pyx_L3_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_parent->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5878, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 5878, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5879 * * ts = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * return recommendations, worker_msgs, client_msgs * start = ts._state */ __pyx_t_5 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":5880 * ts = parent._tasks.get(key) * if ts is None: * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * start = ts._state * if start == finish: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5880, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":5879 * * ts = parent._tasks.get(key) * if ts is None: # <<<<<<<<<<<<<< * return recommendations, worker_msgs, client_msgs * start = ts._state */ } /* "distributed/scheduler.py":5881 * if ts is None: * return recommendations, worker_msgs, client_msgs * start = ts._state # <<<<<<<<<<<<<< * if start == finish: * return recommendations, worker_msgs, client_msgs */ __pyx_t_1 = __pyx_v_ts->_state; __Pyx_INCREF(__pyx_t_1); __pyx_v_start = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5882 * return recommendations, worker_msgs, client_msgs * start = ts._state * if start == finish: # <<<<<<<<<<<<<< * return recommendations, worker_msgs, client_msgs * */ __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_start, __pyx_v_finish, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5882, __pyx_L3_error) __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":5883 * start = ts._state * if start == finish: * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * * if self.plugins: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5883, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":5882 * return recommendations, worker_msgs, client_msgs * start = ts._state * if start == finish: # <<<<<<<<<<<<<< * return recommendations, worker_msgs, client_msgs * */ } /* "distributed/scheduler.py":5885 * return recommendations, worker_msgs, client_msgs * * if self.plugins: # <<<<<<<<<<<<<< * dependents = set(ts._dependents) * dependencies = set(ts._dependencies) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5885, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5885, __pyx_L3_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "distributed/scheduler.py":5886 * * if self.plugins: * dependents = set(ts._dependents) # <<<<<<<<<<<<<< * dependencies = set(ts._dependencies) * */ __pyx_t_1 = PySet_New(__pyx_v_ts->_dependents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5886, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dependents = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5887 * if self.plugins: * dependents = set(ts._dependents) * dependencies = set(ts._dependencies) # <<<<<<<<<<<<<< * * start_finish = (start, finish) */ __pyx_t_1 = PySet_New(__pyx_v_ts->_dependencies); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5887, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dependencies = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5885 * return recommendations, worker_msgs, client_msgs * * if self.plugins: # <<<<<<<<<<<<<< * dependents = set(ts._dependents) * dependencies = set(ts._dependencies) */ } /* "distributed/scheduler.py":5889 * dependencies = set(ts._dependencies) * * start_finish = (start, finish) # <<<<<<<<<<<<<< * func = self._transitions.get(start_finish) * if func is not None: */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5889, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start); __Pyx_INCREF(__pyx_v_finish); __Pyx_GIVEREF(__pyx_v_finish); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_finish); __pyx_v_start_finish = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5890 * * start_finish = (start, finish) * func = self._transitions.get(start_finish) # <<<<<<<<<<<<<< * if func is not None: * a: tuple = func(key, *args, **kwargs) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5890, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5890, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_start_finish) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_start_finish); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5890, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":5891 * start_finish = (start, finish) * func = self._transitions.get(start_finish) * if func is not None: # <<<<<<<<<<<<<< * a: tuple = func(key, *args, **kwargs) * recommendations, worker_msgs, client_msgs = a */ __pyx_t_5 = (__pyx_v_func != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":5892 * func = self._transitions.get(start_finish) * if func is not None: * a: tuple = func(key, *args, **kwargs) # <<<<<<<<<<<<<< * recommendations, worker_msgs, client_msgs = a * elif "released" not in start_finish: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5892, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); __pyx_t_8 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5892, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_8, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5892, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5892, __pyx_L3_error) __pyx_v_a = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5893 * if func is not None: * a: tuple = func(key, *args, **kwargs) * recommendations, worker_msgs, client_msgs = a # <<<<<<<<<<<<<< * elif "released" not in start_finish: * func = self._transitions["released", finish] */ if (likely(__pyx_v_a != Py_None)) { PyObject* sequence = __pyx_v_a; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 5893, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5893, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5893, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5893, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 5893, __pyx_L3_error) } if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5893, __pyx_L3_error) if (!(likely(PyDict_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 5893, __pyx_L3_error) if (!(likely(PyDict_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 5893, __pyx_L3_error) __Pyx_DECREF_SET(__pyx_v_recommendations, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_worker_msgs, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_client_msgs, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; /* "distributed/scheduler.py":5891 * start_finish = (start, finish) * func = self._transitions.get(start_finish) * if func is not None: # <<<<<<<<<<<<<< * a: tuple = func(key, *args, **kwargs) * recommendations, worker_msgs, client_msgs = a */ goto __pyx_L12; } /* "distributed/scheduler.py":5894 * a: tuple = func(key, *args, **kwargs) * recommendations, worker_msgs, client_msgs = a * elif "released" not in start_finish: # <<<<<<<<<<<<<< * func = self._transitions["released", finish] * assert not args and not kwargs */ __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_released, __pyx_v_start_finish, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5894, __pyx_L3_error) __pyx_t_5 = (__pyx_t_6 != 0); if (likely(__pyx_t_5)) { /* "distributed/scheduler.py":5895 * recommendations, worker_msgs, client_msgs = a * elif "released" not in start_finish: * func = self._transitions["released", finish] # <<<<<<<<<<<<<< * assert not args and not kwargs * a_recs: dict */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5895, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5895, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_u_released); __Pyx_GIVEREF(__pyx_n_u_released); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_u_released); __Pyx_INCREF(__pyx_v_finish); __Pyx_GIVEREF(__pyx_v_finish); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_finish); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5895, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5896 * elif "released" not in start_finish: * func = self._transitions["released", finish] * assert not args and not kwargs # <<<<<<<<<<<<<< * a_recs: dict * a_wmsgs: dict */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); __pyx_t_9 = ((!__pyx_t_6) != 0); if (__pyx_t_9) { } else { __pyx_t_5 = __pyx_t_9; goto __pyx_L13_bool_binop_done; } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5896, __pyx_L3_error) __pyx_t_6 = ((!__pyx_t_9) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L13_bool_binop_done:; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 5896, __pyx_L3_error) } } #endif /* "distributed/scheduler.py":5900 * a_wmsgs: dict * a_cmsgs: dict * a: tuple = self._transition(key, "released") # <<<<<<<<<<<<<< * a_recs, a_wmsgs, a_cmsgs = a * v = a_recs.get(key) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5900, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_key, __pyx_n_u_released}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5900, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_key, __pyx_n_u_released}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5900, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5900, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_key); __Pyx_INCREF(__pyx_n_u_released); __Pyx_GIVEREF(__pyx_n_u_released); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_n_u_released); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5900, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5900, __pyx_L3_error) __pyx_v_a = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5901 * a_cmsgs: dict * a: tuple = self._transition(key, "released") * a_recs, a_wmsgs, a_cmsgs = a # <<<<<<<<<<<<<< * v = a_recs.get(key) * if v is not None: */ if (likely(__pyx_v_a != Py_None)) { PyObject* sequence = __pyx_v_a; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 5901, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5901, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5901, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5901, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 5901, __pyx_L3_error) } if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5901, __pyx_L3_error) if (!(likely(PyDict_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 5901, __pyx_L3_error) if (!(likely(PyDict_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_11)->tp_name), 0))) __PYX_ERR(0, 5901, __pyx_L3_error) __pyx_v_a_recs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; __pyx_v_a_wmsgs = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_a_cmsgs = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5902 * a: tuple = self._transition(key, "released") * a_recs, a_wmsgs, a_cmsgs = a * v = a_recs.get(key) # <<<<<<<<<<<<<< * if v is not None: * func = self._transitions["released", v] */ if (unlikely(__pyx_v_a_recs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 5902, __pyx_L3_error) } __pyx_t_11 = __Pyx_PyDict_GetItemDefault(__pyx_v_a_recs, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5902, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_v_v = __pyx_t_11; __pyx_t_11 = 0; /* "distributed/scheduler.py":5903 * a_recs, a_wmsgs, a_cmsgs = a * v = a_recs.get(key) * if v is not None: # <<<<<<<<<<<<<< * func = self._transitions["released", v] * b_recs: dict */ __pyx_t_5 = (__pyx_v_v != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":5904 * v = a_recs.get(key) * if v is not None: * func = self._transitions["released", v] # <<<<<<<<<<<<<< * b_recs: dict * b_wmsgs: dict */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5904, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5904, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_u_released); __Pyx_GIVEREF(__pyx_n_u_released); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_u_released); __Pyx_INCREF(__pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_v); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5904, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5903 * a_recs, a_wmsgs, a_cmsgs = a * v = a_recs.get(key) * if v is not None: # <<<<<<<<<<<<<< * func = self._transitions["released", v] * b_recs: dict */ } /* "distributed/scheduler.py":5908 * b_wmsgs: dict * b_cmsgs: dict * b: tuple = func(key) # <<<<<<<<<<<<<< * b_recs, b_wmsgs, b_cmsgs = b * */ __Pyx_INCREF(__pyx_v_func); __pyx_t_8 = __pyx_v_func; __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_key); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5908, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5908, __pyx_L3_error) __pyx_v_b = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5909 * b_cmsgs: dict * b: tuple = func(key) * b_recs, b_wmsgs, b_cmsgs = b # <<<<<<<<<<<<<< * * recommendations.update(a_recs) */ if (likely(__pyx_v_b != Py_None)) { PyObject* sequence = __pyx_v_b; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 5909, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5909, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5909, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5909, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 5909, __pyx_L3_error) } if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5909, __pyx_L3_error) if (!(likely(PyDict_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 5909, __pyx_L3_error) if (!(likely(PyDict_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_11)->tp_name), 0))) __PYX_ERR(0, 5909, __pyx_L3_error) __pyx_v_b_recs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; __pyx_v_b_wmsgs = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_b_cmsgs = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5911 * b_recs, b_wmsgs, b_cmsgs = b * * recommendations.update(a_recs) # <<<<<<<<<<<<<< * for w, new_msgs in a_wmsgs.items(): * msgs = worker_msgs.get(w) */ __pyx_t_11 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_recommendations, __pyx_v_a_recs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5911, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5912 * * recommendations.update(a_recs) * for w, new_msgs in a_wmsgs.items(): # <<<<<<<<<<<<<< * msgs = worker_msgs.get(w) * if msgs is not None: */ __pyx_t_12 = 0; if (unlikely(__pyx_v_a_wmsgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5912, __pyx_L3_error) } __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_a_wmsgs, 1, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_10)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5912, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_11, __pyx_t_13, &__pyx_t_12, &__pyx_t_8, &__pyx_t_1, NULL, __pyx_t_10); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5912, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5912, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_new_msgs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":5913 * recommendations.update(a_recs) * for w, new_msgs in a_wmsgs.items(): * msgs = worker_msgs.get(w) # <<<<<<<<<<<<<< * if msgs is not None: * msgs.extend(new_msgs) */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_worker_msgs, __pyx_v_w, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5913, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5913, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_msgs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":5914 * for w, new_msgs in a_wmsgs.items(): * msgs = worker_msgs.get(w) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ __pyx_t_6 = (__pyx_v_msgs != ((PyObject*)Py_None)); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":5915 * msgs = worker_msgs.get(w) * if msgs is not None: * msgs.extend(new_msgs) # <<<<<<<<<<<<<< * else: * worker_msgs[w] = new_msgs */ if (unlikely(__pyx_v_msgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); __PYX_ERR(0, 5915, __pyx_L3_error) } __pyx_t_15 = __Pyx_PyList_Extend(__pyx_v_msgs, __pyx_v_new_msgs); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 5915, __pyx_L3_error) /* "distributed/scheduler.py":5914 * for w, new_msgs in a_wmsgs.items(): * msgs = worker_msgs.get(w) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ goto __pyx_L18; } /* "distributed/scheduler.py":5917 * msgs.extend(new_msgs) * else: * worker_msgs[w] = new_msgs # <<<<<<<<<<<<<< * for c, new_msgs in a_cmsgs.items(): * msgs = client_msgs.get(c) */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_v_worker_msgs, __pyx_v_w, __pyx_v_new_msgs) < 0)) __PYX_ERR(0, 5917, __pyx_L3_error) } __pyx_L18:; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5918 * else: * worker_msgs[w] = new_msgs * for c, new_msgs in a_cmsgs.items(): # <<<<<<<<<<<<<< * msgs = client_msgs.get(c) * if msgs is not None: */ __pyx_t_13 = 0; if (unlikely(__pyx_v_a_cmsgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5918, __pyx_L3_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_a_cmsgs, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5918, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_11, __pyx_t_12, &__pyx_t_13, &__pyx_t_1, &__pyx_t_8, NULL, __pyx_t_10); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5918, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 5918, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_new_msgs, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "distributed/scheduler.py":5919 * worker_msgs[w] = new_msgs * for c, new_msgs in a_cmsgs.items(): * msgs = client_msgs.get(c) # <<<<<<<<<<<<<< * if msgs is not None: * msgs.extend(new_msgs) */ __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_client_msgs, __pyx_v_c, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5919, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 5919, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_msgs, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "distributed/scheduler.py":5920 * for c, new_msgs in a_cmsgs.items(): * msgs = client_msgs.get(c) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ __pyx_t_5 = (__pyx_v_msgs != ((PyObject*)Py_None)); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":5921 * msgs = client_msgs.get(c) * if msgs is not None: * msgs.extend(new_msgs) # <<<<<<<<<<<<<< * else: * client_msgs[c] = new_msgs */ if (unlikely(__pyx_v_msgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); __PYX_ERR(0, 5921, __pyx_L3_error) } __pyx_t_15 = __Pyx_PyList_Extend(__pyx_v_msgs, __pyx_v_new_msgs); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 5921, __pyx_L3_error) /* "distributed/scheduler.py":5920 * for c, new_msgs in a_cmsgs.items(): * msgs = client_msgs.get(c) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ goto __pyx_L21; } /* "distributed/scheduler.py":5923 * msgs.extend(new_msgs) * else: * client_msgs[c] = new_msgs # <<<<<<<<<<<<<< * * recommendations.update(b_recs) */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_c, __pyx_v_new_msgs) < 0)) __PYX_ERR(0, 5923, __pyx_L3_error) } __pyx_L21:; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5925 * client_msgs[c] = new_msgs * * recommendations.update(b_recs) # <<<<<<<<<<<<<< * for w, new_msgs in b_wmsgs.items(): * msgs = worker_msgs.get(w) */ __pyx_t_11 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_recommendations, __pyx_v_b_recs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5925, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5926 * * recommendations.update(b_recs) * for w, new_msgs in b_wmsgs.items(): # <<<<<<<<<<<<<< * msgs = worker_msgs.get(w) * if msgs is not None: */ __pyx_t_12 = 0; if (unlikely(__pyx_v_b_wmsgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5926, __pyx_L3_error) } __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_b_wmsgs, 1, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_10)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5926, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_11, __pyx_t_13, &__pyx_t_12, &__pyx_t_8, &__pyx_t_1, NULL, __pyx_t_10); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5926, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5926, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_new_msgs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":5927 * recommendations.update(b_recs) * for w, new_msgs in b_wmsgs.items(): * msgs = worker_msgs.get(w) # <<<<<<<<<<<<<< * if msgs is not None: * msgs.extend(new_msgs) */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_worker_msgs, __pyx_v_w, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5927, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 5927, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_msgs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":5928 * for w, new_msgs in b_wmsgs.items(): * msgs = worker_msgs.get(w) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ __pyx_t_6 = (__pyx_v_msgs != ((PyObject*)Py_None)); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":5929 * msgs = worker_msgs.get(w) * if msgs is not None: * msgs.extend(new_msgs) # <<<<<<<<<<<<<< * else: * worker_msgs[w] = new_msgs */ if (unlikely(__pyx_v_msgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); __PYX_ERR(0, 5929, __pyx_L3_error) } __pyx_t_15 = __Pyx_PyList_Extend(__pyx_v_msgs, __pyx_v_new_msgs); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 5929, __pyx_L3_error) /* "distributed/scheduler.py":5928 * for w, new_msgs in b_wmsgs.items(): * msgs = worker_msgs.get(w) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ goto __pyx_L24; } /* "distributed/scheduler.py":5931 * msgs.extend(new_msgs) * else: * worker_msgs[w] = new_msgs # <<<<<<<<<<<<<< * for c, new_msgs in b_cmsgs.items(): * msgs = client_msgs.get(c) */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_v_worker_msgs, __pyx_v_w, __pyx_v_new_msgs) < 0)) __PYX_ERR(0, 5931, __pyx_L3_error) } __pyx_L24:; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5932 * else: * worker_msgs[w] = new_msgs * for c, new_msgs in b_cmsgs.items(): # <<<<<<<<<<<<<< * msgs = client_msgs.get(c) * if msgs is not None: */ __pyx_t_13 = 0; if (unlikely(__pyx_v_b_cmsgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 5932, __pyx_L3_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_b_cmsgs, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5932, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_11, __pyx_t_12, &__pyx_t_13, &__pyx_t_1, &__pyx_t_8, NULL, __pyx_t_10); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5932, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 5932, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_new_msgs, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "distributed/scheduler.py":5933 * worker_msgs[w] = new_msgs * for c, new_msgs in b_cmsgs.items(): * msgs = client_msgs.get(c) # <<<<<<<<<<<<<< * if msgs is not None: * msgs.extend(new_msgs) */ __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_client_msgs, __pyx_v_c, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5933, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 5933, __pyx_L3_error) __Pyx_XDECREF_SET(__pyx_v_msgs, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "distributed/scheduler.py":5934 * for c, new_msgs in b_cmsgs.items(): * msgs = client_msgs.get(c) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ __pyx_t_5 = (__pyx_v_msgs != ((PyObject*)Py_None)); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":5935 * msgs = client_msgs.get(c) * if msgs is not None: * msgs.extend(new_msgs) # <<<<<<<<<<<<<< * else: * client_msgs[c] = new_msgs */ if (unlikely(__pyx_v_msgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); __PYX_ERR(0, 5935, __pyx_L3_error) } __pyx_t_15 = __Pyx_PyList_Extend(__pyx_v_msgs, __pyx_v_new_msgs); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 5935, __pyx_L3_error) /* "distributed/scheduler.py":5934 * for c, new_msgs in b_cmsgs.items(): * msgs = client_msgs.get(c) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ goto __pyx_L27; } /* "distributed/scheduler.py":5937 * msgs.extend(new_msgs) * else: * client_msgs[c] = new_msgs # <<<<<<<<<<<<<< * * start = "released" */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_c, __pyx_v_new_msgs) < 0)) __PYX_ERR(0, 5937, __pyx_L3_error) } __pyx_L27:; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5939 * client_msgs[c] = new_msgs * * start = "released" # <<<<<<<<<<<<<< * else: * raise RuntimeError("Impossible transition from %r to %r" % start_finish) */ __Pyx_INCREF(__pyx_n_u_released); __Pyx_DECREF_SET(__pyx_v_start, __pyx_n_u_released); /* "distributed/scheduler.py":5894 * a: tuple = func(key, *args, **kwargs) * recommendations, worker_msgs, client_msgs = a * elif "released" not in start_finish: # <<<<<<<<<<<<<< * func = self._transitions["released", finish] * assert not args and not kwargs */ goto __pyx_L12; } /* "distributed/scheduler.py":5941 * start = "released" * else: * raise RuntimeError("Impossible transition from %r to %r" % start_finish) # <<<<<<<<<<<<<< * * finish2 = ts._state */ /*else*/ { __pyx_t_11 = PyUnicode_Format(__pyx_kp_u_Impossible_transition_from_r_to, __pyx_v_start_finish); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5941, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5941, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 5941, __pyx_L3_error) } __pyx_L12:; /* "distributed/scheduler.py":5943 * raise RuntimeError("Impossible transition from %r to %r" % start_finish) * * finish2 = ts._state # <<<<<<<<<<<<<< * self.transition_log.append((key, start, finish2, recommendations, time())) * if parent._validate: */ __pyx_t_8 = __pyx_v_ts->_state; __Pyx_INCREF(__pyx_t_8); __pyx_v_finish2 = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":5944 * * finish2 = ts._state * self.transition_log.append((key, start, finish2, recommendations, time())) # <<<<<<<<<<<<<< * if parent._validate: * logger.debug( */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_log); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5944, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5944, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5944, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5944, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start); __Pyx_INCREF(__pyx_v_finish2); __Pyx_GIVEREF(__pyx_v_finish2); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_finish2); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_recommendations); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 5944, __pyx_L3_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5945 * finish2 = ts._state * self.transition_log.append((key, start, finish2, recommendations, time())) * if parent._validate: # <<<<<<<<<<<<<< * logger.debug( * "Transitioned %r %s->%s (actual: %s). Consequence: %s", */ __pyx_t_6 = (__pyx_v_parent->_validate != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":5946 * self.transition_log.append((key, start, finish2, recommendations, time())) * if parent._validate: * logger.debug( # <<<<<<<<<<<<<< * "Transitioned %r %s->%s (actual: %s). Consequence: %s", * key, */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5946, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_debug); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5946, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":5952 * finish2, * ts._state, * dict(recommendations), # <<<<<<<<<<<<<< * ) * if self.plugins: */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); __PYX_ERR(0, 5952, __pyx_L3_error) } __pyx_t_8 = PyDict_Copy(__pyx_v_recommendations); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5952, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[7] = {__pyx_t_7, __pyx_kp_u_Transitioned_r_s_s_actual_s_Cons, __pyx_v_key, __pyx_v_start, __pyx_v_finish2, __pyx_v_ts->_state, __pyx_t_8}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_10, 6+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5946, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[7] = {__pyx_t_7, __pyx_kp_u_Transitioned_r_s_s_actual_s_Cons, __pyx_v_key, __pyx_v_start, __pyx_v_finish2, __pyx_v_ts->_state, __pyx_t_8}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_10, 6+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5946, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_16 = PyTuple_New(6+__pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5946, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_kp_u_Transitioned_r_s_s_actual_s_Cons); __Pyx_GIVEREF(__pyx_kp_u_Transitioned_r_s_s_actual_s_Cons); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_10, __pyx_kp_u_Transitioned_r_s_s_actual_s_Cons); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_10, __pyx_v_key); __Pyx_INCREF(__pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_10, __pyx_v_start); __Pyx_INCREF(__pyx_v_finish2); __Pyx_GIVEREF(__pyx_v_finish2); PyTuple_SET_ITEM(__pyx_t_16, 3+__pyx_t_10, __pyx_v_finish2); __Pyx_INCREF(__pyx_v_ts->_state); __Pyx_GIVEREF(__pyx_v_ts->_state); PyTuple_SET_ITEM(__pyx_t_16, 4+__pyx_t_10, __pyx_v_ts->_state); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_16, 5+__pyx_t_10, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5946, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5945 * finish2 = ts._state * self.transition_log.append((key, start, finish2, recommendations, time())) * if parent._validate: # <<<<<<<<<<<<<< * logger.debug( * "Transitioned %r %s->%s (actual: %s). Consequence: %s", */ } /* "distributed/scheduler.py":5954 * dict(recommendations), * ) * if self.plugins: # <<<<<<<<<<<<<< * # Temporarily put back forgotten key for plugin to retrieve it * if ts._state == "forgotten": */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5954, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5954, __pyx_L3_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "distributed/scheduler.py":5956 * if self.plugins: * # Temporarily put back forgotten key for plugin to retrieve it * if ts._state == "forgotten": # <<<<<<<<<<<<<< * ts._dependents = dependents * ts._dependencies = dependencies */ __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_forgotten, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5956, __pyx_L3_error) __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":5957 * # Temporarily put back forgotten key for plugin to retrieve it * if ts._state == "forgotten": * ts._dependents = dependents # <<<<<<<<<<<<<< * ts._dependencies = dependencies * parent._tasks[ts._key] = ts */ if (unlikely(!__pyx_v_dependents)) { __Pyx_RaiseUnboundLocalError("dependents"); __PYX_ERR(0, 5957, __pyx_L3_error) } __Pyx_INCREF(__pyx_v_dependents); __Pyx_GIVEREF(__pyx_v_dependents); __Pyx_GOTREF(__pyx_v_ts->_dependents); __Pyx_DECREF(__pyx_v_ts->_dependents); __pyx_v_ts->_dependents = __pyx_v_dependents; /* "distributed/scheduler.py":5958 * if ts._state == "forgotten": * ts._dependents = dependents * ts._dependencies = dependencies # <<<<<<<<<<<<<< * parent._tasks[ts._key] = ts * for plugin in list(self.plugins): */ if (unlikely(!__pyx_v_dependencies)) { __Pyx_RaiseUnboundLocalError("dependencies"); __PYX_ERR(0, 5958, __pyx_L3_error) } __Pyx_INCREF(__pyx_v_dependencies); __Pyx_GIVEREF(__pyx_v_dependencies); __Pyx_GOTREF(__pyx_v_ts->_dependencies); __Pyx_DECREF(__pyx_v_ts->_dependencies); __pyx_v_ts->_dependencies = __pyx_v_dependencies; /* "distributed/scheduler.py":5959 * ts._dependents = dependents * ts._dependencies = dependencies * parent._tasks[ts._key] = ts # <<<<<<<<<<<<<< * for plugin in list(self.plugins): * try: */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5959, __pyx_L3_error) } if (unlikely(PyDict_SetItem(__pyx_v_parent->_tasks, __pyx_v_ts->_key, ((PyObject *)__pyx_v_ts)) < 0)) __PYX_ERR(0, 5959, __pyx_L3_error) /* "distributed/scheduler.py":5956 * if self.plugins: * # Temporarily put back forgotten key for plugin to retrieve it * if ts._state == "forgotten": # <<<<<<<<<<<<<< * ts._dependents = dependents * ts._dependencies = dependencies */ } /* "distributed/scheduler.py":5960 * ts._dependencies = dependencies * parent._tasks[ts._key] = ts * for plugin in list(self.plugins): # <<<<<<<<<<<<<< * try: * plugin.transition(key, start, finish2, *args, **kwargs) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_plugins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5960, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5960, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_11; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_11); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 5960, __pyx_L3_error) #else __pyx_t_11 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5960, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_XDECREF_SET(__pyx_v_plugin, __pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5961 * parent._tasks[ts._key] = ts * for plugin in list(self.plugins): * try: # <<<<<<<<<<<<<< * plugin.transition(key, start, finish2, *args, **kwargs) * except Exception: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); /*try:*/ { /* "distributed/scheduler.py":5962 * for plugin in list(self.plugins): * try: * plugin.transition(key, start, finish2, *args, **kwargs) # <<<<<<<<<<<<<< * except Exception: * logger.info("Plugin failed with exception", exc_info=True) */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_plugin, __pyx_n_s_transition); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5962, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5962, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_start); __Pyx_INCREF(__pyx_v_finish2); __Pyx_GIVEREF(__pyx_v_finish2); PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_v_finish2); __pyx_t_8 = PyNumber_Add(__pyx_t_16, __pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5962, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, __pyx_v_kwargs); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5962, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5961 * parent._tasks[ts._key] = ts * for plugin in list(self.plugins): * try: # <<<<<<<<<<<<<< * plugin.transition(key, start, finish2, *args, **kwargs) * except Exception: */ } __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L40_try_end; __pyx_L33_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":5963 * try: * plugin.transition(key, start, finish2, *args, **kwargs) * except Exception: # <<<<<<<<<<<<<< * logger.info("Plugin failed with exception", exc_info=True) * if ts._state == "forgotten": */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.Scheduler._transition", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_8, &__pyx_t_11) < 0) __PYX_ERR(0, 5963, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_11); /* "distributed/scheduler.py":5964 * plugin.transition(key, start, finish2, *args, **kwargs) * except Exception: * logger.info("Plugin failed with exception", exc_info=True) # <<<<<<<<<<<<<< * if ts._state == "forgotten": * del parent._tasks[ts._key] */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5964, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_info); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5964, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5964, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 5964, __pyx_L35_except_error) __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_tuple__86, __pyx_t_7); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5964, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L34_exception_handled; } goto __pyx_L35_except_error; __pyx_L35_except_error:; /* "distributed/scheduler.py":5961 * parent._tasks[ts._key] = ts * for plugin in list(self.plugins): * try: # <<<<<<<<<<<<<< * plugin.transition(key, start, finish2, *args, **kwargs) * except Exception: */ __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); goto __pyx_L3_error; __pyx_L34_exception_handled:; __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_L40_try_end:; } /* "distributed/scheduler.py":5960 * ts._dependencies = dependencies * parent._tasks[ts._key] = ts * for plugin in list(self.plugins): # <<<<<<<<<<<<<< * try: * plugin.transition(key, start, finish2, *args, **kwargs) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5965 * except Exception: * logger.info("Plugin failed with exception", exc_info=True) * if ts._state == "forgotten": # <<<<<<<<<<<<<< * del parent._tasks[ts._key] * */ __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_forgotten, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5965, __pyx_L3_error) __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":5966 * logger.info("Plugin failed with exception", exc_info=True) * if ts._state == "forgotten": * del parent._tasks[ts._key] # <<<<<<<<<<<<<< * * tg: TaskGroup = ts._group */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5966, __pyx_L3_error) } if (unlikely(PyDict_DelItem(__pyx_v_parent->_tasks, __pyx_v_ts->_key) < 0)) __PYX_ERR(0, 5966, __pyx_L3_error) /* "distributed/scheduler.py":5965 * except Exception: * logger.info("Plugin failed with exception", exc_info=True) * if ts._state == "forgotten": # <<<<<<<<<<<<<< * del parent._tasks[ts._key] * */ } /* "distributed/scheduler.py":5954 * dict(recommendations), * ) * if self.plugins: # <<<<<<<<<<<<<< * # Temporarily put back forgotten key for plugin to retrieve it * if ts._state == "forgotten": */ } /* "distributed/scheduler.py":5968 * del parent._tasks[ts._key] * * tg: TaskGroup = ts._group # <<<<<<<<<<<<<< * if ts._state == "forgotten" and tg._name in parent._task_groups: * # Remove TaskGroup if all tasks are in the forgotten state */ __pyx_t_1 = ((PyObject *)__pyx_v_ts->_group); __Pyx_INCREF(__pyx_t_1); __pyx_v_tg = ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5969 * * tg: TaskGroup = ts._group * if ts._state == "forgotten" and tg._name in parent._task_groups: # <<<<<<<<<<<<<< * # Remove TaskGroup if all tasks are in the forgotten state * all_forgotten: bint = True */ __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_forgotten, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5969, __pyx_L3_error) __pyx_t_9 = (__pyx_t_5 != 0); if (__pyx_t_9) { } else { __pyx_t_6 = __pyx_t_9; goto __pyx_L45_bool_binop_done; } if (unlikely(__pyx_v_parent->_task_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 5969, __pyx_L3_error) } __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_v_tg->_name, __pyx_v_parent->_task_groups, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5969, __pyx_L3_error) __pyx_t_5 = (__pyx_t_9 != 0); __pyx_t_6 = __pyx_t_5; __pyx_L45_bool_binop_done:; if (__pyx_t_6) { /* "distributed/scheduler.py":5971 * if ts._state == "forgotten" and tg._name in parent._task_groups: * # Remove TaskGroup if all tasks are in the forgotten state * all_forgotten: bint = True # <<<<<<<<<<<<<< * for s in ALL_TASK_STATES: * if tg._states.get(s): */ __pyx_v_all_forgotten = 1; /* "distributed/scheduler.py":5972 * # Remove TaskGroup if all tasks are in the forgotten state * all_forgotten: bint = True * for s in ALL_TASK_STATES: # <<<<<<<<<<<<<< * if tg._states.get(s): * all_forgotten = False */ __pyx_t_12 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_v_11distributed_9scheduler_ALL_TASK_STATES, 1, (&__pyx_t_13), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5972, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_14 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_13, &__pyx_t_12, &__pyx_t_11, __pyx_t_10); if (unlikely(__pyx_t_14 == 0)) break; if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5972, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":5973 * all_forgotten: bint = True * for s in ALL_TASK_STATES: * if tg._states.get(s): # <<<<<<<<<<<<<< * all_forgotten = False * break */ if (unlikely(__pyx_v_tg->_states == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 5973, __pyx_L3_error) } __pyx_t_11 = __Pyx_PyDict_GetItemDefault(__pyx_v_tg->_states, __pyx_v_s, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5973, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5973, __pyx_L3_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { /* "distributed/scheduler.py":5974 * for s in ALL_TASK_STATES: * if tg._states.get(s): * all_forgotten = False # <<<<<<<<<<<<<< * break * if all_forgotten: */ __pyx_v_all_forgotten = 0; /* "distributed/scheduler.py":5975 * if tg._states.get(s): * all_forgotten = False * break # <<<<<<<<<<<<<< * if all_forgotten: * ts._prefix._groups.remove(tg) */ goto __pyx_L48_break; /* "distributed/scheduler.py":5973 * all_forgotten: bint = True * for s in ALL_TASK_STATES: * if tg._states.get(s): # <<<<<<<<<<<<<< * all_forgotten = False * break */ } } __pyx_L48_break:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5976 * all_forgotten = False * break * if all_forgotten: # <<<<<<<<<<<<<< * ts._prefix._groups.remove(tg) * del parent._task_groups[tg._name] */ __pyx_t_6 = (__pyx_v_all_forgotten != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":5977 * break * if all_forgotten: * ts._prefix._groups.remove(tg) # <<<<<<<<<<<<<< * del parent._task_groups[tg._name] * */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts->_prefix->_groups, __pyx_n_s_remove); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5977, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_8, ((PyObject *)__pyx_v_tg)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_v_tg)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5977, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5978 * if all_forgotten: * ts._prefix._groups.remove(tg) * del parent._task_groups[tg._name] # <<<<<<<<<<<<<< * * return recommendations, worker_msgs, client_msgs */ if (unlikely(__pyx_v_parent->_task_groups == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 5978, __pyx_L3_error) } if (unlikely(PyDict_DelItem(__pyx_v_parent->_task_groups, __pyx_v_tg->_name) < 0)) __PYX_ERR(0, 5978, __pyx_L3_error) /* "distributed/scheduler.py":5976 * all_forgotten = False * break * if all_forgotten: # <<<<<<<<<<<<<< * ts._prefix._groups.remove(tg) * del parent._task_groups[tg._name] */ } /* "distributed/scheduler.py":5969 * * tg: TaskGroup = ts._group * if ts._state == "forgotten" and tg._name in parent._task_groups: # <<<<<<<<<<<<<< * # Remove TaskGroup if all tasks are in the forgotten state * all_forgotten: bint = True */ } /* "distributed/scheduler.py":5980 * del parent._task_groups[tg._name] * * return recommendations, worker_msgs, client_msgs # <<<<<<<<<<<<<< * except Exception as e: * logger.exception("Error transitioning %r from %r to %r", key, start, finish) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5980, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_recommendations); __Pyx_GIVEREF(__pyx_v_recommendations); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_recommendations); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_worker_msgs); __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_client_msgs); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L7_try_return; /* "distributed/scheduler.py":5873 * dependents: set * dependencies: set * try: # <<<<<<<<<<<<<< * recommendations = {} * worker_msgs = {} */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":5981 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception("Error transitioning %r from %r to %r", key, start, finish) * if LOG_PDB: */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("distributed.scheduler.Scheduler._transition", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_8) < 0) __PYX_ERR(0, 5981, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_v_e = __pyx_t_11; /*try:*/ { /* "distributed/scheduler.py":5982 * return recommendations, worker_msgs, client_msgs * except Exception as e: * logger.exception("Error transitioning %r from %r to %r", key, start, finish) # <<<<<<<<<<<<<< * if LOG_PDB: * import pdb */ __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_logger); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5982, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_exception); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5982, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_v_start)) { __Pyx_RaiseUnboundLocalError("start"); __PYX_ERR(0, 5982, __pyx_L56_error) } __pyx_t_21 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[5] = {__pyx_t_21, __pyx_kp_u_Error_transitioning_r_from_r_to, __pyx_v_key, __pyx_v_start, __pyx_v_finish}; __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5982, __pyx_L56_error) __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GOTREF(__pyx_t_16); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[5] = {__pyx_t_21, __pyx_kp_u_Error_transitioning_r_from_r_to, __pyx_v_key, __pyx_v_start, __pyx_v_finish}; __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5982, __pyx_L56_error) __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GOTREF(__pyx_t_16); } else #endif { __pyx_t_20 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5982, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_20); if (__pyx_t_21) { __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_21); __pyx_t_21 = NULL; } __Pyx_INCREF(__pyx_kp_u_Error_transitioning_r_from_r_to); __Pyx_GIVEREF(__pyx_kp_u_Error_transitioning_r_from_r_to); PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_10, __pyx_kp_u_Error_transitioning_r_from_r_to); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_10, __pyx_v_key); __Pyx_INCREF(__pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_10, __pyx_v_start); __Pyx_INCREF(__pyx_v_finish); __Pyx_GIVEREF(__pyx_v_finish); PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_10, __pyx_v_finish); __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5982, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5983 * except Exception as e: * logger.exception("Error transitioning %r from %r to %r", key, start, finish) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_LOG_PDB); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5983, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5983, __pyx_L56_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (__pyx_t_6) { /* "distributed/scheduler.py":5984 * logger.exception("Error transitioning %r from %r to %r", key, start, finish) * if LOG_PDB: * import pdb # <<<<<<<<<<<<<< * * pdb.set_trace() */ __pyx_t_16 = __Pyx_Import(__pyx_n_s_pdb, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5984, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_16); __pyx_v_pdb = __pyx_t_16; __pyx_t_16 = 0; /* "distributed/scheduler.py":5986 * import pdb * * pdb.set_trace() # <<<<<<<<<<<<<< * raise * */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdb, __pyx_n_s_set_trace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5986, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_16 = (__pyx_t_20) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_20) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 5986, __pyx_L56_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":5983 * except Exception as e: * logger.exception("Error transitioning %r from %r to %r", key, start, finish) * if LOG_PDB: # <<<<<<<<<<<<<< * import pdb * */ } /* "distributed/scheduler.py":5987 * * pdb.set_trace() * raise # <<<<<<<<<<<<<< * * def transition(self, key, finish: str, *args, **kwargs): */ __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_11, __pyx_t_8); __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_t_8 = 0; __PYX_ERR(0, 5987, __pyx_L56_error) } /* "distributed/scheduler.py":5981 * * return recommendations, worker_msgs, client_msgs * except Exception as e: # <<<<<<<<<<<<<< * logger.exception("Error transitioning %r from %r to %r", key, start, finish) * if LOG_PDB: */ /*finally:*/ { __pyx_L56_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __pyx_t_10 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_22 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_18, __pyx_t_17); __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_22; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":5873 * dependents: set * dependencies: set * try: # <<<<<<<<<<<<<< * recommendations = {} * worker_msgs = {} */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; } /* "distributed/scheduler.py":5845 * ##################### * * def _transition(self, key, finish: str, *args, **kwargs): # <<<<<<<<<<<<<< * """Transition a key from its current state to the finish state * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_20); __Pyx_XDECREF(__pyx_t_21); __Pyx_AddTraceback("distributed.scheduler.Scheduler._transition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_start_finish); __Pyx_XDECREF(__pyx_v_finish2); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_msgs); __Pyx_XDECREF(__pyx_v_new_msgs); __Pyx_XDECREF(__pyx_v_dependents); __Pyx_XDECREF(__pyx_v_dependencies); __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_a_recs); __Pyx_XDECREF(__pyx_v_a_wmsgs); __Pyx_XDECREF(__pyx_v_a_cmsgs); __Pyx_XDECREF(__pyx_v_v); __Pyx_XDECREF(__pyx_v_b_recs); __Pyx_XDECREF(__pyx_v_b_wmsgs); __Pyx_XDECREF(__pyx_v_b_cmsgs); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_plugin); __Pyx_XDECREF((PyObject *)__pyx_v_tg); __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pdb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":5989 * raise * * def transition(self, key, finish: str, *args, **kwargs): # <<<<<<<<<<<<<< * """Transition a key from its current state to the finish state * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_178transition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_177transition[] = "Transition a key from its current state to the finish state\n\n Examples\n --------\n >>> self.transition('x', 'waiting')\n {'x': 'processing'}\n\n Returns\n -------\n Dictionary of recommendations for future transitions\n\n See Also\n --------\n Scheduler.transitions: transitive version of this function\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_178transition = {"transition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_178transition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_177transition}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_178transition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_finish = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); if (PyTuple_GET_SIZE(__pyx_args) > 3) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 3, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_finish,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("transition", 0, 3, 3, 1); __PYX_ERR(0, 5989, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_finish)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("transition", 0, 3, 3, 2); __PYX_ERR(0, 5989, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 3) ? pos_args : 3; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "transition") < 0)) __PYX_ERR(0, 5989, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_finish = ((PyObject*)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transition", 0, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5989, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.transition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_finish), (&PyUnicode_Type), 1, "finish", 1))) __PYX_ERR(0, 5989, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_177transition(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_finish, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_177transition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_finish, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_recommendations = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_a = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition", 0); /* "distributed/scheduler.py":6008 * worker_msgs: dict * client_msgs: dict * a: tuple = self._transition(key, finish, *args, **kwargs) # <<<<<<<<<<<<<< * recommendations, worker_msgs, client_msgs = a * self.send_all(client_msgs, worker_msgs) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_finish); __Pyx_GIVEREF(__pyx_v_finish); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_finish); __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 6008, __pyx_L1_error) __pyx_v_a = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6009 * client_msgs: dict * a: tuple = self._transition(key, finish, *args, **kwargs) * recommendations, worker_msgs, client_msgs = a # <<<<<<<<<<<<<< * self.send_all(client_msgs, worker_msgs) * return recommendations */ if (likely(__pyx_v_a != Py_None)) { PyObject* sequence = __pyx_v_a; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6009, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 6009, __pyx_L1_error) } if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 6009, __pyx_L1_error) if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 6009, __pyx_L1_error) if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 6009, __pyx_L1_error) __pyx_v_recommendations = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __pyx_v_worker_msgs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; __pyx_v_client_msgs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6010 * a: tuple = self._transition(key, finish, *args, **kwargs) * recommendations, worker_msgs, client_msgs = a * self.send_all(client_msgs, worker_msgs) # <<<<<<<<<<<<<< * return recommendations * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_all); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_client_msgs, __pyx_v_worker_msgs}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6010, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_client_msgs, __pyx_v_worker_msgs}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6010, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_client_msgs); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_worker_msgs); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6011 * recommendations, worker_msgs, client_msgs = a * self.send_all(client_msgs, worker_msgs) * return recommendations # <<<<<<<<<<<<<< * * def transitions(self, recommendations: dict): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_recommendations); __pyx_r = __pyx_v_recommendations; goto __pyx_L0; /* "distributed/scheduler.py":5989 * raise * * def transition(self, key, finish: str, *args, **kwargs): # <<<<<<<<<<<<<< * """Transition a key from its current state to the finish state * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.transition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6013 * return recommendations * * def transitions(self, recommendations: dict): # <<<<<<<<<<<<<< * """Process transitions until none are left * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_180transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_179transitions[] = "Process transitions until none are left\n\n This includes feedback from previous transitions and continues until we\n reach a steady state\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_180transitions = {"transitions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_180transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_179transitions}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_180transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_recommendations = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transitions (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_recommendations,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_recommendations)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("transitions", 1, 2, 2, 1); __PYX_ERR(0, 6013, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transitions") < 0)) __PYX_ERR(0, 6013, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_recommendations = ((PyObject*)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6013, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.transitions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_recommendations), (&PyDict_Type), 1, "recommendations", 1))) __PYX_ERR(0, 6013, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_179transitions(__pyx_self, __pyx_v_self, __pyx_v_recommendations); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_179transitions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_recommendations) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_worker_msgs = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_msgs = 0; PyObject *__pyx_v_new_msgs = 0; PyObject *__pyx_v_new = 0; PyObject *__pyx_v_new_recs = 0; PyObject *__pyx_v_new_wmsgs = 0; PyObject *__pyx_v_new_cmsgs = 0; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_finish = NULL; PyObject *__pyx_v_w = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transitions", 0); __Pyx_INCREF(__pyx_v_recommendations); /* "distributed/scheduler.py":6019 * reach a steady state * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * keys: set = set() * recommendations = recommendations.copy() */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6020 * """ * parent: SchedulerState = cast(SchedulerState, self) * keys: set = set() # <<<<<<<<<<<<<< * recommendations = recommendations.copy() * worker_msgs: dict = {} */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6021 * parent: SchedulerState = cast(SchedulerState, self) * keys: set = set() * recommendations = recommendations.copy() # <<<<<<<<<<<<<< * worker_msgs: dict = {} * client_msgs: dict = {} */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "copy"); __PYX_ERR(0, 6021, __pyx_L1_error) } __pyx_t_1 = PyDict_Copy(__pyx_v_recommendations); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_recommendations, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":6022 * keys: set = set() * recommendations = recommendations.copy() * worker_msgs: dict = {} # <<<<<<<<<<<<<< * client_msgs: dict = {} * msgs: list */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6022, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_worker_msgs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6023 * recommendations = recommendations.copy() * worker_msgs: dict = {} * client_msgs: dict = {} # <<<<<<<<<<<<<< * msgs: list * new_msgs: list */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_client_msgs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6030 * new_wmsgs: dict * new_cmsgs: dict * while recommendations: # <<<<<<<<<<<<<< * key, finish = recommendations.popitem() * keys.add(key) */ while (1) { __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_recommendations); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6030, __pyx_L1_error) if (!__pyx_t_2) break; /* "distributed/scheduler.py":6031 * new_cmsgs: dict * while recommendations: * key, finish = recommendations.popitem() # <<<<<<<<<<<<<< * keys.add(key) * */ __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_popitem, __pyx_v_recommendations); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6031, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 6031, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 6031, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_finish, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6032 * while recommendations: * key, finish = recommendations.popitem() * keys.add(key) # <<<<<<<<<<<<<< * * new = self._transition(key, finish) */ __pyx_t_7 = PySet_Add(__pyx_v_keys, __pyx_v_key); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6032, __pyx_L1_error) /* "distributed/scheduler.py":6034 * keys.add(key) * * new = self._transition(key, finish) # <<<<<<<<<<<<<< * new_recs, new_wmsgs, new_cmsgs = new * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_finish}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6034, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_finish}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6034, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_key); __Pyx_INCREF(__pyx_v_finish); __Pyx_GIVEREF(__pyx_v_finish); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_finish); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 6034, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_new, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":6035 * * new = self._transition(key, finish) * new_recs, new_wmsgs, new_cmsgs = new # <<<<<<<<<<<<<< * * recommendations.update(new_recs) */ if (likely(__pyx_v_new != Py_None)) { PyObject* sequence = __pyx_v_new; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6035, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 6035, __pyx_L1_error) } if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 6035, __pyx_L1_error) if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 6035, __pyx_L1_error) if (!(likely(PyDict_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 6035, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_new_recs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_new_wmsgs, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_new_cmsgs, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6037 * new_recs, new_wmsgs, new_cmsgs = new * * recommendations.update(new_recs) # <<<<<<<<<<<<<< * for w, new_msgs in new_wmsgs.items(): * msgs = worker_msgs.get(w) */ __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_recommendations, __pyx_v_new_recs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6038 * * recommendations.update(new_recs) * for w, new_msgs in new_wmsgs.items(): # <<<<<<<<<<<<<< * msgs = worker_msgs.get(w) * if msgs is not None: */ __pyx_t_9 = 0; if (unlikely(__pyx_v_new_wmsgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 6038, __pyx_L1_error) } __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_new_wmsgs, 1, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_10, &__pyx_t_9, &__pyx_t_4, &__pyx_t_1, NULL, __pyx_t_8); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 6038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 6038, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_new_msgs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":6039 * recommendations.update(new_recs) * for w, new_msgs in new_wmsgs.items(): * msgs = worker_msgs.get(w) # <<<<<<<<<<<<<< * if msgs is not None: * msgs.extend(new_msgs) */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_worker_msgs, __pyx_v_w, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 6039, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_msgs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "distributed/scheduler.py":6040 * for w, new_msgs in new_wmsgs.items(): * msgs = worker_msgs.get(w) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ __pyx_t_2 = (__pyx_v_msgs != ((PyObject*)Py_None)); __pyx_t_12 = (__pyx_t_2 != 0); if (__pyx_t_12) { /* "distributed/scheduler.py":6041 * msgs = worker_msgs.get(w) * if msgs is not None: * msgs.extend(new_msgs) # <<<<<<<<<<<<<< * else: * worker_msgs[w] = new_msgs */ if (unlikely(__pyx_v_msgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); __PYX_ERR(0, 6041, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_msgs, __pyx_v_new_msgs); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6041, __pyx_L1_error) /* "distributed/scheduler.py":6040 * for w, new_msgs in new_wmsgs.items(): * msgs = worker_msgs.get(w) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ goto __pyx_L9; } /* "distributed/scheduler.py":6043 * msgs.extend(new_msgs) * else: * worker_msgs[w] = new_msgs # <<<<<<<<<<<<<< * for c, new_msgs in new_cmsgs.items(): * msgs = client_msgs.get(c) */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_v_worker_msgs, __pyx_v_w, __pyx_v_new_msgs) < 0)) __PYX_ERR(0, 6043, __pyx_L1_error) } __pyx_L9:; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6044 * else: * worker_msgs[w] = new_msgs * for c, new_msgs in new_cmsgs.items(): # <<<<<<<<<<<<<< * msgs = client_msgs.get(c) * if msgs is not None: */ __pyx_t_10 = 0; if (unlikely(__pyx_v_new_cmsgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 6044, __pyx_L1_error) } __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_new_cmsgs, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_9, &__pyx_t_10, &__pyx_t_1, &__pyx_t_4, NULL, __pyx_t_8); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 6044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 6044, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_new_msgs, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":6045 * worker_msgs[w] = new_msgs * for c, new_msgs in new_cmsgs.items(): * msgs = client_msgs.get(c) # <<<<<<<<<<<<<< * if msgs is not None: * msgs.extend(new_msgs) */ __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_client_msgs, __pyx_v_c, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 6045, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_msgs, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":6046 * for c, new_msgs in new_cmsgs.items(): * msgs = client_msgs.get(c) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ __pyx_t_12 = (__pyx_v_msgs != ((PyObject*)Py_None)); __pyx_t_2 = (__pyx_t_12 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6047 * msgs = client_msgs.get(c) * if msgs is not None: * msgs.extend(new_msgs) # <<<<<<<<<<<<<< * else: * client_msgs[c] = new_msgs */ if (unlikely(__pyx_v_msgs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); __PYX_ERR(0, 6047, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_msgs, __pyx_v_new_msgs); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6047, __pyx_L1_error) /* "distributed/scheduler.py":6046 * for c, new_msgs in new_cmsgs.items(): * msgs = client_msgs.get(c) * if msgs is not None: # <<<<<<<<<<<<<< * msgs.extend(new_msgs) * else: */ goto __pyx_L12; } /* "distributed/scheduler.py":6049 * msgs.extend(new_msgs) * else: * client_msgs[c] = new_msgs # <<<<<<<<<<<<<< * * self.send_all(client_msgs, worker_msgs) */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_c, __pyx_v_new_msgs) < 0)) __PYX_ERR(0, 6049, __pyx_L1_error) } __pyx_L12:; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "distributed/scheduler.py":6051 * client_msgs[c] = new_msgs * * self.send_all(client_msgs, worker_msgs) # <<<<<<<<<<<<<< * * if parent._validate: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_all); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_client_msgs, __pyx_v_worker_msgs}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6051, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_client_msgs, __pyx_v_worker_msgs}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6051, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_client_msgs); __Pyx_GIVEREF(__pyx_v_client_msgs); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_v_client_msgs); __Pyx_INCREF(__pyx_v_worker_msgs); __Pyx_GIVEREF(__pyx_v_worker_msgs); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_worker_msgs); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6053 * self.send_all(client_msgs, worker_msgs) * * if parent._validate: # <<<<<<<<<<<<<< * for key in keys: * self.validate_key(key) */ __pyx_t_2 = (__pyx_v_parent->_validate != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6054 * * if parent._validate: * for key in keys: # <<<<<<<<<<<<<< * self.validate_key(key) * */ __pyx_t_9 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_keys, 1, (&__pyx_t_10), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_5, __pyx_t_10, &__pyx_t_9, &__pyx_t_4, __pyx_t_8); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 6054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6055 * if parent._validate: * for key in keys: * self.validate_key(key) # <<<<<<<<<<<<<< * * def story(self, *keys): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_validate_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6053 * self.send_all(client_msgs, worker_msgs) * * if parent._validate: # <<<<<<<<<<<<<< * for key in keys: * self.validate_key(key) */ } /* "distributed/scheduler.py":6013 * return recommendations * * def transitions(self, recommendations: dict): # <<<<<<<<<<<<<< * """Process transitions until none are left * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.transitions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_keys); __Pyx_XDECREF(__pyx_v_worker_msgs); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_msgs); __Pyx_XDECREF(__pyx_v_new_msgs); __Pyx_XDECREF(__pyx_v_new); __Pyx_XDECREF(__pyx_v_new_recs); __Pyx_XDECREF(__pyx_v_new_wmsgs); __Pyx_XDECREF(__pyx_v_new_cmsgs); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_finish); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_recommendations); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6057 * self.validate_key(key) * * def story(self, *keys): # <<<<<<<<<<<<<< * """ Get all transitions that touch one of the input keys """ * keys = {key.key if isinstance(key, TaskState) else key for key in keys} */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_182story(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_181story[] = " Get all transitions that touch one of the input keys "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_182story = {"story", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_182story, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_181story}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_182story(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_keys = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("story (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_keys = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_keys)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_keys); } else { __pyx_v_keys = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "story") < 0)) __PYX_ERR(0, 6057, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("story", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6057, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_keys); __pyx_v_keys = 0; __Pyx_AddTraceback("distributed.scheduler.Scheduler.story", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_181story(__pyx_self, __pyx_v_self, __pyx_v_keys); /* function exit code */ __Pyx_XDECREF(__pyx_v_keys); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_181story(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys) { PyObject *__pyx_10genexpr132__pyx_v_key = NULL; PyObject *__pyx_10genexpr133__pyx_v_t = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("story", 0); __Pyx_INCREF(__pyx_v_keys); /* "distributed/scheduler.py":6059 * def story(self, *keys): * """ Get all transitions that touch one of the input keys """ * keys = {key.key if isinstance(key, TaskState) else key for key in keys} # <<<<<<<<<<<<<< * return [ * t for t in self.transition_log if t[0] in keys or keys.intersection(t[3]) */ { /* enter inner scope */ __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6059, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_2 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6059, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6059, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 6059, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6059, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 6059, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6059, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6059, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_10genexpr132__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_TypeCheck(__pyx_10genexpr132__pyx_v_key, __pyx_ptype_11distributed_9scheduler_TaskState); if ((__pyx_t_6 != 0)) { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_10genexpr132__pyx_v_key, __pyx_n_s_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6059, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __pyx_t_7; __pyx_t_7 = 0; } else { __Pyx_INCREF(__pyx_10genexpr132__pyx_v_key); __pyx_t_5 = __pyx_10genexpr132__pyx_v_key; } if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 6059, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_10genexpr132__pyx_v_key); __pyx_10genexpr132__pyx_v_key = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_10genexpr132__pyx_v_key); __pyx_10genexpr132__pyx_v_key = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6060 * """ Get all transitions that touch one of the input keys """ * keys = {key.key if isinstance(key, TaskState) else key for key in keys} * return [ # <<<<<<<<<<<<<< * t for t in self.transition_log if t[0] in keys or keys.intersection(t[3]) * ] */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6060, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":6061 * keys = {key.key if isinstance(key, TaskState) else key for key in keys} * return [ * t for t in self.transition_log if t[0] in keys or keys.intersection(t[3]) # <<<<<<<<<<<<<< * ] * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transition_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6061, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 6061, __pyx_L11_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 6061, __pyx_L11_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_5); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6061, __pyx_L11_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_10genexpr133__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_10genexpr133__pyx_v_t, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_keys, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = (__pyx_t_8 != 0); if (!__pyx_t_9) { } else { __pyx_t_6 = __pyx_t_9; goto __pyx_L15_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_keys, __pyx_n_s_intersection); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = __Pyx_GetItemInt(__pyx_10genexpr133__pyx_v_t, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 6061, __pyx_L11_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_9; __pyx_L15_bool_binop_done:; if (__pyx_t_6) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_10genexpr133__pyx_v_t))) __PYX_ERR(0, 6060, __pyx_L11_error) } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_10genexpr133__pyx_v_t); __pyx_10genexpr133__pyx_v_t = 0; goto __pyx_L17_exit_scope; __pyx_L11_error:; __Pyx_XDECREF(__pyx_10genexpr133__pyx_v_t); __pyx_10genexpr133__pyx_v_t = 0; goto __pyx_L1_error; __pyx_L17_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6057 * self.validate_key(key) * * def story(self, *keys): # <<<<<<<<<<<<<< * """ Get all transitions that touch one of the input keys """ * keys = {key.key if isinstance(key, TaskState) else key for key in keys} */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.Scheduler.story", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_keys); __Pyx_XDECREF(__pyx_10genexpr132__pyx_v_key); __Pyx_XDECREF(__pyx_10genexpr133__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6066 * transition_story = story * * def reschedule(self, key=None, worker=None): # <<<<<<<<<<<<<< * """Reschedule a task * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_184reschedule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_183reschedule[] = "Reschedule a task\n\n Things may have shifted and this task may now be better suited to run\n elsewhere\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_184reschedule = {"reschedule", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_184reschedule, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_183reschedule}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_184reschedule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_worker = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reschedule (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_worker,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reschedule") < 0)) __PYX_ERR(0, 6066, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_worker = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reschedule", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6066, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.reschedule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_183reschedule(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_worker); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_183reschedule(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_worker) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reschedule", 0); /* "distributed/scheduler.py":6072 * elsewhere * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ts: TaskState * try: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6074 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState * try: # <<<<<<<<<<<<<< * ts = parent._tasks[key] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":6075 * ts: TaskState * try: * ts = parent._tasks[key] # <<<<<<<<<<<<<< * except KeyError: * logger.warning( */ if (unlikely(__pyx_v_parent->_tasks == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6075, __pyx_L3_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_tasks, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6075, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6075, __pyx_L3_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6074 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState * try: # <<<<<<<<<<<<<< * ts = parent._tasks[key] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6076 * try: * ts = parent._tasks[key] * except KeyError: # <<<<<<<<<<<<<< * logger.warning( * "Attempting to reschedule task {}, which was not " */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.reschedule", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 6076, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); /* "distributed/scheduler.py":6077 * ts = parent._tasks[key] * except KeyError: * logger.warning( # <<<<<<<<<<<<<< * "Attempting to reschedule task {}, which was not " * "found on the scheduler. Aborting reschedule.".format(key) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6077, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_warning); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6077, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":6079 * logger.warning( * "Attempting to reschedule task {}, which was not " * "found on the scheduler. Aborting reschedule.".format(key) # <<<<<<<<<<<<<< * ) * return */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Attempting_to_reschedule_task_wh, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6079, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_9 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_key); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6079, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6077, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":6081 * "found on the scheduler. Aborting reschedule.".format(key) * ) * return # <<<<<<<<<<<<<< * if ts._state != "processing": * return */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":6074 * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState * try: # <<<<<<<<<<<<<< * ts = parent._tasks[key] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "distributed/scheduler.py":6082 * ) * return * if ts._state != "processing": # <<<<<<<<<<<<<< * return * if worker and ts._processing_on.address != worker: */ __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_processing_2, Py_NE)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 6082, __pyx_L1_error) __pyx_t_14 = (__pyx_t_13 != 0); if (__pyx_t_14) { /* "distributed/scheduler.py":6083 * return * if ts._state != "processing": * return # <<<<<<<<<<<<<< * if worker and ts._processing_on.address != worker: * return */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":6082 * ) * return * if ts._state != "processing": # <<<<<<<<<<<<<< * return * if worker and ts._processing_on.address != worker: */ } /* "distributed/scheduler.py":6084 * if ts._state != "processing": * return * if worker and ts._processing_on.address != worker: # <<<<<<<<<<<<<< * return * self.transitions({key: "released"}) */ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_worker); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 6084, __pyx_L1_error) if (__pyx_t_13) { } else { __pyx_t_14 = __pyx_t_13; goto __pyx_L13_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ts->_processing_on), __pyx_n_s_address); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_v_worker, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6084, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 6084, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_14 = __pyx_t_13; __pyx_L13_bool_binop_done:; if (__pyx_t_14) { /* "distributed/scheduler.py":6085 * return * if worker and ts._processing_on.address != worker: * return # <<<<<<<<<<<<<< * self.transitions({key: "released"}) * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":6084 * if ts._state != "processing": * return * if worker and ts._processing_on.address != worker: # <<<<<<<<<<<<<< * return * self.transitions({key: "released"}) */ } /* "distributed/scheduler.py":6086 * if worker and ts._processing_on.address != worker: * return * self.transitions({key: "released"}) # <<<<<<<<<<<<<< * * ##################### */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transitions_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_v_key, __pyx_n_u_released) < 0) __PYX_ERR(0, 6086, __pyx_L1_error) __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6066 * transition_story = story * * def reschedule(self, key=None, worker=None): # <<<<<<<<<<<<<< * """Reschedule a task * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("distributed.scheduler.Scheduler.reschedule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6092 * ##################### * * def add_resources(self, comm=None, worker=None, resources=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_186add_resources(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_186add_resources = {"add_resources", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_186add_resources, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_186add_resources(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_worker = 0; PyObject *__pyx_v_resources = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_resources (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_worker,&__pyx_n_s_resources,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resources); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_resources") < 0)) __PYX_ERR(0, 6092, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_worker = values[2]; __pyx_v_resources = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_resources", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6092, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_185add_resources(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_worker, __pyx_v_resources); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_185add_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_worker, PyObject *__pyx_v_resources) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_resource = NULL; PyObject *__pyx_v_quantity = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_resources", 0); /* "distributed/scheduler.py":6093 * * def add_resources(self, comm=None, worker=None, resources=None): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[worker] * if resources: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6094 * def add_resources(self, comm=None, worker=None, resources=None): * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] # <<<<<<<<<<<<<< * if resources: * ws._resources.update(resources) */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6094, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_v_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6094, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6095 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] * if resources: # <<<<<<<<<<<<<< * ws._resources.update(resources) * ws._used_resources = {} */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_resources); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6095, __pyx_L1_error) if (__pyx_t_2) { /* "distributed/scheduler.py":6096 * ws: WorkerState = parent._workers_dv[worker] * if resources: * ws._resources.update(resources) # <<<<<<<<<<<<<< * ws._used_resources = {} * for resource, quantity in ws._resources.items(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ws->_resources, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_resources) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_resources); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6095 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] * if resources: # <<<<<<<<<<<<<< * ws._resources.update(resources) * ws._used_resources = {} */ } /* "distributed/scheduler.py":6097 * if resources: * ws._resources.update(resources) * ws._used_resources = {} # <<<<<<<<<<<<<< * for resource, quantity in ws._resources.items(): * ws._used_resources[resource] = 0 */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_ws->_used_resources); __Pyx_DECREF(__pyx_v_ws->_used_resources); __pyx_v_ws->_used_resources = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6098 * ws._resources.update(resources) * ws._used_resources = {} * for resource, quantity in ws._resources.items(): # <<<<<<<<<<<<<< * ws._used_resources[resource] = 0 * parent._resources[resource][worker] = quantity */ __pyx_t_5 = 0; if (unlikely(__pyx_v_ws->_resources == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 6098, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_ws->_resources, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_3, &__pyx_t_4, NULL, __pyx_t_7); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 6098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_resource, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_quantity, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6099 * ws._used_resources = {} * for resource, quantity in ws._resources.items(): * ws._used_resources[resource] = 0 # <<<<<<<<<<<<<< * parent._resources[resource][worker] = quantity * return "OK" */ if (unlikely(__pyx_v_ws->_used_resources == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6099, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_ws->_used_resources, __pyx_v_resource, __pyx_int_0) < 0)) __PYX_ERR(0, 6099, __pyx_L1_error) /* "distributed/scheduler.py":6100 * for resource, quantity in ws._resources.items(): * ws._used_resources[resource] = 0 * parent._resources[resource][worker] = quantity # <<<<<<<<<<<<<< * return "OK" * */ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_parent->_resources, __pyx_v_resource); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_worker, __pyx_v_quantity) < 0)) __PYX_ERR(0, 6100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6101 * ws._used_resources[resource] = 0 * parent._resources[resource][worker] = quantity * return "OK" # <<<<<<<<<<<<<< * * def remove_resources(self, worker): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_u_OK); __pyx_r = __pyx_n_u_OK; goto __pyx_L0; /* "distributed/scheduler.py":6092 * ##################### * * def add_resources(self, comm=None, worker=None, resources=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.Scheduler.add_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_resource); __Pyx_XDECREF(__pyx_v_quantity); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6103 * return "OK" * * def remove_resources(self, worker): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_188remove_resources(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_188remove_resources = {"remove_resources", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_188remove_resources, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_188remove_resources(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_worker = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_resources (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("remove_resources", 1, 2, 2, 1); __PYX_ERR(0, 6103, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_resources") < 0)) __PYX_ERR(0, 6103, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_worker = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_resources", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6103, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_187remove_resources(__pyx_self, __pyx_v_self, __pyx_v_worker); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_187remove_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_resource = NULL; CYTHON_UNUSED PyObject *__pyx_v_quantity = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_resources", 0); /* "distributed/scheduler.py":6104 * * def remove_resources(self, worker): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState = parent._workers_dv[worker] * for resource, quantity in ws._resources.items(): */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6105 * def remove_resources(self, worker): * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] # <<<<<<<<<<<<<< * for resource, quantity in ws._resources.items(): * del parent._resources[resource][worker] */ if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6105, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_workers_dv, __pyx_v_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6105, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6106 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] * for resource, quantity in ws._resources.items(): # <<<<<<<<<<<<<< * del parent._resources[resource][worker] * */ __pyx_t_2 = 0; if (unlikely(__pyx_v_ws->_resources == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 6106, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_ws->_resources, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 6106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_resource, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_quantity, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6107 * ws: WorkerState = parent._workers_dv[worker] * for resource, quantity in ws._resources.items(): * del parent._resources[resource][worker] # <<<<<<<<<<<<<< * * def coerce_address(self, addr, resolve=True): */ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_parent->_resources, __pyx_v_resource); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(PyObject_DelItem(__pyx_t_6, __pyx_v_worker) < 0)) __PYX_ERR(0, 6107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6103 * return "OK" * * def remove_resources(self, worker): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("distributed.scheduler.Scheduler.remove_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_resource); __Pyx_XDECREF(__pyx_v_quantity); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6109 * del parent._resources[resource][worker] * * def coerce_address(self, addr, resolve=True): # <<<<<<<<<<<<<< * """ * Coerce possible input addresses to canonical form. */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_190coerce_address(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_189coerce_address[] = "\n Coerce possible input addresses to canonical form.\n *resolve* can be disabled for testing with fake hostnames.\n\n Handles strings, tuples, or aliases.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_190coerce_address = {"coerce_address", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_190coerce_address, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_189coerce_address}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_190coerce_address(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_addr = 0; PyObject *__pyx_v_resolve = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coerce_address (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_addr,&__pyx_n_s_resolve,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)((PyObject *)Py_True)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addr)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("coerce_address", 0, 2, 3, 1); __PYX_ERR(0, 6109, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resolve); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coerce_address") < 0)) __PYX_ERR(0, 6109, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_addr = values[1]; __pyx_v_resolve = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("coerce_address", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6109, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.coerce_address", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_189coerce_address(__pyx_self, __pyx_v_self, __pyx_v_addr, __pyx_v_resolve); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_189coerce_address(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_resolve) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coerce_address", 0); __Pyx_INCREF(__pyx_v_addr); /* "distributed/scheduler.py":6117 * """ * # XXX how many address-parsing routines do we have? * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if addr in parent._aliases: * addr = parent._aliases[addr] */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6118 * # XXX how many address-parsing routines do we have? * parent: SchedulerState = cast(SchedulerState, self) * if addr in parent._aliases: # <<<<<<<<<<<<<< * addr = parent._aliases[addr] * if isinstance(addr, tuple): */ if (unlikely(__pyx_v_parent->_aliases == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6118, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_addr, __pyx_v_parent->_aliases, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6118, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6119 * parent: SchedulerState = cast(SchedulerState, self) * if addr in parent._aliases: * addr = parent._aliases[addr] # <<<<<<<<<<<<<< * if isinstance(addr, tuple): * addr = unparse_host_port(*addr) */ if (unlikely(__pyx_v_parent->_aliases == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6119, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_parent->_aliases, __pyx_v_addr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6118 * # XXX how many address-parsing routines do we have? * parent: SchedulerState = cast(SchedulerState, self) * if addr in parent._aliases: # <<<<<<<<<<<<<< * addr = parent._aliases[addr] * if isinstance(addr, tuple): */ } /* "distributed/scheduler.py":6120 * if addr in parent._aliases: * addr = parent._aliases[addr] * if isinstance(addr, tuple): # <<<<<<<<<<<<<< * addr = unparse_host_port(*addr) * if not isinstance(addr, str): */ __pyx_t_3 = PyTuple_Check(__pyx_v_addr); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6121 * addr = parent._aliases[addr] * if isinstance(addr, tuple): * addr = unparse_host_port(*addr) # <<<<<<<<<<<<<< * if not isinstance(addr, str): * raise TypeError("addresses should be strings or tuples, got %r" % (addr,)) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unparse_host_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_addr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6120 * if addr in parent._aliases: * addr = parent._aliases[addr] * if isinstance(addr, tuple): # <<<<<<<<<<<<<< * addr = unparse_host_port(*addr) * if not isinstance(addr, str): */ } /* "distributed/scheduler.py":6122 * if isinstance(addr, tuple): * addr = unparse_host_port(*addr) * if not isinstance(addr, str): # <<<<<<<<<<<<<< * raise TypeError("addresses should be strings or tuples, got %r" % (addr,)) * */ __pyx_t_2 = PyUnicode_Check(__pyx_v_addr); __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (unlikely(__pyx_t_3)) { /* "distributed/scheduler.py":6123 * addr = unparse_host_port(*addr) * if not isinstance(addr, str): * raise TypeError("addresses should be strings or tuples, got %r" % (addr,)) # <<<<<<<<<<<<<< * * if resolve: */ __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_addr), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_addresses_should_be_strings_or_t, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 6123, __pyx_L1_error) /* "distributed/scheduler.py":6122 * if isinstance(addr, tuple): * addr = unparse_host_port(*addr) * if not isinstance(addr, str): # <<<<<<<<<<<<<< * raise TypeError("addresses should be strings or tuples, got %r" % (addr,)) * */ } /* "distributed/scheduler.py":6125 * raise TypeError("addresses should be strings or tuples, got %r" % (addr,)) * * if resolve: # <<<<<<<<<<<<<< * addr = resolve_address(addr) * else: */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_resolve); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6125, __pyx_L1_error) if (__pyx_t_3) { /* "distributed/scheduler.py":6126 * * if resolve: * addr = resolve_address(addr) # <<<<<<<<<<<<<< * else: * addr = normalize_address(addr) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_resolve_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_addr) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_addr); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6125 * raise TypeError("addresses should be strings or tuples, got %r" % (addr,)) * * if resolve: # <<<<<<<<<<<<<< * addr = resolve_address(addr) * else: */ goto __pyx_L6; } /* "distributed/scheduler.py":6128 * addr = resolve_address(addr) * else: * addr = normalize_address(addr) # <<<<<<<<<<<<<< * * return addr */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_normalize_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_addr) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_addr); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_addr, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L6:; /* "distributed/scheduler.py":6130 * addr = normalize_address(addr) * * return addr # <<<<<<<<<<<<<< * * def workers_list(self, workers): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_addr); __pyx_r = __pyx_v_addr; goto __pyx_L0; /* "distributed/scheduler.py":6109 * del parent._resources[resource][worker] * * def coerce_address(self, addr, resolve=True): # <<<<<<<<<<<<<< * """ * Coerce possible input addresses to canonical form. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.coerce_address", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_addr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6132 * return addr * * def workers_list(self, workers): # <<<<<<<<<<<<<< * """ * List of qualifying workers */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_192workers_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_191workers_list[] = "\n List of qualifying workers\n\n Takes a list of worker addresses or hostnames.\n Returns a list of all worker addresses that match\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_192workers_list = {"workers_list", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_192workers_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_191workers_list}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_192workers_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_workers = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("workers_list (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_workers,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("workers_list", 1, 2, 2, 1); __PYX_ERR(0, 6132, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "workers_list") < 0)) __PYX_ERR(0, 6132, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_workers = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("workers_list", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6132, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.workers_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_191workers_list(__pyx_self, __pyx_v_self, __pyx_v_workers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_191workers_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_workers) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_w = NULL; PyObject *__pyx_10genexpr134__pyx_v_ww = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("workers_list", 0); /* "distributed/scheduler.py":6139 * Returns a list of all worker addresses that match * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if workers is None: * return list(parent._workers) */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6140 * """ * parent: SchedulerState = cast(SchedulerState, self) * if workers is None: # <<<<<<<<<<<<<< * return list(parent._workers) * */ __pyx_t_2 = (__pyx_v_workers == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6141 * parent: SchedulerState = cast(SchedulerState, self) * if workers is None: * return list(parent._workers) # <<<<<<<<<<<<<< * * out = set() */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PySequence_List(__pyx_v_parent->_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6140 * """ * parent: SchedulerState = cast(SchedulerState, self) * if workers is None: # <<<<<<<<<<<<<< * return list(parent._workers) * */ } /* "distributed/scheduler.py":6143 * return list(parent._workers) * * out = set() # <<<<<<<<<<<<<< * for w in workers: * if ":" in w: */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6144 * * out = set() * for w in workers: # <<<<<<<<<<<<<< * if ":" in w: * out.add(w) */ if (likely(PyList_CheckExact(__pyx_v_workers)) || PyTuple_CheckExact(__pyx_v_workers)) { __pyx_t_1 = __pyx_v_workers; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6144, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 6144, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 6144, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6144, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6145 * out = set() * for w in workers: * if ":" in w: # <<<<<<<<<<<<<< * out.add(w) * else: */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__51, __pyx_v_w, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6145, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6146 * for w in workers: * if ":" in w: * out.add(w) # <<<<<<<<<<<<<< * else: * out.update({ww for ww in parent._workers if w in ww}) # TODO: quadratic */ __pyx_t_7 = PySet_Add(__pyx_v_out, __pyx_v_w); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6146, __pyx_L1_error) /* "distributed/scheduler.py":6145 * out = set() * for w in workers: * if ":" in w: # <<<<<<<<<<<<<< * out.add(w) * else: */ goto __pyx_L6; } /* "distributed/scheduler.py":6148 * out.add(w) * else: * out.update({ww for ww in parent._workers if w in ww}) # TODO: quadratic # <<<<<<<<<<<<<< * return list(out) * */ /*else*/ { { /* enter inner scope */ __pyx_t_6 = PySet_New(NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6148, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); if (likely(PyList_CheckExact(__pyx_v_parent->_workers)) || PyTuple_CheckExact(__pyx_v_parent->_workers)) { __pyx_t_8 = __pyx_v_parent->_workers; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_parent->_workers); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6148, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6148, __pyx_L9_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6148, __pyx_L9_error) #else __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6148, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6148, __pyx_L9_error) #else __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6148, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_11); #endif } } else { __pyx_t_11 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_11)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6148, __pyx_L9_error) } break; } __Pyx_GOTREF(__pyx_t_11); } __Pyx_XDECREF_SET(__pyx_10genexpr134__pyx_v_ww, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_w, __pyx_10genexpr134__pyx_v_ww, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6148, __pyx_L9_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { if (unlikely(PySet_Add(__pyx_t_6, (PyObject*)__pyx_10genexpr134__pyx_v_ww))) __PYX_ERR(0, 6148, __pyx_L9_error) } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_10genexpr134__pyx_v_ww); __pyx_10genexpr134__pyx_v_ww = 0; goto __pyx_L13_exit_scope; __pyx_L9_error:; __Pyx_XDECREF(__pyx_10genexpr134__pyx_v_ww); __pyx_10genexpr134__pyx_v_ww = 0; goto __pyx_L1_error; __pyx_L13_exit_scope:; } /* exit inner scope */ __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_out, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L6:; /* "distributed/scheduler.py":6144 * * out = set() * for w in workers: # <<<<<<<<<<<<<< * if ":" in w: * out.add(w) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6149 * else: * out.update({ww for ww in parent._workers if w in ww}) # TODO: quadratic * return list(out) # <<<<<<<<<<<<<< * * def start_ipython(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PySequence_List(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6132 * return addr * * def workers_list(self, workers): # <<<<<<<<<<<<<< * """ * List of qualifying workers */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.Scheduler.workers_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_out); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_10genexpr134__pyx_v_ww); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6151 * return list(out) * * def start_ipython(self, comm=None): # <<<<<<<<<<<<<< * """Start an IPython kernel * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_194start_ipython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_193start_ipython[] = "Start an IPython kernel\n\n Returns Jupyter connection info dictionary.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_194start_ipython = {"start_ipython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_194start_ipython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_193start_ipython}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_194start_ipython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start_ipython (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start_ipython") < 0)) __PYX_ERR(0, 6151, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("start_ipython", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6151, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.start_ipython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_193start_ipython(__pyx_self, __pyx_v_self, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_193start_ipython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm) { PyObject *__pyx_v_start_ipython = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start_ipython", 0); /* "distributed/scheduler.py":6156 * Returns Jupyter connection info dictionary. * """ * from ._ipython_utils import start_ipython # <<<<<<<<<<<<<< * * if self._ipython_kernel is None: */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_start_ipython); __Pyx_GIVEREF(__pyx_n_s_start_ipython); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_start_ipython); __pyx_t_2 = __Pyx_Import(__pyx_n_s_ipython_utils, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_start_ipython); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_start_ipython = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6158 * from ._ipython_utils import start_ipython * * if self._ipython_kernel is None: # <<<<<<<<<<<<<< * self._ipython_kernel = start_ipython( * ip=self.ip, ns={"scheduler": self}, log=logger */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ipython_kernel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 == Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "distributed/scheduler.py":6160 * if self._ipython_kernel is None: * self._ipython_kernel = start_ipython( * ip=self.ip, ns={"scheduler": self}, log=logger # <<<<<<<<<<<<<< * ) * return self._ipython_kernel.get_connection_info() */ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ip, __pyx_t_1) < 0) __PYX_ERR(0, 6160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_scheduler, __pyx_v_self) < 0) __PYX_ERR(0, 6160, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ns, __pyx_t_1) < 0) __PYX_ERR(0, 6160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_log, __pyx_t_1) < 0) __PYX_ERR(0, 6160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6159 * * if self._ipython_kernel is None: * self._ipython_kernel = start_ipython( # <<<<<<<<<<<<<< * ip=self.ip, ns={"scheduler": self}, log=logger * ) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_start_ipython, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ipython_kernel, __pyx_t_1) < 0) __PYX_ERR(0, 6159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6158 * from ._ipython_utils import start_ipython * * if self._ipython_kernel is None: # <<<<<<<<<<<<<< * self._ipython_kernel = start_ipython( * ip=self.ip, ns={"scheduler": self}, log=logger */ } /* "distributed/scheduler.py":6162 * ip=self.ip, ns={"scheduler": self}, log=logger * ) * return self._ipython_kernel.get_connection_info() # <<<<<<<<<<<<<< * * async def get_profile( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ipython_kernel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_connection_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6151 * return list(out) * * def start_ipython(self, comm=None): # <<<<<<<<<<<<<< * """Start an IPython kernel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.Scheduler.start_ipython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start_ipython); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_197generator20(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":6164 * return self._ipython_kernel.get_connection_info() * * async def get_profile( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_196get_profile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_196get_profile = {"get_profile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_196get_profile, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_196get_profile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_workers = 0; PyObject *__pyx_v_scheduler = 0; PyObject *__pyx_v_server = 0; PyObject *__pyx_v_merge_workers = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_stop = 0; PyObject *__pyx_v_key = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_profile (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_workers,&__pyx_n_s_scheduler,&__pyx_n_s_server,&__pyx_n_s_merge_workers,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_key,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; /* "distributed/scheduler.py":6166 * async def get_profile( * self, * comm=None, # <<<<<<<<<<<<<< * workers=None, * scheduler=False, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":6167 * self, * comm=None, * workers=None, # <<<<<<<<<<<<<< * scheduler=False, * server=False, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":6168 * comm=None, * workers=None, * scheduler=False, # <<<<<<<<<<<<<< * server=False, * merge_workers=True, */ values[3] = ((PyObject *)((PyObject *)Py_False)); /* "distributed/scheduler.py":6169 * workers=None, * scheduler=False, * server=False, # <<<<<<<<<<<<<< * merge_workers=True, * start=None, */ values[4] = ((PyObject *)((PyObject *)Py_False)); /* "distributed/scheduler.py":6170 * scheduler=False, * server=False, * merge_workers=True, # <<<<<<<<<<<<<< * start=None, * stop=None, */ values[5] = ((PyObject *)((PyObject *)Py_True)); /* "distributed/scheduler.py":6171 * server=False, * merge_workers=True, * start=None, # <<<<<<<<<<<<<< * stop=None, * key=None, */ values[6] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":6172 * merge_workers=True, * start=None, * stop=None, # <<<<<<<<<<<<<< * key=None, * ): */ values[7] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":6173 * start=None, * stop=None, * key=None, # <<<<<<<<<<<<<< * ): * parent: SchedulerState = cast(SchedulerState, self) */ values[8] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scheduler); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_server); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_merge_workers); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[8] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_profile") < 0)) __PYX_ERR(0, 6164, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_workers = values[2]; __pyx_v_scheduler = values[3]; __pyx_v_server = values[4]; __pyx_v_merge_workers = values[5]; __pyx_v_start = values[6]; __pyx_v_stop = values[7]; __pyx_v_key = values[8]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_profile", 0, 1, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6164, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_profile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_195get_profile(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_workers, __pyx_v_scheduler, __pyx_v_server, __pyx_v_merge_workers, __pyx_v_start, __pyx_v_stop, __pyx_v_key); /* "distributed/scheduler.py":6164 * return self._ipython_kernel.get_connection_info() * * async def get_profile( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_11get_profile_2generator43(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":6186 * results = await asyncio.gather( * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) # <<<<<<<<<<<<<< * for w in workers * ), */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_11get_profile_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_49_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_49_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 6186, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_11get_profile_2generator43, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_get_profile_locals_gen, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 6186, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_profile.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_11get_profile_2generator43(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6186, __pyx_L1_error) /* "distributed/scheduler.py":6187 * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) * for w in workers # <<<<<<<<<<<<<< * ), * return_exceptions=True, */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers)) { __Pyx_RaiseClosureNameError("workers"); __PYX_ERR(0, 6187, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6187, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 6187, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 6187, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6187, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_w, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6186 * results = await asyncio.gather( * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) # <<<<<<<<<<<<<< * for w in workers * ), */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 6186, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_w) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_profile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_start)) { __Pyx_RaiseClosureNameError("start"); __PYX_ERR(0, 6186, __pyx_L1_error) } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_start, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_start) < 0) __PYX_ERR(0, 6186, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_stop)) { __Pyx_RaiseClosureNameError("stop"); __PYX_ERR(0, 6186, __pyx_L1_error) } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_stop, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_stop) < 0) __PYX_ERR(0, 6186, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 6186, __pyx_L1_error) } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key) < 0) __PYX_ERR(0, 6186, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_server)) { __Pyx_RaiseClosureNameError("server"); __PYX_ERR(0, 6186, __pyx_L1_error) } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_server, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_server) < 0) __PYX_ERR(0, 6186, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6186, __pyx_L1_error) /* "distributed/scheduler.py":6187 * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) * for w in workers # <<<<<<<<<<<<<< * ), * return_exceptions=True, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":6186 * results = await asyncio.gather( * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) # <<<<<<<<<<<<<< * for w in workers * ), */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6164 * return self._ipython_kernel.get_connection_info() * * async def get_profile( # <<<<<<<<<<<<<< * self, * comm=None, */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_195get_profile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers, PyObject *__pyx_v_scheduler, PyObject *__pyx_v_server, PyObject *__pyx_v_merge_workers, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_key) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_profile", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_48_get_profile(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_48_get_profile, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 6164, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_workers = __pyx_v_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); __pyx_cur_scope->__pyx_v_scheduler = __pyx_v_scheduler; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_scheduler); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_scheduler); __pyx_cur_scope->__pyx_v_server = __pyx_v_server; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_server); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_server); __pyx_cur_scope->__pyx_v_merge_workers = __pyx_v_merge_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_merge_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_merge_workers); __pyx_cur_scope->__pyx_v_start = __pyx_v_start; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start); __pyx_cur_scope->__pyx_v_stop = __pyx_v_stop; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stop); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stop); __pyx_cur_scope->__pyx_v_key = __pyx_v_key; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_197generator20, __pyx_codeobj__87, (PyObject *) __pyx_cur_scope, __pyx_n_s_get_profile, __pyx_n_s_Scheduler_get_profile, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 6164, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_profile", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_197generator20(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_profile", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6164, __pyx_L1_error) /* "distributed/scheduler.py":6175 * key=None, * ): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if workers is None: * workers = parent._workers_dv */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6176 * ): * parent: SchedulerState = cast(SchedulerState, self) * if workers is None: # <<<<<<<<<<<<<< * workers = parent._workers_dv * else: */ __pyx_t_2 = (__pyx_cur_scope->__pyx_v_workers == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6177 * parent: SchedulerState = cast(SchedulerState, self) * if workers is None: * workers = parent._workers_dv # <<<<<<<<<<<<<< * else: * workers = set(parent._workers_dv) & set(workers) */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_1); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6176 * ): * parent: SchedulerState = cast(SchedulerState, self) * if workers is None: # <<<<<<<<<<<<<< * workers = parent._workers_dv * else: */ goto __pyx_L4; } /* "distributed/scheduler.py":6179 * workers = parent._workers_dv * else: * workers = set(parent._workers_dv) & set(workers) # <<<<<<<<<<<<<< * * if scheduler: */ /*else*/ { __pyx_t_1 = PySet_New(__pyx_cur_scope->__pyx_v_parent->_workers_dv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySet_New(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_And(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L4:; /* "distributed/scheduler.py":6181 * workers = set(parent._workers_dv) & set(workers) * * if scheduler: # <<<<<<<<<<<<<< * return profile.get_profile(self.io_loop.profile, start=start, stop=stop) * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_scheduler); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6181, __pyx_L1_error) if (__pyx_t_3) { /* "distributed/scheduler.py":6182 * * if scheduler: * return profile.get_profile(self.io_loop.profile, start=start, stop=stop) # <<<<<<<<<<<<<< * * results = await asyncio.gather( */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_profile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_profile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_io_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_profile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_start, __pyx_cur_scope->__pyx_v_start) < 0) __PYX_ERR(0, 6182, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stop, __pyx_cur_scope->__pyx_v_stop) < 0) __PYX_ERR(0, 6182, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6181 * workers = set(parent._workers_dv) & set(workers) * * if scheduler: # <<<<<<<<<<<<<< * return profile.get_profile(self.io_loop.profile, start=start, stop=stop) * */ } /* "distributed/scheduler.py":6184 * return profile.get_profile(self.io_loop.profile, start=start, stop=stop) * * results = await asyncio.gather( # <<<<<<<<<<<<<< * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_gather); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6186 * results = await asyncio.gather( * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) # <<<<<<<<<<<<<< * for w in workers * ), */ __pyx_t_6 = __pyx_pf_11distributed_9scheduler_9Scheduler_11get_profile_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "distributed/scheduler.py":6184 * return profile.get_profile(self.io_loop.profile, start=start, stop=stop) * * results = await asyncio.gather( # <<<<<<<<<<<<<< * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) */ __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6189 * for w in workers * ), * return_exceptions=True, # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return_exceptions, Py_True) < 0) __PYX_ERR(0, 6189, __pyx_L1_error) /* "distributed/scheduler.py":6184 * return profile.get_profile(self.io_loop.profile, start=start, stop=stop) * * results = await asyncio.gather( # <<<<<<<<<<<<<< * *( * self.rpc(w).profile(start=start, stop=stop, key=key, server=server) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6184, __pyx_L1_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_4 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(0, 6184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_results = __pyx_t_4; __pyx_t_4 = 0; /* "distributed/scheduler.py":6192 * ) * * results = [r for r in results if not isinstance(r, Exception)] # <<<<<<<<<<<<<< * * if merge_workers: */ { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_results)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_results)) { __pyx_t_6 = __pyx_cur_scope->__pyx_v_results; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_results); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6192, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6192, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6192, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6192, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr136__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr136__pyx_v_r, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyException_Check(__pyx_cur_scope->__pyx_10genexpr136__pyx_v_r); __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_2) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_cur_scope->__pyx_10genexpr136__pyx_v_r))) __PYX_ERR(0, 6192, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_results); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_results, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6194 * results = [r for r in results if not isinstance(r, Exception)] * * if merge_workers: # <<<<<<<<<<<<<< * response = profile.merge(*results) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_merge_workers); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6194, __pyx_L1_error) if (__pyx_t_2) { /* "distributed/scheduler.py":6195 * * if merge_workers: * response = profile.merge(*results) # <<<<<<<<<<<<<< * else: * response = dict(zip(workers, results)) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_profile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_merge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_results); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_response = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":6194 * results = [r for r in results if not isinstance(r, Exception)] * * if merge_workers: # <<<<<<<<<<<<<< * response = profile.merge(*results) * else: */ goto __pyx_L10; } /* "distributed/scheduler.py":6197 * response = profile.merge(*results) * else: * response = dict(zip(workers, results)) # <<<<<<<<<<<<<< * return response * */ /*else*/ { __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_workers); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_results); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_results); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_cur_scope->__pyx_v_results); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_response = __pyx_t_5; __pyx_t_5 = 0; } __pyx_L10:; /* "distributed/scheduler.py":6198 * else: * response = dict(zip(workers, results)) * return response # <<<<<<<<<<<<<< * * async def get_profile_metadata( */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_response); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":6164 * return self._ipython_kernel.get_connection_info() * * async def get_profile( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("get_profile", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_200generator21(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":6200 * return response * * async def get_profile_metadata( # <<<<<<<<<<<<<< * self, * comm=None, */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_199get_profile_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_199get_profile_metadata = {"get_profile_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_199get_profile_metadata, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_199get_profile_metadata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_workers = 0; CYTHON_UNUSED PyObject *__pyx_v_merge_workers = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_stop = 0; PyObject *__pyx_v_profile_cycle_interval = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_profile_metadata (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_workers,&__pyx_n_s_merge_workers,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_profile_cycle_interval,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; /* "distributed/scheduler.py":6202 * async def get_profile_metadata( * self, * comm=None, # <<<<<<<<<<<<<< * workers=None, * merge_workers=True, */ values[1] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":6203 * self, * comm=None, * workers=None, # <<<<<<<<<<<<<< * merge_workers=True, * start=None, */ values[2] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":6204 * comm=None, * workers=None, * merge_workers=True, # <<<<<<<<<<<<<< * start=None, * stop=None, */ values[3] = ((PyObject *)((PyObject *)Py_True)); /* "distributed/scheduler.py":6205 * workers=None, * merge_workers=True, * start=None, # <<<<<<<<<<<<<< * stop=None, * profile_cycle_interval=None, */ values[4] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":6206 * merge_workers=True, * start=None, * stop=None, # <<<<<<<<<<<<<< * profile_cycle_interval=None, * ): */ values[5] = ((PyObject *)((PyObject *)Py_None)); /* "distributed/scheduler.py":6207 * start=None, * stop=None, * profile_cycle_interval=None, # <<<<<<<<<<<<<< * ): * parent: SchedulerState = cast(SchedulerState, self) */ values[6] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_merge_workers); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_profile_cycle_interval); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_profile_metadata") < 0)) __PYX_ERR(0, 6200, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_workers = values[2]; __pyx_v_merge_workers = values[3]; __pyx_v_start = values[4]; __pyx_v_stop = values[5]; __pyx_v_profile_cycle_interval = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_profile_metadata", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6200, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_profile_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_198get_profile_metadata(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_workers, __pyx_v_merge_workers, __pyx_v_start, __pyx_v_stop, __pyx_v_profile_cycle_interval); /* "distributed/scheduler.py":6200 * return response * * async def get_profile_metadata( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_20get_profile_metadata_2generator44(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":6220 * workers = set(parent._workers_dv) & set(workers) * results = await asyncio.gather( * *(self.rpc(w).profile_metadata(start=start, stop=stop) for w in workers), # <<<<<<<<<<<<<< * return_exceptions=True, * ) */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_20get_profile_metadata_genexpr(PyObject *__pyx_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_51_genexpr(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_51_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 6220, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_20get_profile_metadata_2generator44, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Scheduler_get_profile_metadata_l, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_profile_metadata.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_20get_profile_metadata_2generator44(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6220, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers)) { __Pyx_RaiseClosureNameError("workers"); __PYX_ERR(0, 6220, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_workers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6220, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 6220, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 6220, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6220, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_w, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 6220, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_rpc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_w) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_w); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_profile_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_start)) { __Pyx_RaiseClosureNameError("start"); __PYX_ERR(0, 6220, __pyx_L1_error) } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_start, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_start) < 0) __PYX_ERR(0, 6220, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_stop)) { __Pyx_RaiseClosureNameError("stop"); __PYX_ERR(0, 6220, __pyx_L1_error) } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_stop, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_stop) < 0) __PYX_ERR(0, 6220, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6220, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6226 * results = [r for r in results if not isinstance(r, Exception)] * counts = [v["counts"] for v in results] * counts = itertools.groupby(merge_sorted(*counts), lambda t: t[0] // dt * dt) # <<<<<<<<<<<<<< * counts = [(time, sum(pluck(1, group))) for time, group in counts] * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_20get_profile_metadata_3lambda24(PyObject *__pyx_self, PyObject *__pyx_v_t); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_20get_profile_metadata_3lambda24 = {"lambda24", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_20get_profile_metadata_3lambda24, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_20get_profile_metadata_3lambda24(PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda24 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda24(__pyx_self, ((PyObject *)__pyx_v_t)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda24(PyObject *__pyx_self, PyObject *__pyx_v_t) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda24", 0); __pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_t, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(!__pyx_cur_scope->__pyx_v_dt)) { __Pyx_RaiseClosureNameError("dt"); __PYX_ERR(0, 6226, __pyx_L1_error) } __pyx_t_2 = PyNumber_FloorDivide(__pyx_t_1, __pyx_cur_scope->__pyx_v_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_cur_scope->__pyx_v_dt)) { __Pyx_RaiseClosureNameError("dt"); __PYX_ERR(0, 6226, __pyx_L1_error) } __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_cur_scope->__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_profile_metadata.lambda24", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6200 * return response * * async def get_profile_metadata( # <<<<<<<<<<<<<< * self, * comm=None, */ static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_198get_profile_metadata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_workers, CYTHON_UNUSED PyObject *__pyx_v_merge_workers, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_profile_cycle_interval) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_profile_metadata", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 6200, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_workers = __pyx_v_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); __pyx_cur_scope->__pyx_v_merge_workers = __pyx_v_merge_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_merge_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_merge_workers); __pyx_cur_scope->__pyx_v_start = __pyx_v_start; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start); __pyx_cur_scope->__pyx_v_stop = __pyx_v_stop; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stop); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stop); __pyx_cur_scope->__pyx_v_profile_cycle_interval = __pyx_v_profile_cycle_interval; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_profile_cycle_interval); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_profile_cycle_interval); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_200generator21, __pyx_codeobj__88, (PyObject *) __pyx_cur_scope, __pyx_n_s_get_profile_metadata, __pyx_n_s_Scheduler_get_profile_metadata, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 6200, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_profile_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_200generator21(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *(*__pyx_t_12)(PyObject *); Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; PyObject *(*__pyx_t_15)(PyObject *); int __pyx_t_16; int __pyx_t_17; Py_ssize_t __pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_profile_metadata", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L7_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6200, __pyx_L1_error) /* "distributed/scheduler.py":6209 * profile_cycle_interval=None, * ): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * dt = profile_cycle_interval or dask.config.get( * "distributed.worker.profile.cycle" */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6210 * ): * parent: SchedulerState = cast(SchedulerState, self) * dt = profile_cycle_interval or dask.config.get( # <<<<<<<<<<<<<< * "distributed.worker.profile.cycle" * ) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_profile_cycle_interval); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6210, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_profile_cycle_interval); __pyx_t_1 = __pyx_cur_scope->__pyx_v_profile_cycle_interval; goto __pyx_L4_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_dask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_distributed_worker_profile_cycle) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_distributed_worker_profile_cycle); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L4_bool_binop_done:; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_dt = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6213 * "distributed.worker.profile.cycle" * ) * dt = parse_timedelta(dt, default="ms") # <<<<<<<<<<<<<< * * if workers is None: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dt); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dt); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_dt); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_default, __pyx_n_u_ms) < 0) __PYX_ERR(0, 6213, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_dt); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_dt, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6215 * dt = parse_timedelta(dt, default="ms") * * if workers is None: # <<<<<<<<<<<<<< * workers = parent._workers_dv * else: */ __pyx_t_2 = (__pyx_cur_scope->__pyx_v_workers == Py_None); __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { /* "distributed/scheduler.py":6216 * * if workers is None: * workers = parent._workers_dv # <<<<<<<<<<<<<< * else: * workers = set(parent._workers_dv) & set(workers) */ __pyx_t_5 = __pyx_cur_scope->__pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_5); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6215 * dt = parse_timedelta(dt, default="ms") * * if workers is None: # <<<<<<<<<<<<<< * workers = parent._workers_dv * else: */ goto __pyx_L6; } /* "distributed/scheduler.py":6218 * workers = parent._workers_dv * else: * workers = set(parent._workers_dv) & set(workers) # <<<<<<<<<<<<<< * results = await asyncio.gather( * *(self.rpc(w).profile_metadata(start=start, stop=stop) for w in workers), */ /*else*/ { __pyx_t_5 = PySet_New(__pyx_cur_scope->__pyx_v_parent->_workers_dv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PySet_New(__pyx_cur_scope->__pyx_v_workers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_And(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L6:; /* "distributed/scheduler.py":6219 * else: * workers = set(parent._workers_dv) & set(workers) * results = await asyncio.gather( # <<<<<<<<<<<<<< * *(self.rpc(w).profile_metadata(start=start, stop=stop) for w in workers), * return_exceptions=True, */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_gather); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6220 * workers = set(parent._workers_dv) & set(workers) * results = await asyncio.gather( * *(self.rpc(w).profile_metadata(start=start, stop=stop) for w in workers), # <<<<<<<<<<<<<< * return_exceptions=True, * ) */ __pyx_t_3 = __pyx_pf_11distributed_9scheduler_9Scheduler_20get_profile_metadata_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "distributed/scheduler.py":6219 * else: * workers = set(parent._workers_dv) & set(workers) * results = await asyncio.gather( # <<<<<<<<<<<<<< * *(self.rpc(w).profile_metadata(start=start, stop=stop) for w in workers), * return_exceptions=True, */ __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6221 * results = await asyncio.gather( * *(self.rpc(w).profile_metadata(start=start, stop=stop) for w in workers), * return_exceptions=True, # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_exceptions, Py_True) < 0) __PYX_ERR(0, 6221, __pyx_L1_error) /* "distributed/scheduler.py":6219 * else: * workers = set(parent._workers_dv) & set(workers) * results = await asyncio.gather( # <<<<<<<<<<<<<< * *(self.rpc(w).profile_metadata(start=start, stop=stop) for w in workers), * return_exceptions=True, */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6219, __pyx_L1_error) __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_1 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 6219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_results = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6224 * ) * * results = [r for r in results if not isinstance(r, Exception)] # <<<<<<<<<<<<<< * counts = [v["counts"] for v in results] * counts = itertools.groupby(merge_sorted(*counts), lambda t: t[0] // dt * dt) */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_results)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_results)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_results; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_results); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6224, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6224, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6224, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6224, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr138__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr138__pyx_v_r, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyException_Check(__pyx_cur_scope->__pyx_10genexpr138__pyx_v_r); __pyx_t_2 = ((!(__pyx_t_6 != 0)) != 0); if (__pyx_t_2) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_10genexpr138__pyx_v_r))) __PYX_ERR(0, 6224, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_results); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_results, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6225 * * results = [r for r in results if not isinstance(r, Exception)] * counts = [v["counts"] for v in results] # <<<<<<<<<<<<<< * counts = itertools.groupby(merge_sorted(*counts), lambda t: t[0] // dt * dt) * counts = [(time, sum(pluck(1, group))) for time, group in counts] */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_results)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_results)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_results; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_results); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6225, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6225, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6225, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6225, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr139__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr139__pyx_v_v, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_10genexpr139__pyx_v_v, __pyx_n_u_counts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 6225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_counts = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6226 * results = [r for r in results if not isinstance(r, Exception)] * counts = [v["counts"] for v in results] * counts = itertools.groupby(merge_sorted(*counts), lambda t: t[0] // dt * dt) # <<<<<<<<<<<<<< * counts = [(time, sum(pluck(1, group))) for time, group in counts] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_itertools); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_groupby); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_merge_sorted); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_counts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_20get_profile_metadata_3lambda24, 0, __pyx_n_s_Scheduler_get_profile_metadata_l_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_distributed_scheduler, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_9, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_9, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4); __pyx_t_9 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_counts); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_counts, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6227 * counts = [v["counts"] for v in results] * counts = itertools.groupby(merge_sorted(*counts), lambda t: t[0] // dt * dt) * counts = [(time, sum(pluck(1, group))) for time, group in counts] # <<<<<<<<<<<<<< * * keys = set() */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_counts)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_counts)) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_counts; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_counts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6227, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_11 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_11); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6227, __pyx_L1_error) #else __pyx_t_11 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_11); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6227, __pyx_L1_error) #else __pyx_t_11 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } } else { __pyx_t_11 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_11)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6227, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_11); } if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { PyObject* sequence = __pyx_t_11; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6227, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_12(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_3); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_3), 2) < 0) __PYX_ERR(0, 6227, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 6227, __pyx_L1_error) __pyx_L16_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr140__pyx_v_time); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr140__pyx_v_time, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr140__pyx_v_group); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr140__pyx_v_group, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pluck); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_int_1, __pyx_cur_scope->__pyx_10genexpr140__pyx_v_group}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_int_1, __pyx_cur_scope->__pyx_10genexpr140__pyx_v_group}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, __pyx_int_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_10genexpr140__pyx_v_group); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_10genexpr140__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_cur_scope->__pyx_10genexpr140__pyx_v_group); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_10genexpr140__pyx_v_time); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_10genexpr140__pyx_v_time); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_10genexpr140__pyx_v_time); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9); __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 6227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_counts); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_counts, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6229 * counts = [(time, sum(pluck(1, group))) for time, group in counts] * * keys = set() # <<<<<<<<<<<<<< * for v in results: * for t, d in v["keys"]: */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_keys = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6230 * * keys = set() * for v in results: # <<<<<<<<<<<<<< * for t, d in v["keys"]: * for k in d: */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_results; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6230, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6231 * keys = set() * for v in results: * for t, d in v["keys"]: # <<<<<<<<<<<<<< * for k in d: * keys.add(k) */ __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_v, __pyx_n_u_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_11 = __pyx_t_5; __Pyx_INCREF(__pyx_t_11); __pyx_t_13 = 0; __pyx_t_8 = NULL; } else { __pyx_t_13 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6231, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_11))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6231, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6231, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6231, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6231, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_9)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_4), 2) < 0) __PYX_ERR(0, 6231, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L22_unpacking_done; __pyx_L21_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 6231, __pyx_L1_error) __pyx_L22_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_d); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6232 * for v in results: * for t, d in v["keys"]: * for k in d: # <<<<<<<<<<<<<< * keys.add(k) * keys = {k: [] for k in keys} */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_d)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_d)) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_d; __Pyx_INCREF(__pyx_t_5); __pyx_t_14 = 0; __pyx_t_15 = NULL; } else { __pyx_t_14 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 6232, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 6232, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 6232, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6232, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6233 * for t, d in v["keys"]: * for k in d: * keys.add(k) # <<<<<<<<<<<<<< * keys = {k: [] for k in keys} * */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_keys, __pyx_n_s_add); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_4, __pyx_cur_scope->__pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6232 * for v in results: * for t, d in v["keys"]: * for k in d: # <<<<<<<<<<<<<< * keys.add(k) * keys = {k: [] for k in keys} */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6231 * keys = set() * for v in results: * for t, d in v["keys"]: # <<<<<<<<<<<<<< * for k in d: * keys.add(k) */ } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":6230 * * keys = set() * for v in results: # <<<<<<<<<<<<<< * for t, d in v["keys"]: * for k in d: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6234 * for k in d: * keys.add(k) * keys = {k: [] for k in keys} # <<<<<<<<<<<<<< * * groups1 = [v["keys"] for v in results] */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) { __pyx_t_11 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_11); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6234, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_11))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6234, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6234, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6234, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr141__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr141__pyx_v_k, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_cur_scope->__pyx_10genexpr141__pyx_v_k, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 6234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } /* exit inner scope */ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_keys); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_keys, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6236 * keys = {k: [] for k in keys} * * groups1 = [v["keys"] for v in results] # <<<<<<<<<<<<<< * groups2 = list(merge_sorted(*groups1, key=first)) * */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_results)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_results)) { __pyx_t_11 = __pyx_cur_scope->__pyx_v_results; __Pyx_INCREF(__pyx_t_11); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_results); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6236, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_11))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6236, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6236, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6236, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_10genexpr142__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr142__pyx_v_v, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_10genexpr142__pyx_v_v, __pyx_n_u_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 6236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_groups1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6237 * * groups1 = [v["keys"] for v in results] * groups2 = list(merge_sorted(*groups1, key=first)) # <<<<<<<<<<<<<< * * last = 0 */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_merge_sorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_groups1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_first); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 6237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_groups2 = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6239 * groups2 = list(merge_sorted(*groups1, key=first)) * * last = 0 # <<<<<<<<<<<<<< * for t, d in groups2: * tt = t // dt * dt */ __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __pyx_cur_scope->__pyx_v_last = __pyx_int_0; /* "distributed/scheduler.py":6240 * * last = 0 * for t, d in groups2: # <<<<<<<<<<<<<< * tt = t // dt * dt * if tt > last: */ __pyx_t_5 = __pyx_cur_scope->__pyx_v_groups2; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 6240, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6240, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_11 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_11 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L31_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 1; __pyx_t_1 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L31_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_9), 2) < 0) __PYX_ERR(0, 6240, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L32_unpacking_done; __pyx_L31_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 6240, __pyx_L1_error) __pyx_L32_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_d); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6241 * last = 0 * for t, d in groups2: * tt = t // dt * dt # <<<<<<<<<<<<<< * if tt > last: * last = tt */ __pyx_t_3 = PyNumber_FloorDivide(__pyx_cur_scope->__pyx_v_t, __pyx_cur_scope->__pyx_v_dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tt); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tt, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6242 * for t, d in groups2: * tt = t // dt * dt * if tt > last: # <<<<<<<<<<<<<< * last = tt * for k, v in keys.items(): */ __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_tt, __pyx_cur_scope->__pyx_v_last, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6242, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":6243 * tt = t // dt * dt * if tt > last: * last = tt # <<<<<<<<<<<<<< * for k, v in keys.items(): * v.append([tt, 0]) */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tt); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_last); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_last, __pyx_cur_scope->__pyx_v_tt); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tt); /* "distributed/scheduler.py":6244 * if tt > last: * last = tt * for k, v in keys.items(): # <<<<<<<<<<<<<< * v.append([tt, 0]) * for k, v in d.items(): */ __pyx_t_13 = 0; __pyx_t_3 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_keys, 1, __pyx_n_s_items, (&__pyx_t_14), (&__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_14, &__pyx_t_13, &__pyx_t_3, &__pyx_t_11, NULL, __pyx_t_10); if (unlikely(__pyx_t_16 == 0)) break; if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 6244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; /* "distributed/scheduler.py":6245 * last = tt * for k, v in keys.items(): * v.append([tt, 0]) # <<<<<<<<<<<<<< * for k, v in d.items(): * keys[k][-1][1] += v */ __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tt); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tt); PyList_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_tt); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_11, 1, __pyx_int_0); __pyx_t_17 = __Pyx_PyObject_Append(__pyx_cur_scope->__pyx_v_v, __pyx_t_11); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 6245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6242 * for t, d in groups2: * tt = t // dt * dt * if tt > last: # <<<<<<<<<<<<<< * last = tt * for k, v in keys.items(): */ } /* "distributed/scheduler.py":6246 * for k, v in keys.items(): * v.append([tt, 0]) * for k, v in d.items(): # <<<<<<<<<<<<<< * keys[k][-1][1] += v * */ __pyx_t_14 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_d == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 6246, __pyx_L1_error) } __pyx_t_11 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_d, 0, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_13, &__pyx_t_14, &__pyx_t_11, &__pyx_t_3, NULL, __pyx_t_10); if (unlikely(__pyx_t_16 == 0)) break; if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 6246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6247 * v.append([tt, 0]) * for k, v in d.items(): * keys[k][-1][1] += v # <<<<<<<<<<<<<< * * return {"counts": counts, "keys": keys} */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_keys, __pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_18 = 1; __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_11, __pyx_t_18, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_t_11, __pyx_t_18, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 6247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6240 * * last = 0 * for t, d in groups2: # <<<<<<<<<<<<<< * tt = t // dt * dt * if tt > last: */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6249 * keys[k][-1][1] += v * * return {"counts": counts, "keys": keys} # <<<<<<<<<<<<<< * * async def performance_report(self, comm=None, start=None, code=""): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_counts, __pyx_cur_scope->__pyx_v_counts) < 0) __PYX_ERR(0, 6249, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_keys, __pyx_cur_scope->__pyx_v_keys) < 0) __PYX_ERR(0, 6249, __pyx_L1_error) __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":6200 * return response * * async def get_profile_metadata( # <<<<<<<<<<<<<< * self, * comm=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("get_profile_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_203generator22(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":6251 * return {"counts": counts, "keys": keys} * * async def performance_report(self, comm=None, start=None, code=""): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * stop = time() */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_202performance_report(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_202performance_report = {"performance_report", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_202performance_report, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_202performance_report(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_code = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("performance_report (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_start,&__pyx_n_s_code,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject*)__pyx_kp_u__50)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_code); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "performance_report") < 0)) __PYX_ERR(0, 6251, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_start = values[2]; __pyx_v_code = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("performance_report", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6251, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.performance_report", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_201performance_report(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_start, __pyx_v_code); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_201performance_report(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_start, PyObject *__pyx_v_code) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("performance_report", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_52_performance_report(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_52_performance_report, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 6251, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_start = __pyx_v_start; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start); __pyx_cur_scope->__pyx_v_code = __pyx_v_code; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_code); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_203generator22, __pyx_codeobj__89, (PyObject *) __pyx_cur_scope, __pyx_n_s_performance_report, __pyx_n_s_Scheduler_performance_report, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 6251, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.performance_report", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6264 * from . import profile * * def profile_to_figure(state): # <<<<<<<<<<<<<< * data = profile.plot_data(state) * figure, source = profile.plot_figure(data, sizing_mode="stretch_both") */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_18performance_report_1profile_to_figure(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_18performance_report_1profile_to_figure = {"profile_to_figure", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_18performance_report_1profile_to_figure, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_18performance_report_1profile_to_figure(PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("profile_to_figure (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_18performance_report_profile_to_figure(__pyx_self, ((PyObject *)__pyx_v_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_18performance_report_profile_to_figure(PyObject *__pyx_self, PyObject *__pyx_v_state) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *__pyx_cur_scope; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *__pyx_outer_scope; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_figure = NULL; CYTHON_UNUSED PyObject *__pyx_v_source = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("profile_to_figure", 0); __pyx_outer_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "distributed/scheduler.py":6265 * * def profile_to_figure(state): * data = profile.plot_data(state) # <<<<<<<<<<<<<< * figure, source = profile.plot_figure(data, sizing_mode="stretch_both") * return figure */ if (unlikely(!__pyx_cur_scope->__pyx_v_profile)) { __Pyx_RaiseClosureNameError("profile"); __PYX_ERR(0, 6265, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_profile, __pyx_n_s_plot_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_state) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_state); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6266 * def profile_to_figure(state): * data = profile.plot_data(state) * figure, source = profile.plot_figure(data, sizing_mode="stretch_both") # <<<<<<<<<<<<<< * return figure * */ if (unlikely(!__pyx_cur_scope->__pyx_v_profile)) { __Pyx_RaiseClosureNameError("profile"); __PYX_ERR(0, 6266, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_profile, __pyx_n_s_plot_figure); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sizing_mode, __pyx_n_u_stretch_both) < 0) __PYX_ERR(0, 6266, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6266, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_1), 2) < 0) __PYX_ERR(0, 6266, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 6266, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_figure = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_source = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":6267 * data = profile.plot_data(state) * figure, source = profile.plot_figure(data, sizing_mode="stretch_both") * return figure # <<<<<<<<<<<<<< * * compute, scheduler, workers = map( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_figure); __pyx_r = __pyx_v_figure; goto __pyx_L0; /* "distributed/scheduler.py":6264 * from . import profile * * def profile_to_figure(state): # <<<<<<<<<<<<<< * data = profile.plot_data(state) * figure, source = profile.plot_figure(data, sizing_mode="stretch_both") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler.Scheduler.performance_report.profile_to_figure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_figure); __Pyx_XDECREF(__pyx_v_source); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6251 * return {"counts": counts, "keys": keys} * * async def performance_report(self, comm=None, start=None, code=""): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * stop = time() */ static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_203generator22(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; Py_ssize_t __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; int __pyx_t_14; Py_UCS4 __pyx_t_15; int __pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; int __pyx_t_27; int __pyx_t_28; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("performance_report", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L4_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6251, __pyx_L1_error) /* "distributed/scheduler.py":6252 * * async def performance_report(self, comm=None, start=None, code=""): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * stop = time() * # Profiles */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6253 * async def performance_report(self, comm=None, start=None, code=""): * parent: SchedulerState = cast(SchedulerState, self) * stop = time() # <<<<<<<<<<<<<< * # Profiles * compute, scheduler, workers = await asyncio.gather( */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_stop = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6255 * stop = time() * # Profiles * compute, scheduler, workers = await asyncio.gather( # <<<<<<<<<<<<<< * *[ * self.get_profile(start=start), */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_gather); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6257 * compute, scheduler, workers = await asyncio.gather( * *[ * self.get_profile(start=start), # <<<<<<<<<<<<<< * self.get_profile(scheduler=True, start=start), * self.get_profile(server=True, start=start), */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_get_profile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_start, __pyx_cur_scope->__pyx_v_start) < 0) __PYX_ERR(0, 6257, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6258 * *[ * self.get_profile(start=start), * self.get_profile(scheduler=True, start=start), # <<<<<<<<<<<<<< * self.get_profile(server=True, start=start), * ] */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_get_profile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scheduler, Py_True) < 0) __PYX_ERR(0, 6258, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_start, __pyx_cur_scope->__pyx_v_start) < 0) __PYX_ERR(0, 6258, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6259 * self.get_profile(start=start), * self.get_profile(scheduler=True, start=start), * self.get_profile(server=True, start=start), # <<<<<<<<<<<<<< * ] * ) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_get_profile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_server, Py_True) < 0) __PYX_ERR(0, 6259, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_start, __pyx_cur_scope->__pyx_v_start) < 0) __PYX_ERR(0, 6259, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6256 * # Profiles * compute, scheduler, workers = await asyncio.gather( * *[ # <<<<<<<<<<<<<< * self.get_profile(start=start), * self.get_profile(scheduler=True, start=start), */ __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; /* "distributed/scheduler.py":6255 * stop = time() * # Profiles * compute, scheduler, workers = await asyncio.gather( # <<<<<<<<<<<<<< * *[ * self.get_profile(start=start), */ __pyx_t_6 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6255, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6255, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) __PYX_ERR(0, 6255, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 6255, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_compute = __pyx_t_6; __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_scheduler = __pyx_t_2; __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_workers = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":6262 * ] * ) * from . import profile # <<<<<<<<<<<<<< * * def profile_to_figure(state): */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_profile); __Pyx_GIVEREF(__pyx_n_s_profile); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_profile); __pyx_t_5 = __Pyx_Import(__pyx_n_s__50, __pyx_t_3, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_profile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_profile = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6264 * from . import profile * * def profile_to_figure(state): # <<<<<<<<<<<<<< * data = profile.plot_data(state) * figure, source = profile.plot_figure(data, sizing_mode="stretch_both") */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_18performance_report_1profile_to_figure, 0, __pyx_n_s_Scheduler_performance_report_loc, ((PyObject*)__pyx_cur_scope), __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_profile_to_figure = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":6270 * * compute, scheduler, workers = map( * profile_to_figure, (compute, scheduler, workers) # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_compute); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_compute); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_compute); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_scheduler); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_scheduler); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_cur_scope->__pyx_v_scheduler); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_cur_scope->__pyx_v_workers); /* "distributed/scheduler.py":6269 * return figure * * compute, scheduler, workers = map( # <<<<<<<<<<<<<< * profile_to_figure, (compute, scheduler, workers) * ) */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_profile_to_figure); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_profile_to_figure); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_profile_to_figure); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6269, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) __PYX_ERR(0, 6269, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 6269, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_compute); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_compute, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_scheduler); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_scheduler, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6274 * * # Task stream * task_stream = self.get_task_stream(start=start) # <<<<<<<<<<<<<< * total_tasks = len(task_stream) * timespent = defaultdict(int) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_get_task_stream); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_start, __pyx_cur_scope->__pyx_v_start) < 0) __PYX_ERR(0, 6274, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_task_stream = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":6275 * # Task stream * task_stream = self.get_task_stream(start=start) * total_tasks = len(task_stream) # <<<<<<<<<<<<<< * timespent = defaultdict(int) * for d in task_stream: */ __pyx_t_8 = PyObject_Length(__pyx_cur_scope->__pyx_v_task_stream); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6275, __pyx_L1_error) __pyx_cur_scope->__pyx_v_total_tasks = __pyx_t_8; /* "distributed/scheduler.py":6276 * task_stream = self.get_task_stream(start=start) * total_tasks = len(task_stream) * timespent = defaultdict(int) # <<<<<<<<<<<<<< * for d in task_stream: * for x in d.get("startstops", []): */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, ((PyObject *)(&PyInt_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)(&PyInt_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_timespent = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":6277 * total_tasks = len(task_stream) * timespent = defaultdict(int) * for d in task_stream: # <<<<<<<<<<<<<< * for x in d.get("startstops", []): * timespent[x["action"]] += x["stop"] - x["start"] */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_task_stream)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_task_stream)) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_task_stream; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_task_stream); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6277, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 6277, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 6277, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6277, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_d); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6278 * timespent = defaultdict(int) * for d in task_stream: * for x in d.get("startstops", []): # <<<<<<<<<<<<<< * timespent[x["action"]] += x["stop"] - x["start"] * tasks_timings = "" */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_d, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_startstops, __pyx_t_3}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_startstops, __pyx_t_3}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_1 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_n_u_startstops); __Pyx_GIVEREF(__pyx_n_u_startstops); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_10, __pyx_n_u_startstops); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_10, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6278, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 6278, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 6278, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_12(__pyx_t_5); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6278, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6279 * for d in task_stream: * for x in d.get("startstops", []): * timespent[x["action"]] += x["stop"] - x["start"] # <<<<<<<<<<<<<< * tasks_timings = "" * for k in sorted(timespent.keys()): */ __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_x, __pyx_n_u_action); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_timespent, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_x, __pyx_n_u_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_x, __pyx_n_u_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(PyObject_SetItem(__pyx_cur_scope->__pyx_v_timespent, __pyx_t_6, __pyx_t_4) < 0)) __PYX_ERR(0, 6279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6278 * timespent = defaultdict(int) * for d in task_stream: * for x in d.get("startstops", []): # <<<<<<<<<<<<<< * timespent[x["action"]] += x["stop"] - x["start"] * tasks_timings = "" */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6277 * total_tasks = len(task_stream) * timespent = defaultdict(int) * for d in task_stream: # <<<<<<<<<<<<<< * for x in d.get("startstops", []): * timespent[x["action"]] += x["stop"] - x["start"] */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6280 * for x in d.get("startstops", []): * timespent[x["action"]] += x["stop"] - x["start"] * tasks_timings = "" # <<<<<<<<<<<<<< * for k in sorted(timespent.keys()): * tasks_timings += f"\n
  • {k} time: {format_time(timespent[k])}
  • " */ __Pyx_INCREF(__pyx_kp_u__50); __Pyx_GIVEREF(__pyx_kp_u__50); __pyx_cur_scope->__pyx_v_tasks_timings = __pyx_kp_u__50; /* "distributed/scheduler.py":6281 * timespent[x["action"]] += x["stop"] - x["start"] * tasks_timings = "" * for k in sorted(timespent.keys()): # <<<<<<<<<<<<<< * tasks_timings += f"\n
  • {k} time: {format_time(timespent[k])}
  • " * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timespent, __pyx_n_s_keys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_14 = PyList_Sort(__pyx_t_2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 6281, __pyx_L1_error) if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6281, __pyx_L1_error) } __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 6281, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6282 * tasks_timings = "" * for k in sorted(timespent.keys()): * tasks_timings += f"\n
  • {k} time: {format_time(timespent[k])}
  • " # <<<<<<<<<<<<<< * * from .diagnostics.task_stream import rectangles */ __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = 0; __pyx_t_15 = 127; __Pyx_INCREF(__pyx_kp_u_li); __pyx_t_11 += 6; __Pyx_GIVEREF(__pyx_kp_u_li); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_li); __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_k, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_15; __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_kp_u_time_2); __pyx_t_11 += 7; __Pyx_GIVEREF(__pyx_kp_u_time_2); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_time_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_format_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_timespent, __pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_13); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_15; __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_li_2); __pyx_t_11 += 6; __Pyx_GIVEREF(__pyx_kp_u_li_2); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_li_2); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_11, __pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_cur_scope->__pyx_v_tasks_timings, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_tasks_timings); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_tasks_timings, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6281 * timespent[x["action"]] += x["stop"] - x["start"] * tasks_timings = "" * for k in sorted(timespent.keys()): # <<<<<<<<<<<<<< * tasks_timings += f"\n
  • {k} time: {format_time(timespent[k])}
  • " * */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6284 * tasks_timings += f"\n
  • {k} time: {format_time(timespent[k])}
  • " * * from .diagnostics.task_stream import rectangles # <<<<<<<<<<<<<< * from .dashboard.components.scheduler import task_stream_figure * */ __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_n_s_rectangles); __Pyx_GIVEREF(__pyx_n_s_rectangles); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_rectangles); __pyx_t_2 = __Pyx_Import(__pyx_n_s_diagnostics_task_stream, __pyx_t_6, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_rectangles); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_rectangles = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6285 * * from .diagnostics.task_stream import rectangles * from .dashboard.components.scheduler import task_stream_figure # <<<<<<<<<<<<<< * * rects = rectangles(task_stream) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_task_stream_figure); __Pyx_GIVEREF(__pyx_n_s_task_stream_figure); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_task_stream_figure); __pyx_t_6 = __Pyx_Import(__pyx_n_s_dashboard_components_scheduler, __pyx_t_2, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_task_stream_figure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_task_stream_figure = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6287 * from .dashboard.components.scheduler import task_stream_figure * * rects = rectangles(task_stream) # <<<<<<<<<<<<<< * source, task_stream = task_stream_figure(sizing_mode="stretch_both") * source.data.update(rects) */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_rectangles); __pyx_t_2 = __pyx_cur_scope->__pyx_v_rectangles; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_cur_scope->__pyx_v_task_stream) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_task_stream); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_rects = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6288 * * rects = rectangles(task_stream) * source, task_stream = task_stream_figure(sizing_mode="stretch_both") # <<<<<<<<<<<<<< * source.data.update(rects) * */ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_sizing_mode, __pyx_n_u_stretch_both) < 0) __PYX_ERR(0, 6288, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_task_stream_figure, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 6288, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_5), 2) < 0) __PYX_ERR(0, 6288, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 6288, __pyx_L1_error) __pyx_L16_unpacking_done:; } __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_source = __pyx_t_6; __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_task_stream); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_task_stream, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6289 * rects = rectangles(task_stream) * source, task_stream = task_stream_figure(sizing_mode="stretch_both") * source.data.update(rects) # <<<<<<<<<<<<<< * * from distributed.dashboard.components.scheduler import ( */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_source, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_cur_scope->__pyx_v_rects) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_rects); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6292 * * from distributed.dashboard.components.scheduler import ( * BandwidthWorkers, # <<<<<<<<<<<<<< * BandwidthTypes, * ) */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_BandwidthWorkers); __Pyx_GIVEREF(__pyx_n_s_BandwidthWorkers); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BandwidthWorkers); __Pyx_INCREF(__pyx_n_s_BandwidthTypes); __Pyx_GIVEREF(__pyx_n_s_BandwidthTypes); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_BandwidthTypes); /* "distributed/scheduler.py":6291 * source.data.update(rects) * * from distributed.dashboard.components.scheduler import ( # <<<<<<<<<<<<<< * BandwidthWorkers, * BandwidthTypes, */ __pyx_t_6 = __Pyx_Import(__pyx_n_s_distributed_dashboard_components, __pyx_t_2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_BandwidthWorkers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_BandwidthWorkers = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_BandwidthTypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_BandwidthTypes = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6296 * ) * * bandwidth_workers = BandwidthWorkers(self, sizing_mode="stretch_both") # <<<<<<<<<<<<<< * bandwidth_workers.update() * bandwidth_types = BandwidthTypes(self, sizing_mode="stretch_both") */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_self); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sizing_mode, __pyx_n_u_stretch_both) < 0) __PYX_ERR(0, 6296, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_BandwidthWorkers, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_bandwidth_workers = __pyx_t_4; __pyx_t_4 = 0; /* "distributed/scheduler.py":6297 * * bandwidth_workers = BandwidthWorkers(self, sizing_mode="stretch_both") * bandwidth_workers.update() # <<<<<<<<<<<<<< * bandwidth_types = BandwidthTypes(self, sizing_mode="stretch_both") * bandwidth_types.update() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_bandwidth_workers, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6298 * bandwidth_workers = BandwidthWorkers(self, sizing_mode="stretch_both") * bandwidth_workers.update() * bandwidth_types = BandwidthTypes(self, sizing_mode="stretch_both") # <<<<<<<<<<<<<< * bandwidth_types.update() * */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_self); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sizing_mode, __pyx_n_u_stretch_both) < 0) __PYX_ERR(0, 6298, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_BandwidthTypes, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_bandwidth_types = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6299 * bandwidth_workers.update() * bandwidth_types = BandwidthTypes(self, sizing_mode="stretch_both") * bandwidth_types.update() # <<<<<<<<<<<<<< * * from bokeh.models import Panel, Tabs, Div */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_bandwidth_types, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6301 * bandwidth_types.update() * * from bokeh.models import Panel, Tabs, Div # <<<<<<<<<<<<<< * import distributed * */ __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_n_s_Panel); __Pyx_GIVEREF(__pyx_n_s_Panel); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_Panel); __Pyx_INCREF(__pyx_n_s_Tabs); __Pyx_GIVEREF(__pyx_n_s_Tabs); PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_Tabs); __Pyx_INCREF(__pyx_n_s_Div); __Pyx_GIVEREF(__pyx_n_s_Div); PyList_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_Div); __pyx_t_2 = __Pyx_Import(__pyx_n_s_bokeh_models, __pyx_t_6, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Panel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_Panel = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Tabs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_Tabs = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_Div = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6302 * * from bokeh.models import Panel, Tabs, Div * import distributed # <<<<<<<<<<<<<< * * # HTML */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_distributed, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_distributed = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":6332 * {code} * * """.format( # <<<<<<<<<<<<<< * time=format_time(stop - start), * ntasks=total_tasks, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_h1_Dask_Performance_Report_h1_i, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":6333 * * """.format( * time=format_time(stop - start), # <<<<<<<<<<<<<< * ntasks=total_tasks, * tasks_timings=tasks_timings, */ __pyx_t_6 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_format_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop, __pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_13); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_time, __pyx_t_4) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6334 * """.format( * time=format_time(stop - start), * ntasks=total_tasks, # <<<<<<<<<<<<<< * tasks_timings=tasks_timings, * address=self.address, */ __pyx_t_4 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_total_tasks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_ntasks, __pyx_t_4) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6335 * time=format_time(stop - start), * ntasks=total_tasks, * tasks_timings=tasks_timings, # <<<<<<<<<<<<<< * address=self.address, * nworkers=len(parent._workers_dv), */ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tasks_timings, __pyx_cur_scope->__pyx_v_tasks_timings) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) /* "distributed/scheduler.py":6336 * ntasks=total_tasks, * tasks_timings=tasks_timings, * address=self.address, # <<<<<<<<<<<<<< * nworkers=len(parent._workers_dv), * threads=sum([ws._nthreads for ws in parent._workers_dv.values()]), */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_address, __pyx_t_4) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6337 * tasks_timings=tasks_timings, * address=self.address, * nworkers=len(parent._workers_dv), # <<<<<<<<<<<<<< * threads=sum([ws._nthreads for ws in parent._workers_dv.values()]), * memory=format_bytes( */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_4); if (unlikely(__pyx_t_4 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 6337, __pyx_L1_error) } __pyx_t_8 = PyDict_Size(__pyx_t_4); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_nworkers, __pyx_t_4) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6338 * address=self.address, * nworkers=len(parent._workers_dv), * threads=sum([ws._nthreads for ws in parent._workers_dv.values()]), # <<<<<<<<<<<<<< * memory=format_bytes( * sum([ws._memory_limit for ws in parent._workers_dv.values()]) */ { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 6338, __pyx_L1_error) } __pyx_t_13 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, __pyx_n_s_values, (&__pyx_t_11), (&__pyx_t_10)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_13; __pyx_t_13 = 0; while (1) { __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_11, &__pyx_t_8, NULL, &__pyx_t_13, NULL, __pyx_t_10); if (unlikely(__pyx_t_16 == 0)) break; if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 6338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6338, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_10genexpr143__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr143__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_10genexpr143__pyx_v_ws->_nthreads); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 6338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* exit inner scope */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_threads, __pyx_t_5) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6339 * nworkers=len(parent._workers_dv), * threads=sum([ws._nthreads for ws in parent._workers_dv.values()]), * memory=format_bytes( # <<<<<<<<<<<<<< * sum([ws._memory_limit for ws in parent._workers_dv.values()]) * ), */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_format_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":6340 * threads=sum([ws._nthreads for ws in parent._workers_dv.values()]), * memory=format_bytes( * sum([ws._memory_limit for ws in parent._workers_dv.values()]) # <<<<<<<<<<<<<< * ), * code=code, */ { /* enter inner scope */ __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 6340, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, __pyx_n_s_values, (&__pyx_t_8), (&__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_11, NULL, &__pyx_t_3, NULL, __pyx_t_10); if (unlikely(__pyx_t_16 == 0)) break; if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 6340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6340, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_10genexpr144__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_10genexpr144__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_10genexpr144__pyx_v_ws->_memory_limit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 6340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* exit inner scope */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_13, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_memory_2, __pyx_t_5) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6342 * sum([ws._memory_limit for ws in parent._workers_dv.values()]) * ), * code=code, # <<<<<<<<<<<<<< * dask_version=dask.__version__, * distributed_version=distributed.__version__, */ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_code, __pyx_cur_scope->__pyx_v_code) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) /* "distributed/scheduler.py":6343 * ), * code=code, * dask_version=dask.__version__, # <<<<<<<<<<<<<< * distributed_version=distributed.__version__, * ) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_dask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_version); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dask_version, __pyx_t_4) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6344 * code=code, * dask_version=dask.__version__, * distributed_version=distributed.__version__, # <<<<<<<<<<<<<< * ) * html = Div(text=html) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distributed, __pyx_n_s_version); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_distributed_version, __pyx_t_4) < 0) __PYX_ERR(0, 6333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6332 * {code} * * """.format( # <<<<<<<<<<<<<< * time=format_time(stop - start), * ntasks=total_tasks, */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_html = __pyx_t_4; __pyx_t_4 = 0; /* "distributed/scheduler.py":6346 * distributed_version=distributed.__version__, * ) * html = Div(text=html) # <<<<<<<<<<<<<< * * html = Panel(child=html, title="Summary") */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_text, __pyx_cur_scope->__pyx_v_html) < 0) __PYX_ERR(0, 6346, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Div, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_html); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_html, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6348 * html = Div(text=html) * * html = Panel(child=html, title="Summary") # <<<<<<<<<<<<<< * compute = Panel(child=compute, title="Worker Profile (compute)") * workers = Panel(child=workers, title="Worker Profile (administrative)") */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_child, __pyx_cur_scope->__pyx_v_html) < 0) __PYX_ERR(0, 6348, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_title, __pyx_n_u_Summary) < 0) __PYX_ERR(0, 6348, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Panel, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_html); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_html, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6349 * * html = Panel(child=html, title="Summary") * compute = Panel(child=compute, title="Worker Profile (compute)") # <<<<<<<<<<<<<< * workers = Panel(child=workers, title="Worker Profile (administrative)") * scheduler = Panel(child=scheduler, title="Scheduler Profile (administrative)") */ __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_child, __pyx_cur_scope->__pyx_v_compute) < 0) __PYX_ERR(0, 6349, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_title, __pyx_kp_u_Worker_Profile_compute) < 0) __PYX_ERR(0, 6349, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Panel, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_compute); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_compute, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6350 * html = Panel(child=html, title="Summary") * compute = Panel(child=compute, title="Worker Profile (compute)") * workers = Panel(child=workers, title="Worker Profile (administrative)") # <<<<<<<<<<<<<< * scheduler = Panel(child=scheduler, title="Scheduler Profile (administrative)") * task_stream = Panel(child=task_stream, title="Task Stream") */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_child, __pyx_cur_scope->__pyx_v_workers) < 0) __PYX_ERR(0, 6350, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_title, __pyx_kp_u_Worker_Profile_administrative) < 0) __PYX_ERR(0, 6350, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Panel, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_workers, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6351 * compute = Panel(child=compute, title="Worker Profile (compute)") * workers = Panel(child=workers, title="Worker Profile (administrative)") * scheduler = Panel(child=scheduler, title="Scheduler Profile (administrative)") # <<<<<<<<<<<<<< * task_stream = Panel(child=task_stream, title="Task Stream") * bandwidth_workers = Panel( */ __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_child, __pyx_cur_scope->__pyx_v_scheduler) < 0) __PYX_ERR(0, 6351, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_title, __pyx_kp_u_Scheduler_Profile_administrative) < 0) __PYX_ERR(0, 6351, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Panel, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_scheduler); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_scheduler, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6352 * workers = Panel(child=workers, title="Worker Profile (administrative)") * scheduler = Panel(child=scheduler, title="Scheduler Profile (administrative)") * task_stream = Panel(child=task_stream, title="Task Stream") # <<<<<<<<<<<<<< * bandwidth_workers = Panel( * child=bandwidth_workers.fig, title="Bandwidth (Workers)" */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_child, __pyx_cur_scope->__pyx_v_task_stream) < 0) __PYX_ERR(0, 6352, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_title, __pyx_kp_u_Task_Stream) < 0) __PYX_ERR(0, 6352, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Panel, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_task_stream); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_task_stream, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6354 * task_stream = Panel(child=task_stream, title="Task Stream") * bandwidth_workers = Panel( * child=bandwidth_workers.fig, title="Bandwidth (Workers)" # <<<<<<<<<<<<<< * ) * bandwidth_types = Panel(child=bandwidth_types.fig, title="Bandwidth (Types)") */ __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_bandwidth_workers, __pyx_n_s_fig); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_child, __pyx_t_6) < 0) __PYX_ERR(0, 6354, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_title, __pyx_kp_u_Bandwidth_Workers) < 0) __PYX_ERR(0, 6354, __pyx_L1_error) /* "distributed/scheduler.py":6353 * scheduler = Panel(child=scheduler, title="Scheduler Profile (administrative)") * task_stream = Panel(child=task_stream, title="Task Stream") * bandwidth_workers = Panel( # <<<<<<<<<<<<<< * child=bandwidth_workers.fig, title="Bandwidth (Workers)" * ) */ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Panel, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bandwidth_workers); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_bandwidth_workers, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6356 * child=bandwidth_workers.fig, title="Bandwidth (Workers)" * ) * bandwidth_types = Panel(child=bandwidth_types.fig, title="Bandwidth (Types)") # <<<<<<<<<<<<<< * * tabs = Tabs( */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_bandwidth_types, __pyx_n_s_fig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_child, __pyx_t_4) < 0) __PYX_ERR(0, 6356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_title, __pyx_kp_u_Bandwidth_Types) < 0) __PYX_ERR(0, 6356, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Panel, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bandwidth_types); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_bandwidth_types, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6359 * * tabs = Tabs( * tabs=[ # <<<<<<<<<<<<<< * html, * task_stream, */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":6366 * scheduler, * bandwidth_workers, * bandwidth_types, # <<<<<<<<<<<<<< * ] * ) */ __pyx_t_6 = PyList_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_html); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_html); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_html); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_task_stream); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_task_stream); PyList_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_v_task_stream); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_compute); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_compute); PyList_SET_ITEM(__pyx_t_6, 2, __pyx_cur_scope->__pyx_v_compute); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); PyList_SET_ITEM(__pyx_t_6, 3, __pyx_cur_scope->__pyx_v_workers); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_scheduler); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_scheduler); PyList_SET_ITEM(__pyx_t_6, 4, __pyx_cur_scope->__pyx_v_scheduler); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bandwidth_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bandwidth_workers); PyList_SET_ITEM(__pyx_t_6, 5, __pyx_cur_scope->__pyx_v_bandwidth_workers); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bandwidth_types); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bandwidth_types); PyList_SET_ITEM(__pyx_t_6, 6, __pyx_cur_scope->__pyx_v_bandwidth_types); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tabs, __pyx_t_6) < 0) __PYX_ERR(0, 6359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6358 * bandwidth_types = Panel(child=bandwidth_types.fig, title="Bandwidth (Types)") * * tabs = Tabs( # <<<<<<<<<<<<<< * tabs=[ * html, */ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_Tabs, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_tabs = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6370 * ) * * from bokeh.plotting import save, output_file # <<<<<<<<<<<<<< * from bokeh.core.templates import get_env * */ __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_n_s_save); __Pyx_GIVEREF(__pyx_n_s_save); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_save); __Pyx_INCREF(__pyx_n_s_output_file); __Pyx_GIVEREF(__pyx_n_s_output_file); PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_output_file); __pyx_t_4 = __Pyx_Import(__pyx_n_s_bokeh_plotting, __pyx_t_6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_save = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_output_file); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_output_file = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6371 * * from bokeh.plotting import save, output_file * from bokeh.core.templates import get_env # <<<<<<<<<<<<<< * * with tmpfile(extension=".html") as fn: */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_get_env); __Pyx_GIVEREF(__pyx_n_s_get_env); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_get_env); __pyx_t_6 = __Pyx_Import(__pyx_n_s_bokeh_core_templates, __pyx_t_4, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_get_env); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_get_env = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6373 * from bokeh.core.templates import get_env * * with tmpfile(extension=".html") as fn: # <<<<<<<<<<<<<< * output_file(filename=fn, title="Dask Performance Report") * template_directory = os.path.join( */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tmpfile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_extension, __pyx_kp_u_html) < 0) __PYX_ERR(0, 6373, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_17 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 6373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6373, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6373, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); /*try:*/ { __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_fn = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6374 * * with tmpfile(extension=".html") as fn: * output_file(filename=fn, title="Dask Performance Report") # <<<<<<<<<<<<<< * template_directory = os.path.join( * os.path.dirname(os.path.abspath(__file__)), "dashboard", "templates" */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6374, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_filename, __pyx_cur_scope->__pyx_v_fn) < 0) __PYX_ERR(0, 6374, __pyx_L25_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_title, __pyx_kp_u_Dask_Performance_Report) < 0) __PYX_ERR(0, 6374, __pyx_L25_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_output_file, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6374, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6375 * with tmpfile(extension=".html") as fn: * output_file(filename=fn, title="Dask Performance Report") * template_directory = os.path.join( # <<<<<<<<<<<<<< * os.path.dirname(os.path.abspath(__file__)), "dashboard", "templates" * ) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6375, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6375, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6375, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6376 * output_file(filename=fn, title="Dask Performance Report") * template_directory = os.path.join( * os.path.dirname(os.path.abspath(__file__)), "dashboard", "templates" # <<<<<<<<<<<<<< * ) * template_environment = get_env() */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dirname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_os); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abspath); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_21 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } __pyx_t_1 = (__pyx_t_21) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_21, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_3); __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_13, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6376, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_n_u_dashboard, __pyx_n_u_templates}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6375, __pyx_L25_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_n_u_dashboard, __pyx_n_u_templates}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6375, __pyx_L25_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_1 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6375, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_n_u_dashboard); __Pyx_GIVEREF(__pyx_n_u_dashboard); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_10, __pyx_n_u_dashboard); __Pyx_INCREF(__pyx_n_u_templates); __Pyx_GIVEREF(__pyx_n_u_templates); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_10, __pyx_n_u_templates); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6375, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_template_directory = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":6378 * os.path.dirname(os.path.abspath(__file__)), "dashboard", "templates" * ) * template_environment = get_env() # <<<<<<<<<<<<<< * template_environment.loader.searchpath.append(template_directory) * template = template_environment.get_template("performance_report.html") */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_get_env); __pyx_t_6 = __pyx_cur_scope->__pyx_v_get_env; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6378, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_template_environment = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":6379 * ) * template_environment = get_env() * template_environment.loader.searchpath.append(template_directory) # <<<<<<<<<<<<<< * template = template_environment.get_template("performance_report.html") * save(tabs, filename=fn, template=template) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_template_environment, __pyx_n_s_loader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6379, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_searchpath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6379, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_14 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_cur_scope->__pyx_v_template_directory); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 6379, __pyx_L25_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6380 * template_environment = get_env() * template_environment.loader.searchpath.append(template_directory) * template = template_environment.get_template("performance_report.html") # <<<<<<<<<<<<<< * save(tabs, filename=fn, template=template) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_template_environment, __pyx_n_s_get_template); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6380, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_kp_u_performance_report_html) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_performance_report_html); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6380, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_template = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6381 * template_environment.loader.searchpath.append(template_directory) * template = template_environment.get_template("performance_report.html") * save(tabs, filename=fn, template=template) # <<<<<<<<<<<<<< * * with open(fn) as f: */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6381, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tabs); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tabs); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_tabs); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6381, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_filename, __pyx_cur_scope->__pyx_v_fn) < 0) __PYX_ERR(0, 6381, __pyx_L25_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_template, __pyx_cur_scope->__pyx_v_template) < 0) __PYX_ERR(0, 6381, __pyx_L25_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_save, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6381, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6383 * save(tabs, filename=fn, template=template) * * with open(fn) as f: # <<<<<<<<<<<<<< * data = f.read() * */ /*with:*/ { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_cur_scope->__pyx_v_fn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6383, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_22 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 6383, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6383, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6383, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); /*try:*/ { __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_f = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6384 * * with open(fn) as f: * data = f.read() # <<<<<<<<<<<<<< * * return data */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6384, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6384, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_data = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6383 * save(tabs, filename=fn, template=template) * * with open(fn) as f: # <<<<<<<<<<<<<< * data = f.read() * */ } __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; goto __pyx_L40_try_end; __pyx_L35_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.performance_report", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 6383, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6383, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 6383, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_26); __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_26); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (__pyx_t_27 < 0) __PYX_ERR(0, 6383, __pyx_L37_except_error) __pyx_t_28 = ((!(__pyx_t_27 != 0)) != 0); if (__pyx_t_28) { __Pyx_GIVEREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_1, __pyx_t_2); __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; __PYX_ERR(0, 6383, __pyx_L37_except_error) } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L36_exception_handled; } __pyx_L37_except_error:; __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); goto __pyx_L25_error; __pyx_L36_exception_handled:; __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); __pyx_L40_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_22) { __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 6383, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; } goto __pyx_L34; } __pyx_L34:; } goto __pyx_L44; __pyx_L31_error:; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; goto __pyx_L25_error; __pyx_L44:; } /* "distributed/scheduler.py":6373 * from bokeh.core.templates import get_env * * with tmpfile(extension=".html") as fn: # <<<<<<<<<<<<<< * output_file(filename=fn, title="Dask Performance Report") * template_directory = os.path.join( */ } __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L30_try_end; __pyx_L25_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /*except:*/ { __Pyx_AddTraceback("distributed.scheduler.Scheduler.performance_report", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 6373, __pyx_L27_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6373, __pyx_L27_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 6373, __pyx_L27_except_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_28 = __Pyx_PyObject_IsTrue(__pyx_t_22); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (__pyx_t_28 < 0) __PYX_ERR(0, 6373, __pyx_L27_except_error) __pyx_t_27 = ((!(__pyx_t_28 != 0)) != 0); if (__pyx_t_27) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_6 = 0; __PYX_ERR(0, 6373, __pyx_L27_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L26_exception_handled; } __pyx_L27_except_error:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); goto __pyx_L1_error; __pyx_L26_exception_handled:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_L30_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_17) { __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 6373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } goto __pyx_L24; } __pyx_L24:; } goto __pyx_L48; __pyx_L21_error:; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L1_error; __pyx_L48:; } /* "distributed/scheduler.py":6386 * data = f.read() * * return data # <<<<<<<<<<<<<< * * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6386, __pyx_L1_error) } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_data); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":6251 * return {"counts": counts, "keys": keys} * * async def performance_report(self, comm=None, start=None, code=""): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * stop = time() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_21); __Pyx_AddTraceback("performance_report", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_206generator23(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":6388 * return data * * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): # <<<<<<<<<<<<<< * results = await self.broadcast( * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_205get_worker_logs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_205get_worker_logs = {"get_worker_logs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_205get_worker_logs, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_205get_worker_logs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_n = 0; PyObject *__pyx_v_workers = 0; PyObject *__pyx_v_nanny = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_worker_logs (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_n,&__pyx_n_s_workers,&__pyx_n_s_nanny,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_False)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nanny); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_worker_logs") < 0)) __PYX_ERR(0, 6388, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_n = values[2]; __pyx_v_workers = values[3]; __pyx_v_nanny = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_worker_logs", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6388, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_worker_logs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_204get_worker_logs(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_n, __pyx_v_workers, __pyx_v_nanny); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_204get_worker_logs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_n, PyObject *__pyx_v_workers, PyObject *__pyx_v_nanny) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_worker_logs", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 6388, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_comm = __pyx_v_comm; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_comm); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_comm); __pyx_cur_scope->__pyx_v_n = __pyx_v_n; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_n); __pyx_cur_scope->__pyx_v_workers = __pyx_v_workers; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_workers); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_workers); __pyx_cur_scope->__pyx_v_nanny = __pyx_v_nanny; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nanny); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nanny); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_206generator23, __pyx_codeobj__92, (PyObject *) __pyx_cur_scope, __pyx_n_s_get_worker_logs, __pyx_n_s_Scheduler_get_worker_logs, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 6388, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_worker_logs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_206generator23(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_worker_logs", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L4_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6388, __pyx_L1_error) /* "distributed/scheduler.py":6389 * * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): * results = await self.broadcast( # <<<<<<<<<<<<<< * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny * ) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":6390 * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): * results = await self.broadcast( * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny # <<<<<<<<<<<<<< * ) * return results */ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_op, __pyx_n_u_get_logs) < 0) __PYX_ERR(0, 6390, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_n, __pyx_cur_scope->__pyx_v_n) < 0) __PYX_ERR(0, 6390, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_msg, __pyx_t_3) < 0) __PYX_ERR(0, 6390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_workers, __pyx_cur_scope->__pyx_v_workers) < 0) __PYX_ERR(0, 6390, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nanny, __pyx_cur_scope->__pyx_v_nanny) < 0) __PYX_ERR(0, 6390, __pyx_L1_error) /* "distributed/scheduler.py":6389 * * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): * results = await self.broadcast( # <<<<<<<<<<<<<< * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny * ) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6389, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 6389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_results = __pyx_t_3; __pyx_t_3 = 0; /* "distributed/scheduler.py":6392 * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny * ) * return results # <<<<<<<<<<<<<< * * def log_event(self, name, msg): */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_results); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":6388 * return data * * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): # <<<<<<<<<<<<<< * results = await self.broadcast( * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("get_worker_logs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6394 * return results * * def log_event(self, name, msg): # <<<<<<<<<<<<<< * event = (time(), msg) * if isinstance(name, list): */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_208log_event(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_208log_event = {"log_event", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_208log_event, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_208log_event(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("log_event (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_msg,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("log_event", 1, 3, 3, 1); __PYX_ERR(0, 6394, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("log_event", 1, 3, 3, 2); __PYX_ERR(0, 6394, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "log_event") < 0)) __PYX_ERR(0, 6394, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_name = values[1]; __pyx_v_msg = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("log_event", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6394, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.log_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_207log_event(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_msg); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_207log_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_msg) { PyObject *__pyx_v_event = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("log_event", 0); /* "distributed/scheduler.py":6395 * * def log_event(self, name, msg): * event = (time(), msg) # <<<<<<<<<<<<<< * if isinstance(name, list): * for n in name: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_msg); __pyx_t_1 = 0; __pyx_v_event = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6396 * def log_event(self, name, msg): * event = (time(), msg) * if isinstance(name, list): # <<<<<<<<<<<<<< * for n in name: * self.events[n].append(event) */ __pyx_t_4 = PyList_Check(__pyx_v_name); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "distributed/scheduler.py":6397 * event = (time(), msg) * if isinstance(name, list): * for n in name: # <<<<<<<<<<<<<< * self.events[n].append(event) * self.event_counts[n] += 1 */ if (likely(PyList_CheckExact(__pyx_v_name)) || PyTuple_CheckExact(__pyx_v_name)) { __pyx_t_2 = __pyx_v_name; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6397, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 6397, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 6397, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 6397, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6398 * if isinstance(name, list): * for n in name: * self.events[n].append(event) # <<<<<<<<<<<<<< * self.event_counts[n] += 1 * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_event); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 6398, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6399 * for n in name: * self.events[n].append(event) * self.event_counts[n] += 1 # <<<<<<<<<<<<<< * else: * self.events[name].append(event) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_event_counts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_n); __pyx_t_1 = __pyx_v_n; __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_1, __pyx_t_10) < 0)) __PYX_ERR(0, 6399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6397 * event = (time(), msg) * if isinstance(name, list): * for n in name: # <<<<<<<<<<<<<< * self.events[n].append(event) * self.event_counts[n] += 1 */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6396 * def log_event(self, name, msg): * event = (time(), msg) * if isinstance(name, list): # <<<<<<<<<<<<<< * for n in name: * self.events[n].append(event) */ goto __pyx_L3; } /* "distributed/scheduler.py":6401 * self.event_counts[n] += 1 * else: * self.events[name].append(event) # <<<<<<<<<<<<<< * self.event_counts[name] += 1 * */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_event); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 6401, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6402 * else: * self.events[name].append(event) * self.event_counts[name] += 1 # <<<<<<<<<<<<<< * * def get_events(self, comm=None, topic=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_event_counts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_name); __pyx_t_2 = __pyx_v_name; __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_10) < 0)) __PYX_ERR(0, 6402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "distributed/scheduler.py":6394 * return results * * def log_event(self, name, msg): # <<<<<<<<<<<<<< * event = (time(), msg) * if isinstance(name, list): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.Scheduler.log_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_event); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6404 * self.event_counts[name] += 1 * * def get_events(self, comm=None, topic=None): # <<<<<<<<<<<<<< * if topic is not None: * return tuple(self.events[topic]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_210get_events(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_210get_events = {"get_events", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_210get_events, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_210get_events(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_topic = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_events (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_topic,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_topic); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_events") < 0)) __PYX_ERR(0, 6404, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_topic = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_events", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6404, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_209get_events(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_topic); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_209get_events(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_topic) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_events", 0); /* "distributed/scheduler.py":6405 * * def get_events(self, comm=None, topic=None): * if topic is not None: # <<<<<<<<<<<<<< * return tuple(self.events[topic]) * else: */ __pyx_t_1 = (__pyx_v_topic != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6406 * def get_events(self, comm=None, topic=None): * if topic is not None: * return tuple(self.events[topic]) # <<<<<<<<<<<<<< * else: * return valmap(tuple, self.events) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_topic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6405 * * def get_events(self, comm=None, topic=None): * if topic is not None: # <<<<<<<<<<<<<< * return tuple(self.events[topic]) * else: */ } /* "distributed/scheduler.py":6408 * return tuple(self.events[topic]) * else: * return valmap(tuple, self.events) # <<<<<<<<<<<<<< * * ########### */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_valmap); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_events); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)(&PyTuple_Type)), __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6408, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)(&PyTuple_Type)), __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6408, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)(&PyTuple_Type))); __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type))); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)(&PyTuple_Type))); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":6404 * self.event_counts[name] += 1 * * def get_events(self, comm=None, topic=None): # <<<<<<<<<<<<<< * if topic is not None: * return tuple(self.events[topic]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("distributed.scheduler.Scheduler.get_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6414 * ########### * * def reevaluate_occupancy(self, worker_index: Py_ssize_t = 0): # <<<<<<<<<<<<<< * """Periodically reassess task duration time * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_212reevaluate_occupancy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_211reevaluate_occupancy[] = "Periodically reassess task duration time\n\n The expected duration of a task can change over time. Unfortunately we\n don't have a good constant-time way to propagate the effects of these\n changes out to the summaries that they affect, like the total expected\n runtime of each of the workers, or what tasks are stealable.\n\n In this coroutine we walk through all of the workers and re-align their\n estimates with the current state of tasks. We do this periodically\n rather than at every transition, and we only do it if the scheduler\n process isn't under load (using psutil.Process.cpu_percent()). This\n lets us avoid this fringe optimization when we have better things to\n think about.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_212reevaluate_occupancy = {"reevaluate_occupancy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_212reevaluate_occupancy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_211reevaluate_occupancy}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_212reevaluate_occupancy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; Py_ssize_t __pyx_v_worker_index; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reevaluate_occupancy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker_index,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker_index); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reevaluate_occupancy") < 0)) __PYX_ERR(0, 6414, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; if (values[1]) { __pyx_v_worker_index = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_worker_index == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 6414, __pyx_L3_error) } else { __pyx_v_worker_index = ((Py_ssize_t)((Py_ssize_t)0)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reevaluate_occupancy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6414, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.reevaluate_occupancy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_211reevaluate_occupancy(__pyx_self, __pyx_v_self, __pyx_v_worker_index); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_211reevaluate_occupancy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, Py_ssize_t __pyx_v_worker_index) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_last = NULL; PyObject *__pyx_v_next_time = NULL; PyObject *__pyx_v_workers = 0; Py_ssize_t __pyx_v_nworkers; CYTHON_UNUSED Py_ssize_t __pyx_v_i; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_duration = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_t_14; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reevaluate_occupancy", 0); /* "distributed/scheduler.py":6429 * think about. * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * try: * if self.status == Status.closed: */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6430 * """ * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * if self.status == Status.closed: * return */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "distributed/scheduler.py":6431 * parent: SchedulerState = cast(SchedulerState, self) * try: * if self.status == Status.closed: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6431, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6431, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_closed); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6431, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6431, __pyx_L3_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 6431, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_7) { /* "distributed/scheduler.py":6432 * try: * if self.status == Status.closed: * return # <<<<<<<<<<<<<< * * last = time() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L7_try_return; /* "distributed/scheduler.py":6431 * parent: SchedulerState = cast(SchedulerState, self) * try: * if self.status == Status.closed: # <<<<<<<<<<<<<< * return * */ } /* "distributed/scheduler.py":6434 * return * * last = time() # <<<<<<<<<<<<<< * next_time = timedelta(seconds=0.1) * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6434, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6434, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_last = __pyx_t_5; __pyx_t_5 = 0; /* "distributed/scheduler.py":6435 * * last = time() * next_time = timedelta(seconds=0.1) # <<<<<<<<<<<<<< * * if self.proc.cpu_percent() < 50: */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6435, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6435, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_seconds, __pyx_float_0_1) < 0) __PYX_ERR(0, 6435, __pyx_L3_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6435, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_next_time = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6437 * next_time = timedelta(seconds=0.1) * * if self.proc.cpu_percent() < 50: # <<<<<<<<<<<<<< * workers: list = list(parent._workers.values()) * nworkers: Py_ssize_t = len(workers) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_proc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6437, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cpu_percent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6437, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6437, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_50, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6437, __pyx_L3_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 6437, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_7) { /* "distributed/scheduler.py":6438 * * if self.proc.cpu_percent() < 50: * workers: list = list(parent._workers.values()) # <<<<<<<<<<<<<< * nworkers: Py_ssize_t = len(workers) * i: Py_ssize_t */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent->_workers, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6438, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6438, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6438, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_workers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6439 * if self.proc.cpu_percent() < 50: * workers: list = list(parent._workers.values()) * nworkers: Py_ssize_t = len(workers) # <<<<<<<<<<<<<< * i: Py_ssize_t * for i in range(nworkers): */ __pyx_t_8 = PyList_GET_SIZE(__pyx_v_workers); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6439, __pyx_L3_error) __pyx_v_nworkers = __pyx_t_8; /* "distributed/scheduler.py":6441 * nworkers: Py_ssize_t = len(workers) * i: Py_ssize_t * for i in range(nworkers): # <<<<<<<<<<<<<< * ws: WorkerState = workers[worker_index % nworkers] * worker_index += 1 */ __pyx_t_8 = __pyx_v_nworkers; __pyx_t_9 = __pyx_t_8; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; /* "distributed/scheduler.py":6442 * i: Py_ssize_t * for i in range(nworkers): * ws: WorkerState = workers[worker_index % nworkers] # <<<<<<<<<<<<<< * worker_index += 1 * try: */ if (unlikely(__pyx_v_nworkers == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); __PYX_ERR(0, 6442, __pyx_L3_error) } __pyx_t_11 = __Pyx_mod_Py_ssize_t(__pyx_v_worker_index, __pyx_v_nworkers); __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_workers, __pyx_t_11, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6442, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6442, __pyx_L3_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6443 * for i in range(nworkers): * ws: WorkerState = workers[worker_index % nworkers] * worker_index += 1 # <<<<<<<<<<<<<< * try: * if ws is None or not ws._processing: */ __pyx_v_worker_index = (__pyx_v_worker_index + 1); /* "distributed/scheduler.py":6444 * ws: WorkerState = workers[worker_index % nworkers] * worker_index += 1 * try: # <<<<<<<<<<<<<< * if ws is None or not ws._processing: * continue */ /*try:*/ { /* "distributed/scheduler.py":6445 * worker_index += 1 * try: * if ws is None or not ws._processing: # <<<<<<<<<<<<<< * continue * _reevaluate_occupancy_worker(parent, ws) */ __pyx_t_12 = (((PyObject *)__pyx_v_ws) == Py_None); __pyx_t_13 = (__pyx_t_12 != 0); if (!__pyx_t_13) { } else { __pyx_t_7 = __pyx_t_13; goto __pyx_L19_bool_binop_done; } __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_ws->_processing); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 6445, __pyx_L16_error) __pyx_t_12 = ((!__pyx_t_13) != 0); __pyx_t_7 = __pyx_t_12; __pyx_L19_bool_binop_done:; if (__pyx_t_7) { /* "distributed/scheduler.py":6446 * try: * if ws is None or not ws._processing: * continue # <<<<<<<<<<<<<< * _reevaluate_occupancy_worker(parent, ws) * finally: */ goto __pyx_L13_continue; /* "distributed/scheduler.py":6445 * worker_index += 1 * try: * if ws is None or not ws._processing: # <<<<<<<<<<<<<< * continue * _reevaluate_occupancy_worker(parent, ws) */ } /* "distributed/scheduler.py":6447 * if ws is None or not ws._processing: * continue * _reevaluate_occupancy_worker(parent, ws) # <<<<<<<<<<<<<< * finally: * del ws # lose ref */ __pyx_t_1 = __pyx_f_11distributed_9scheduler__reevaluate_occupancy_worker(__pyx_v_parent, __pyx_v_ws); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6447, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "distributed/scheduler.py":6449 * _reevaluate_occupancy_worker(parent, ws) * finally: * del ws # lose ref # <<<<<<<<<<<<<< * * duration = time() - last */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(((PyObject *)__pyx_v_ws)); __pyx_v_ws = NULL; goto __pyx_L17; } __pyx_L16_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(((PyObject *)__pyx_v_ws)); __pyx_v_ws = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L3_error; } __pyx_L13_continue: { __Pyx_DECREF(((PyObject *)__pyx_v_ws)); __pyx_v_ws = NULL; goto __pyx_L11_continue; } __pyx_L17:; } /* "distributed/scheduler.py":6451 * del ws # lose ref * * duration = time() - last # <<<<<<<<<<<<<< * if duration > 0.005: # 5ms since last release * next_time = timedelta(seconds=duration * 5) # 25ms gap */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6451, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6451, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_v_last); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6451, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_duration, __pyx_t_5); __pyx_t_5 = 0; /* "distributed/scheduler.py":6452 * * duration = time() - last * if duration > 0.005: # 5ms since last release # <<<<<<<<<<<<<< * next_time = timedelta(seconds=duration * 5) # 25ms gap * break */ __pyx_t_5 = PyObject_RichCompare(__pyx_v_duration, __pyx_float_0_005, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6452, __pyx_L3_error) __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 6452, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_7) { /* "distributed/scheduler.py":6453 * duration = time() - last * if duration > 0.005: # 5ms since last release * next_time = timedelta(seconds=duration * 5) # 25ms gap # <<<<<<<<<<<<<< * break * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6453, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6453, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Multiply(__pyx_v_duration, __pyx_int_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6453, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seconds, __pyx_t_6) < 0) __PYX_ERR(0, 6453, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6453, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_next_time, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6454 * if duration > 0.005: # 5ms since last release * next_time = timedelta(seconds=duration * 5) # 25ms gap * break # <<<<<<<<<<<<<< * * self.loop.add_timeout( */ goto __pyx_L12_break; /* "distributed/scheduler.py":6452 * * duration = time() - last * if duration > 0.005: # 5ms since last release # <<<<<<<<<<<<<< * next_time = timedelta(seconds=duration * 5) # 25ms gap * break */ } __pyx_L11_continue:; } __pyx_L12_break:; /* "distributed/scheduler.py":6437 * next_time = timedelta(seconds=0.1) * * if self.proc.cpu_percent() < 50: # <<<<<<<<<<<<<< * workers: list = list(parent._workers.values()) * nworkers: Py_ssize_t = len(workers) */ } /* "distributed/scheduler.py":6456 * break * * self.loop.add_timeout( # <<<<<<<<<<<<<< * next_time, self.reevaluate_occupancy, worker_index=worker_index * ) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6456, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_add_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6456, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6457 * * self.loop.add_timeout( * next_time, self.reevaluate_occupancy, worker_index=worker_index # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reevaluate_occupancy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6457, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); /* "distributed/scheduler.py":6456 * break * * self.loop.add_timeout( # <<<<<<<<<<<<<< * next_time, self.reevaluate_occupancy, worker_index=worker_index * ) */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6456, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_next_time); __Pyx_GIVEREF(__pyx_v_next_time); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_next_time); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6457 * * self.loop.add_timeout( * next_time, self.reevaluate_occupancy, worker_index=worker_index # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6457, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_23 = PyInt_FromSsize_t(__pyx_v_worker_index); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 6457, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_23); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_worker_index, __pyx_t_23) < 0) __PYX_ERR(0, 6457, __pyx_L3_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; /* "distributed/scheduler.py":6456 * break * * self.loop.add_timeout( # <<<<<<<<<<<<<< * next_time, self.reevaluate_occupancy, worker_index=worker_index * ) */ __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 6456, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; /* "distributed/scheduler.py":6430 * """ * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * if self.status == Status.closed: * return */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6460 * ) * * except Exception: # <<<<<<<<<<<<<< * logger.error("Error in reevaluate occupancy", exc_info=True) * raise */ __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_15) { __Pyx_AddTraceback("distributed.scheduler.Scheduler.reevaluate_occupancy", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_23, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 6460, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6461 * * except Exception: * logger.error("Error in reevaluate occupancy", exc_info=True) # <<<<<<<<<<<<<< * raise * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6461, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6461, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6461, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 6461, __pyx_L5_except_error) __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_tuple__93, __pyx_t_1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 6461, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; /* "distributed/scheduler.py":6462 * except Exception: * logger.error("Error in reevaluate occupancy", exc_info=True) * raise # <<<<<<<<<<<<<< * * async def check_worker_ttl(self): */ __Pyx_GIVEREF(__pyx_t_23); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_23, __pyx_t_6, __pyx_t_5); __pyx_t_23 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; __PYX_ERR(0, 6462, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":6430 * """ * parent: SchedulerState = cast(SchedulerState, self) * try: # <<<<<<<<<<<<<< * if self.status == Status.closed: * return */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "distributed/scheduler.py":6414 * ########### * * def reevaluate_occupancy(self, worker_index: Py_ssize_t = 0): # <<<<<<<<<<<<<< * """Periodically reassess task duration time * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_23); __Pyx_XDECREF(__pyx_t_24); __Pyx_XDECREF(__pyx_t_25); __Pyx_AddTraceback("distributed.scheduler.Scheduler.reevaluate_occupancy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_last); __Pyx_XDECREF(__pyx_v_next_time); __Pyx_XDECREF(__pyx_v_workers); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_duration); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_215generator24(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "distributed/scheduler.py":6464 * raise * * async def check_worker_ttl(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_214check_worker_ttl(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_214check_worker_ttl = {"check_worker_ttl", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_214check_worker_ttl, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_214check_worker_ttl(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_worker_ttl (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_213check_worker_ttl(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_213check_worker_ttl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_worker_ttl", 0); __pyx_cur_scope = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *)__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl(__pyx_ptype_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 6464, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); { __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_11distributed_9scheduler_9Scheduler_215generator24, __pyx_codeobj__94, (PyObject *) __pyx_cur_scope, __pyx_n_s_check_worker_ttl, __pyx_n_s_Scheduler_check_worker_ttl, __pyx_n_s_distributed_scheduler); if (unlikely(!gen)) __PYX_ERR(0, 6464, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.check_worker_ttl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_11distributed_9scheduler_9Scheduler_215generator24(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *__pyx_cur_scope = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_worker_ttl", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L9_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6464, __pyx_L1_error) /* "distributed/scheduler.py":6465 * * async def check_worker_ttl(self): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * now = time() */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6467 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState * now = time() # <<<<<<<<<<<<<< * for ws in parent._workers_dv.values(): * if (ws._last_seen < now - self.worker_ttl) and ( */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_now = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6468 * ws: WorkerState * now = time() * for ws in parent._workers_dv.values(): # <<<<<<<<<<<<<< * if (ws._last_seen < now - self.worker_ttl) and ( * ws._last_seen < now - 10 * heartbeat_interval(len(parent._workers_dv)) */ __pyx_t_4 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 6468, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_parent->_workers_dv, 1, __pyx_n_s_values, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, NULL, &__pyx_t_2, NULL, __pyx_t_6); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 6468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6468, __pyx_L1_error) __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6469 * now = time() * for ws in parent._workers_dv.values(): * if (ws._last_seen < now - self.worker_ttl) and ( # <<<<<<<<<<<<<< * ws._last_seen < now - 10 * heartbeat_interval(len(parent._workers_dv)) * ): */ __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_ws->_last_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_worker_ttl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_now, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 6469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_10) { } else { __pyx_t_8 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } /* "distributed/scheduler.py":6470 * for ws in parent._workers_dv.values(): * if (ws._last_seen < now - self.worker_ttl) and ( * ws._last_seen < now - 10 * heartbeat_interval(len(parent._workers_dv)) # <<<<<<<<<<<<<< * ): * logger.warning( */ __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_ws->_last_seen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_heartbeat_interval_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __pyx_cur_scope->__pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_11); if (unlikely(__pyx_t_11 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 6470, __pyx_L1_error) } __pyx_t_12 = PyDict_Size(__pyx_t_11); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Multiply(__pyx_int_10, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_now, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 6470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_t_10; __pyx_L7_bool_binop_done:; /* "distributed/scheduler.py":6469 * now = time() * for ws in parent._workers_dv.values(): * if (ws._last_seen < now - self.worker_ttl) and ( # <<<<<<<<<<<<<< * ws._last_seen < now - 10 * heartbeat_interval(len(parent._workers_dv)) * ): */ if (__pyx_t_8) { /* "distributed/scheduler.py":6472 * ws._last_seen < now - 10 * heartbeat_interval(len(parent._workers_dv)) * ): * logger.warning( # <<<<<<<<<<<<<< * "Worker failed to heartbeat within %s seconds. Closing: %s", * self.worker_ttl, */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":6474 * logger.warning( * "Worker failed to heartbeat within %s seconds. Closing: %s", * self.worker_ttl, # <<<<<<<<<<<<<< * ws, * ) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_worker_ttl); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "distributed/scheduler.py":6475 * "Worker failed to heartbeat within %s seconds. Closing: %s", * self.worker_ttl, * ws, # <<<<<<<<<<<<<< * ) * await self.remove_worker(address=ws._address) */ __pyx_t_11 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_kp_u_Worker_failed_to_heartbeat_withi, __pyx_t_9, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6472, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_kp_u_Worker_failed_to_heartbeat_withi, __pyx_t_9, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6472, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_13 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_kp_u_Worker_failed_to_heartbeat_withi); __Pyx_GIVEREF(__pyx_kp_u_Worker_failed_to_heartbeat_withi); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_kp_u_Worker_failed_to_heartbeat_withi); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_t_9); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_ws)); PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_7, ((PyObject *)__pyx_cur_scope->__pyx_v_ws)); __pyx_t_9 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6477 * ws, * ) * await self.remove_worker(address=ws._address) # <<<<<<<<<<<<<< * * def check_idle(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_address, __pyx_cur_scope->__pyx_v_ws->_address) < 0) __PYX_ERR(0, 6477, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 6477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; __pyx_cur_scope->__pyx_t_3 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L9_resume_from_await:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 6477, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 6477, __pyx_L1_error) } } /* "distributed/scheduler.py":6469 * now = time() * for ws in parent._workers_dv.values(): * if (ws._last_seen < now - self.worker_ttl) and ( # <<<<<<<<<<<<<< * ws._last_seen < now - 10 * heartbeat_interval(len(parent._workers_dv)) * ): */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "distributed/scheduler.py":6464 * raise * * async def check_worker_ttl(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("check_worker_ttl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6479 * await self.remove_worker(address=ws._address) * * def check_idle(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_217check_idle(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_217check_idle = {"check_idle", (PyCFunction)__pyx_pw_11distributed_9scheduler_9Scheduler_217check_idle, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_217check_idle(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_idle (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_216check_idle(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_216check_idle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr145__pyx_v_ws = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_idle", 0); /* "distributed/scheduler.py":6480 * * def check_idle(self): * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * ws: WorkerState * if ( */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6483 * ws: WorkerState * if ( * any([ws._processing for ws in parent._workers_dv.values()]) # <<<<<<<<<<<<<< * or parent._unrunnable * ): */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6483, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 6483, __pyx_L8_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_values, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6483, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, NULL, &__pyx_t_7, NULL, __pyx_t_6); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 6483, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6483, __pyx_L8_error) __Pyx_XDECREF_SET(__pyx_10genexpr145__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_7)); __pyx_t_7 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_10genexpr145__pyx_v_ws->_processing))) __PYX_ERR(0, 6483, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr145__pyx_v_ws); __pyx_10genexpr145__pyx_v_ws = 0; goto __pyx_L11_exit_scope; __pyx_L8_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr145__pyx_v_ws); __pyx_10genexpr145__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 6483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { } else { __pyx_t_2 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } /* "distributed/scheduler.py":6484 * if ( * any([ws._processing for ws in parent._workers_dv.values()]) * or parent._unrunnable # <<<<<<<<<<<<<< * ): * self.idle_since = None */ __pyx_t_9 = (__pyx_v_parent->_unrunnable != Py_None)&&(PySet_GET_SIZE(__pyx_v_parent->_unrunnable) != 0); __pyx_t_2 = __pyx_t_9; __pyx_L4_bool_binop_done:; /* "distributed/scheduler.py":6482 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState * if ( # <<<<<<<<<<<<<< * any([ws._processing for ws in parent._workers_dv.values()]) * or parent._unrunnable */ if (__pyx_t_2) { /* "distributed/scheduler.py":6486 * or parent._unrunnable * ): * self.idle_since = None # <<<<<<<<<<<<<< * return * elif not self.idle_since: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_idle_since, Py_None) < 0) __PYX_ERR(0, 6486, __pyx_L1_error) /* "distributed/scheduler.py":6487 * ): * self.idle_since = None * return # <<<<<<<<<<<<<< * elif not self.idle_since: * self.idle_since = time() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":6482 * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState * if ( # <<<<<<<<<<<<<< * any([ws._processing for ws in parent._workers_dv.values()]) * or parent._unrunnable */ } /* "distributed/scheduler.py":6488 * self.idle_since = None * return * elif not self.idle_since: # <<<<<<<<<<<<<< * self.idle_since = time() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_idle_since); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = ((!__pyx_t_2) != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":6489 * return * elif not self.idle_since: * self.idle_since = time() # <<<<<<<<<<<<<< * * if time() > self.idle_since + self.idle_timeout: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_idle_since, __pyx_t_3) < 0) __PYX_ERR(0, 6489, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6488 * self.idle_since = None * return * elif not self.idle_since: # <<<<<<<<<<<<<< * self.idle_since = time() * */ } /* "distributed/scheduler.py":6491 * self.idle_since = time() * * if time() > self.idle_since + self.idle_timeout: # <<<<<<<<<<<<<< * logger.info( * "Scheduler closing after being idle for %s", */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_idle_since); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_idle_timeout); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 6491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { /* "distributed/scheduler.py":6492 * * if time() > self.idle_since + self.idle_timeout: * logger.info( # <<<<<<<<<<<<<< * "Scheduler closing after being idle for %s", * format_time(self.idle_timeout), */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "distributed/scheduler.py":6494 * logger.info( * "Scheduler closing after being idle for %s", * format_time(self.idle_timeout), # <<<<<<<<<<<<<< * ) * self.loop.add_callback(self.close) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_format_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_idle_timeout); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_10 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Scheduler_closing_after_being_id, __pyx_t_10}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6492, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Scheduler_closing_after_being_id, __pyx_t_10}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6492, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_kp_u_Scheduler_closing_after_being_id); __Pyx_GIVEREF(__pyx_kp_u_Scheduler_closing_after_being_id); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_kp_u_Scheduler_closing_after_being_id); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":6496 * format_time(self.idle_timeout), * ) * self.loop.add_callback(self.close) # <<<<<<<<<<<<<< * * def adaptive_target(self, comm=None, target_duration=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add_callback); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":6491 * self.idle_since = time() * * if time() > self.idle_since + self.idle_timeout: # <<<<<<<<<<<<<< * logger.info( * "Scheduler closing after being idle for %s", */ } /* "distributed/scheduler.py":6479 * await self.remove_worker(address=ws._address) * * def check_idle(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("distributed.scheduler.Scheduler.check_idle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF((PyObject *)__pyx_10genexpr145__pyx_v_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6498 * self.loop.add_callback(self.close) * * def adaptive_target(self, comm=None, target_duration=None): # <<<<<<<<<<<<<< * """Desired number of workers based on the current workload * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_219adaptive_target(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_9Scheduler_218adaptive_target[] = "Desired number of workers based on the current workload\n\n This looks at the current running tasks and memory use, and returns a\n number of desired workers. This is often used by adaptive scheduling.\n\n Parameters\n ----------\n target_duration : str\n A desired duration of time for computations to take. This affects\n how rapidly the scheduler will ask to scale.\n\n See Also\n --------\n distributed.deploy.Adaptive\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_9Scheduler_219adaptive_target = {"adaptive_target", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_9Scheduler_219adaptive_target, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_9Scheduler_218adaptive_target}; static PyObject *__pyx_pw_11distributed_9scheduler_9Scheduler_219adaptive_target(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_target_duration = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adaptive_target (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_comm,&__pyx_n_s_target_duration,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_duration); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adaptive_target") < 0)) __PYX_ERR(0, 6498, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_comm = values[1]; __pyx_v_target_duration = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("adaptive_target", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6498, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.Scheduler.adaptive_target", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_9Scheduler_218adaptive_target(__pyx_self, __pyx_v_self, __pyx_v_comm, __pyx_v_target_duration); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_9Scheduler_218adaptive_target(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_comm, PyObject *__pyx_v_target_duration) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_parent = 0; PyObject *__pyx_v_cpu = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_tasks_processing = NULL; PyObject *__pyx_v_limit_bytes = NULL; PyObject *__pyx_v_worker_bytes = NULL; PyObject *__pyx_v_limit = NULL; PyObject *__pyx_v_total = NULL; Py_ssize_t __pyx_v_memory; PyObject *__pyx_v_target = NULL; PyObject *__pyx_v_to_close = NULL; PyObject *__pyx_10genexpr146__pyx_v_addr = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr146__pyx_v_ws = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr147__pyx_v_ws = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; Py_ssize_t __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; long __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adaptive_target", 0); __Pyx_INCREF(__pyx_v_target_duration); /* "distributed/scheduler.py":6514 * distributed.deploy.Adaptive * """ * parent: SchedulerState = cast(SchedulerState, self) # <<<<<<<<<<<<<< * if target_duration is None: * target_duration = dask.config.get("distributed.adaptive.target-duration") */ __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6515 * """ * parent: SchedulerState = cast(SchedulerState, self) * if target_duration is None: # <<<<<<<<<<<<<< * target_duration = dask.config.get("distributed.adaptive.target-duration") * target_duration = parse_timedelta(target_duration) */ __pyx_t_2 = (__pyx_v_target_duration == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6516 * parent: SchedulerState = cast(SchedulerState, self) * if target_duration is None: * target_duration = dask.config.get("distributed.adaptive.target-duration") # <<<<<<<<<<<<<< * target_duration = parse_timedelta(target_duration) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_dask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_distributed_adaptive_target_dura) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_distributed_adaptive_target_dura); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_target_duration, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6515 * """ * parent: SchedulerState = cast(SchedulerState, self) * if target_duration is None: # <<<<<<<<<<<<<< * target_duration = dask.config.get("distributed.adaptive.target-duration") * target_duration = parse_timedelta(target_duration) */ } /* "distributed/scheduler.py":6517 * if target_duration is None: * target_duration = dask.config.get("distributed.adaptive.target-duration") * target_duration = parse_timedelta(target_duration) # <<<<<<<<<<<<<< * * # CPU */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_target_duration) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_target_duration); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_target_duration, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6520 * * # CPU * cpu = math.ceil( # <<<<<<<<<<<<<< * parent._total_occupancy / target_duration * ) # TODO: threads per worker */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ceil); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6521 * # CPU * cpu = math.ceil( * parent._total_occupancy / target_duration # <<<<<<<<<<<<<< * ) # TODO: threads per worker * */ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_parent->_total_occupancy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_target_duration); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_cpu = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6526 * # Avoid a few long tasks from asking for many cores * ws: WorkerState * tasks_processing = 0 # <<<<<<<<<<<<<< * for ws in parent._workers_dv.values(): * tasks_processing += len(ws._processing) */ __Pyx_INCREF(__pyx_int_0); __pyx_v_tasks_processing = __pyx_int_0; /* "distributed/scheduler.py":6527 * ws: WorkerState * tasks_processing = 0 * for ws in parent._workers_dv.values(): # <<<<<<<<<<<<<< * tasks_processing += len(ws._processing) * */ __pyx_t_7 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 6527, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_values, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_7, NULL, &__pyx_t_5, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6527, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6528 * tasks_processing = 0 * for ws in parent._workers_dv.values(): * tasks_processing += len(ws._processing) # <<<<<<<<<<<<<< * * if tasks_processing > cpu: */ __pyx_t_5 = __pyx_v_ws->_processing; __Pyx_INCREF(__pyx_t_5); if (unlikely(__pyx_t_5 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 6528, __pyx_L1_error) } __pyx_t_11 = PyDict_Size(__pyx_t_5); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_tasks_processing, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_tasks_processing, __pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6530 * tasks_processing += len(ws._processing) * * if tasks_processing > cpu: # <<<<<<<<<<<<<< * break * else: */ __pyx_t_6 = PyObject_RichCompare(__pyx_v_tasks_processing, __pyx_v_cpu, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6530, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { /* "distributed/scheduler.py":6531 * * if tasks_processing > cpu: * break # <<<<<<<<<<<<<< * else: * cpu = min(tasks_processing, cpu) */ goto __pyx_L5_break; /* "distributed/scheduler.py":6530 * tasks_processing += len(ws._processing) * * if tasks_processing > cpu: # <<<<<<<<<<<<<< * break * else: */ } } /* "distributed/scheduler.py":6533 * break * else: * cpu = min(tasks_processing, cpu) # <<<<<<<<<<<<<< * * if parent._unrunnable and not parent._workers_dv: */ /*else*/ { __Pyx_INCREF(__pyx_v_cpu); __pyx_t_6 = __pyx_v_cpu; __Pyx_INCREF(__pyx_v_tasks_processing); __pyx_t_5 = __pyx_v_tasks_processing; __pyx_t_12 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6533, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6533, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_3) { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; } else { __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_cpu, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L5_break:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6535 * cpu = min(tasks_processing, cpu) * * if parent._unrunnable and not parent._workers_dv: # <<<<<<<<<<<<<< * cpu = max(1, cpu) * */ __pyx_t_2 = (__pyx_v_parent->_unrunnable != Py_None)&&(PySet_GET_SIZE(__pyx_v_parent->_unrunnable) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_parent->_workers_dv); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6535, __pyx_L1_error) __pyx_t_13 = ((!__pyx_t_2) != 0); __pyx_t_3 = __pyx_t_13; __pyx_L8_bool_binop_done:; if (__pyx_t_3) { /* "distributed/scheduler.py":6536 * * if parent._unrunnable and not parent._workers_dv: * cpu = max(1, cpu) # <<<<<<<<<<<<<< * * # Memory */ __Pyx_INCREF(__pyx_v_cpu); __pyx_t_1 = __pyx_v_cpu; __pyx_t_14 = 1; __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = __pyx_t_1; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_cpu, __pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6535 * cpu = min(tasks_processing, cpu) * * if parent._unrunnable and not parent._workers_dv: # <<<<<<<<<<<<<< * cpu = max(1, cpu) * */ } /* "distributed/scheduler.py":6539 * * # Memory * limit_bytes = { # <<<<<<<<<<<<<< * addr: ws._memory_limit for addr, ws in parent._workers_dv.items() * } */ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6539, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":6540 * # Memory * limit_bytes = { * addr: ws._memory_limit for addr, ws in parent._workers_dv.items() # <<<<<<<<<<<<<< * } * worker_bytes = [ws._nbytes for ws in parent._workers_dv.values()] */ __pyx_t_8 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 6540, __pyx_L12_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6540, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_5, &__pyx_t_4, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6540, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6540, __pyx_L12_error) __Pyx_XDECREF_SET(__pyx_10genexpr146__pyx_v_addr, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_10genexpr146__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyInt_FromSsize_t(__pyx_10genexpr146__pyx_v_ws->_memory_limit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6540, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_10genexpr146__pyx_v_addr, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 6540, __pyx_L12_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_10genexpr146__pyx_v_addr); __pyx_10genexpr146__pyx_v_addr = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr146__pyx_v_ws); __pyx_10genexpr146__pyx_v_ws = 0; goto __pyx_L15_exit_scope; __pyx_L12_error:; __Pyx_XDECREF(__pyx_10genexpr146__pyx_v_addr); __pyx_10genexpr146__pyx_v_addr = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr146__pyx_v_ws); __pyx_10genexpr146__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_v_limit_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6542 * addr: ws._memory_limit for addr, ws in parent._workers_dv.items() * } * worker_bytes = [ws._nbytes for ws in parent._workers_dv.values()] # <<<<<<<<<<<<<< * limit = sum(limit_bytes.values()) * total = sum(worker_bytes) */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6542, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = 0; if (unlikely(__pyx_v_parent->_workers_dv == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 6542, __pyx_L18_error) } __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_parent->_workers_dv, 1, __pyx_n_s_values, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6542, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, NULL, &__pyx_t_4, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6542, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6542, __pyx_L18_error) __Pyx_XDECREF_SET(__pyx_10genexpr147__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyInt_FromSsize_t(__pyx_10genexpr147__pyx_v_ws->_nbytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6542, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 6542, __pyx_L18_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr147__pyx_v_ws); __pyx_10genexpr147__pyx_v_ws = 0; goto __pyx_L21_exit_scope; __pyx_L18_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr147__pyx_v_ws); __pyx_10genexpr147__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L21_exit_scope:; } /* exit inner scope */ __pyx_v_worker_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6543 * } * worker_bytes = [ws._nbytes for ws in parent._workers_dv.values()] * limit = sum(limit_bytes.values()) # <<<<<<<<<<<<<< * total = sum(worker_bytes) * if total > 0.6 * limit: */ __pyx_t_1 = __Pyx_PyDict_Values(__pyx_v_limit_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_limit = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6544 * worker_bytes = [ws._nbytes for ws in parent._workers_dv.values()] * limit = sum(limit_bytes.values()) * total = sum(worker_bytes) # <<<<<<<<<<<<<< * if total > 0.6 * limit: * memory = 2 * len(parent._workers_dv) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_worker_bytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_total = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6545 * limit = sum(limit_bytes.values()) * total = sum(worker_bytes) * if total > 0.6 * limit: # <<<<<<<<<<<<<< * memory = 2 * len(parent._workers_dv) * else: */ __pyx_t_6 = PyNumber_Multiply(__pyx_float_0_6, __pyx_v_limit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyObject_RichCompare(__pyx_v_total, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "distributed/scheduler.py":6546 * total = sum(worker_bytes) * if total > 0.6 * limit: * memory = 2 * len(parent._workers_dv) # <<<<<<<<<<<<<< * else: * memory = 0 */ __pyx_t_1 = __pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 6546, __pyx_L1_error) } __pyx_t_8 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_memory = (2 * __pyx_t_8); /* "distributed/scheduler.py":6545 * limit = sum(limit_bytes.values()) * total = sum(worker_bytes) * if total > 0.6 * limit: # <<<<<<<<<<<<<< * memory = 2 * len(parent._workers_dv) * else: */ goto __pyx_L22; } /* "distributed/scheduler.py":6548 * memory = 2 * len(parent._workers_dv) * else: * memory = 0 # <<<<<<<<<<<<<< * * target = max(memory, cpu) */ /*else*/ { __pyx_v_memory = 0; } __pyx_L22:; /* "distributed/scheduler.py":6550 * memory = 0 * * target = max(memory, cpu) # <<<<<<<<<<<<<< * if target >= len(parent._workers_dv): * return target */ __Pyx_INCREF(__pyx_v_cpu); __pyx_t_1 = __pyx_v_cpu; __pyx_t_8 = __pyx_v_memory; __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = __pyx_t_1; } else { __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_target = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6551 * * target = max(memory, cpu) * if target >= len(parent._workers_dv): # <<<<<<<<<<<<<< * return target * else: # Scale down? */ __pyx_t_1 = __pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 6551, __pyx_L1_error) } __pyx_t_8 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_RichCompare(__pyx_v_target, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { /* "distributed/scheduler.py":6552 * target = max(memory, cpu) * if target >= len(parent._workers_dv): * return target # <<<<<<<<<<<<<< * else: # Scale down? * to_close = self.workers_to_close() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_target); __pyx_r = __pyx_v_target; goto __pyx_L0; /* "distributed/scheduler.py":6551 * * target = max(memory, cpu) * if target >= len(parent._workers_dv): # <<<<<<<<<<<<<< * return target * else: # Scale down? */ } /* "distributed/scheduler.py":6554 * return target * else: # Scale down? * to_close = self.workers_to_close() # <<<<<<<<<<<<<< * return len(parent._workers_dv) - len(to_close) * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workers_to_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_to_close = __pyx_t_6; __pyx_t_6 = 0; /* "distributed/scheduler.py":6555 * else: # Scale down? * to_close = self.workers_to_close() * return len(parent._workers_dv) - len(to_close) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_v_parent->_workers_dv; __Pyx_INCREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 6555, __pyx_L1_error) } __pyx_t_8 = PyDict_Size(__pyx_t_6); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = PyObject_Length(__pyx_v_to_close); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6555, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_8 - __pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":6498 * self.loop.add_callback(self.close) * * def adaptive_target(self, comm=None, target_duration=None): # <<<<<<<<<<<<<< * """Desired number of workers based on the current workload * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("distributed.scheduler.Scheduler.adaptive_target", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parent); __Pyx_XDECREF(__pyx_v_cpu); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_tasks_processing); __Pyx_XDECREF(__pyx_v_limit_bytes); __Pyx_XDECREF(__pyx_v_worker_bytes); __Pyx_XDECREF(__pyx_v_limit); __Pyx_XDECREF(__pyx_v_total); __Pyx_XDECREF(__pyx_v_target); __Pyx_XDECREF(__pyx_v_to_close); __Pyx_XDECREF(__pyx_10genexpr146__pyx_v_addr); __Pyx_XDECREF((PyObject *)__pyx_10genexpr146__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_10genexpr147__pyx_v_ws); __Pyx_XDECREF(__pyx_v_target_duration); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6560 * @cfunc * @exceptval(check=False) * def _remove_from_processing(state: SchedulerState, ts: TaskState) -> str: # <<<<<<<<<<<<<< * """ * Remove *ts* from the set of processing tasks. */ static PyObject *__pyx_f_11distributed_9scheduler__remove_from_processing(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_state, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_w = 0; PyObject *__pyx_v_duration = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; double __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_remove_from_processing", 0); /* "distributed/scheduler.py":6564 * Remove *ts* from the set of processing tasks. * """ * ws: WorkerState = ts._processing_on # <<<<<<<<<<<<<< * ts._processing_on = None * w: str = ws._address */ __pyx_t_1 = ((PyObject *)__pyx_v_ts->_processing_on); __Pyx_INCREF(__pyx_t_1); __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6565 * """ * ws: WorkerState = ts._processing_on * ts._processing_on = None # <<<<<<<<<<<<<< * w: str = ws._address * if w in state._workers_dv: # may have been removed */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_ts->_processing_on); __Pyx_DECREF(((PyObject *)__pyx_v_ts->_processing_on)); __pyx_v_ts->_processing_on = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); /* "distributed/scheduler.py":6566 * ws: WorkerState = ts._processing_on * ts._processing_on = None * w: str = ws._address # <<<<<<<<<<<<<< * if w in state._workers_dv: # may have been removed * duration = ws._processing.pop(ts) */ __pyx_t_1 = __pyx_v_ws->_address; __Pyx_INCREF(__pyx_t_1); __pyx_v_w = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6567 * ts._processing_on = None * w: str = ws._address * if w in state._workers_dv: # may have been removed # <<<<<<<<<<<<<< * duration = ws._processing.pop(ts) * if not ws._processing: */ if (unlikely(__pyx_v_state->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6567, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_w, __pyx_v_state->_workers_dv, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6567, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6568 * w: str = ws._address * if w in state._workers_dv: # may have been removed * duration = ws._processing.pop(ts) # <<<<<<<<<<<<<< * if not ws._processing: * state._total_occupancy -= ws._occupancy */ if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); __PYX_ERR(0, 6568, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Pop(__pyx_v_ws->_processing, ((PyObject *)__pyx_v_ts), ((PyObject *)NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_duration = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":6569 * if w in state._workers_dv: # may have been removed * duration = ws._processing.pop(ts) * if not ws._processing: # <<<<<<<<<<<<<< * state._total_occupancy -= ws._occupancy * ws._occupancy = 0 */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_ws->_processing); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6569, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6570 * duration = ws._processing.pop(ts) * if not ws._processing: * state._total_occupancy -= ws._occupancy # <<<<<<<<<<<<<< * ws._occupancy = 0 * else: */ __pyx_v_state->_total_occupancy = (__pyx_v_state->_total_occupancy - __pyx_v_ws->_occupancy); /* "distributed/scheduler.py":6571 * if not ws._processing: * state._total_occupancy -= ws._occupancy * ws._occupancy = 0 # <<<<<<<<<<<<<< * else: * state._total_occupancy -= duration */ __pyx_v_ws->_occupancy = 0.0; /* "distributed/scheduler.py":6569 * if w in state._workers_dv: # may have been removed * duration = ws._processing.pop(ts) * if not ws._processing: # <<<<<<<<<<<<<< * state._total_occupancy -= ws._occupancy * ws._occupancy = 0 */ goto __pyx_L4; } /* "distributed/scheduler.py":6573 * ws._occupancy = 0 * else: * state._total_occupancy -= duration # <<<<<<<<<<<<<< * ws._occupancy -= duration * state.check_idle_saturated(ws) */ /*else*/ { __pyx_t_1 = PyFloat_FromDouble(__pyx_v_state->_total_occupancy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_duration); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6573, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_state->_total_occupancy = __pyx_t_5; /* "distributed/scheduler.py":6574 * else: * state._total_occupancy -= duration * ws._occupancy -= duration # <<<<<<<<<<<<<< * state.check_idle_saturated(ws) * state.release_resources(ts, ws) */ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_ws->_occupancy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_v_duration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ws->_occupancy = __pyx_t_5; } __pyx_L4:; /* "distributed/scheduler.py":6575 * state._total_occupancy -= duration * ws._occupancy -= duration * state.check_idle_saturated(ws) # <<<<<<<<<<<<<< * state.release_resources(ts, ws) * return w */ __pyx_t_1 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_state->__pyx_vtab)->check_idle_saturated(__pyx_v_state, __pyx_v_ws, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6576 * ws._occupancy -= duration * state.check_idle_saturated(ws) * state.release_resources(ts, ws) # <<<<<<<<<<<<<< * return w * else: */ __pyx_t_1 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_state->__pyx_vtab)->release_resources(__pyx_v_state, __pyx_v_ts, __pyx_v_ws, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6577 * state.check_idle_saturated(ws) * state.release_resources(ts, ws) * return w # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_w); __pyx_r = __pyx_v_w; goto __pyx_L0; /* "distributed/scheduler.py":6567 * ts._processing_on = None * w: str = ws._address * if w in state._workers_dv: # may have been removed # <<<<<<<<<<<<<< * duration = ws._processing.pop(ts) * if not ws._processing: */ } /* "distributed/scheduler.py":6579 * return w * else: * return None # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "distributed/scheduler.py":6560 * @cfunc * @exceptval(check=False) * def _remove_from_processing(state: SchedulerState, ts: TaskState) -> str: # <<<<<<<<<<<<<< * """ * Remove *ts* from the set of processing tasks. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("distributed.scheduler._remove_from_processing", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_duration); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6584 * @cfunc * @exceptval(check=False) * def _add_to_memory( # <<<<<<<<<<<<<< * state: SchedulerState, * ts: TaskState, */ static PyObject *__pyx_f_11distributed_9scheduler__add_to_memory(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_state, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws, PyObject *__pyx_v_recommendations, PyObject *__pyx_v_client_msgs, struct __pyx_opt_args_11distributed_9scheduler__add_to_memory *__pyx_optional_args) { /* "distributed/scheduler.py":6590 * recommendations: dict, * client_msgs: dict, * type=None, # <<<<<<<<<<<<<< * typename: str = None, * ): */ PyObject *__pyx_v_type = ((PyObject *)Py_None); /* "distributed/scheduler.py":6591 * client_msgs: dict, * type=None, * typename: str = None, # <<<<<<<<<<<<<< * ): * """ */ PyObject *__pyx_v_typename = ((PyObject*)Py_None); PyObject *__pyx_v_deps = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_s = 0; PyObject *__pyx_v_report_msg = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_add_to_memory", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_type = __pyx_optional_args->type; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_typename = __pyx_optional_args->typename; } } } /* "distributed/scheduler.py":6596 * Add *ts* to the set of in-memory tasks. * """ * if state._validate: # <<<<<<<<<<<<<< * assert ts not in ws._has_what * */ __pyx_t_1 = (__pyx_v_state->_validate != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6597 * """ * if state._validate: * assert ts not in ws._has_what # <<<<<<<<<<<<<< * * ts._who_has.add(ws) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6597, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_ws->_has_what, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6597, __pyx_L1_error) if (unlikely(!(__pyx_t_1 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6597, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6596 * Add *ts* to the set of in-memory tasks. * """ * if state._validate: # <<<<<<<<<<<<<< * assert ts not in ws._has_what * */ } /* "distributed/scheduler.py":6599 * assert ts not in ws._has_what * * ts._who_has.add(ws) # <<<<<<<<<<<<<< * ws._has_what.add(ts) * ws._nbytes += ts.get_nbytes() */ if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 6599, __pyx_L1_error) } __pyx_t_2 = PySet_Add(__pyx_v_ts->_who_has, ((PyObject *)__pyx_v_ws)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 6599, __pyx_L1_error) /* "distributed/scheduler.py":6600 * * ts._who_has.add(ws) * ws._has_what.add(ts) # <<<<<<<<<<<<<< * ws._nbytes += ts.get_nbytes() * */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 6600, __pyx_L1_error) } __pyx_t_2 = PySet_Add(__pyx_v_ws->_has_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 6600, __pyx_L1_error) /* "distributed/scheduler.py":6601 * ts._who_has.add(ws) * ws._has_what.add(ts) * ws._nbytes += ts.get_nbytes() # <<<<<<<<<<<<<< * * deps: list = list(ts._dependents) */ __pyx_t_3 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6601, __pyx_L1_error) __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes + __pyx_t_3); /* "distributed/scheduler.py":6603 * ws._nbytes += ts.get_nbytes() * * deps: list = list(ts._dependents) # <<<<<<<<<<<<<< * if len(deps) > 1: * deps.sort(key=operator.attrgetter("priority"), reverse=True) */ __pyx_t_4 = PySequence_List(__pyx_v_ts->_dependents); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_deps = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6604 * * deps: list = list(ts._dependents) * if len(deps) > 1: # <<<<<<<<<<<<<< * deps.sort(key=operator.attrgetter("priority"), reverse=True) * */ __pyx_t_3 = PyList_GET_SIZE(__pyx_v_deps); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6604, __pyx_L1_error) __pyx_t_1 = ((__pyx_t_3 > 1) != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6605 * deps: list = list(ts._dependents) * if len(deps) > 1: * deps.sort(key=operator.attrgetter("priority"), reverse=True) # <<<<<<<<<<<<<< * * dts: TaskState */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_deps, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_operator); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_n_u_priority) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_priority); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_t_6) < 0) __PYX_ERR(0, 6605, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_reverse, Py_True) < 0) __PYX_ERR(0, 6605, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6604 * * deps: list = list(ts._dependents) * if len(deps) > 1: # <<<<<<<<<<<<<< * deps.sort(key=operator.attrgetter("priority"), reverse=True) * */ } /* "distributed/scheduler.py":6609 * dts: TaskState * s: set * for dts in deps: # <<<<<<<<<<<<<< * s = dts._waiting_on * if ts in s: */ __pyx_t_6 = __pyx_v_deps; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 6609, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6609, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6610 * s: set * for dts in deps: * s = dts._waiting_on # <<<<<<<<<<<<<< * if ts in s: * s.discard(ts) */ __pyx_t_5 = __pyx_v_dts->_waiting_on; __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6611 * for dts in deps: * s = dts._waiting_on * if ts in s: # <<<<<<<<<<<<<< * s.discard(ts) * if not s: # new task ready to run */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6611, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6611, __pyx_L1_error) __pyx_t_9 = (__pyx_t_1 != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":6612 * s = dts._waiting_on * if ts in s: * s.discard(ts) # <<<<<<<<<<<<<< * if not s: # new task ready to run * recommendations[dts._key] = "processing" */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 6612, __pyx_L1_error) } __pyx_t_2 = __Pyx_PySet_Discard(__pyx_v_s, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 6612, __pyx_L1_error) /* "distributed/scheduler.py":6613 * if ts in s: * s.discard(ts) * if not s: # new task ready to run # <<<<<<<<<<<<<< * recommendations[dts._key] = "processing" * */ __pyx_t_9 = (__pyx_v_s != Py_None)&&(PySet_GET_SIZE(__pyx_v_s) != 0); __pyx_t_1 = ((!__pyx_t_9) != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6614 * s.discard(ts) * if not s: # new task ready to run * recommendations[dts._key] = "processing" # <<<<<<<<<<<<<< * * for dts in ts._dependencies: */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6614, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_processing_2) < 0)) __PYX_ERR(0, 6614, __pyx_L1_error) /* "distributed/scheduler.py":6613 * if ts in s: * s.discard(ts) * if not s: # new task ready to run # <<<<<<<<<<<<<< * recommendations[dts._key] = "processing" * */ } /* "distributed/scheduler.py":6611 * for dts in deps: * s = dts._waiting_on * if ts in s: # <<<<<<<<<<<<<< * s.discard(ts) * if not s: # new task ready to run */ } /* "distributed/scheduler.py":6609 * dts: TaskState * s: set * for dts in deps: # <<<<<<<<<<<<<< * s = dts._waiting_on * if ts in s: */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6616 * recommendations[dts._key] = "processing" * * for dts in ts._dependencies: # <<<<<<<<<<<<<< * s = dts._waiters * s.discard(ts) */ __pyx_t_3 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_10), (&__pyx_t_11)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_10, &__pyx_t_3, &__pyx_t_5, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 6616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6616, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6617 * * for dts in ts._dependencies: * s = dts._waiters # <<<<<<<<<<<<<< * s.discard(ts) * if not s and not dts._who_wants: */ __pyx_t_5 = __pyx_v_dts->_waiters; __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6618 * for dts in ts._dependencies: * s = dts._waiters * s.discard(ts) # <<<<<<<<<<<<<< * if not s and not dts._who_wants: * recommendations[dts._key] = "released" */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 6618, __pyx_L1_error) } __pyx_t_2 = __Pyx_PySet_Discard(__pyx_v_s, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 6618, __pyx_L1_error) /* "distributed/scheduler.py":6619 * s = dts._waiters * s.discard(ts) * if not s and not dts._who_wants: # <<<<<<<<<<<<<< * recommendations[dts._key] = "released" * */ __pyx_t_9 = (__pyx_v_s != Py_None)&&(PySet_GET_SIZE(__pyx_v_s) != 0); __pyx_t_13 = ((!__pyx_t_9) != 0); if (__pyx_t_13) { } else { __pyx_t_1 = __pyx_t_13; goto __pyx_L12_bool_binop_done; } __pyx_t_13 = (__pyx_v_dts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_wants) != 0); __pyx_t_9 = ((!__pyx_t_13) != 0); __pyx_t_1 = __pyx_t_9; __pyx_L12_bool_binop_done:; if (__pyx_t_1) { /* "distributed/scheduler.py":6620 * s.discard(ts) * if not s and not dts._who_wants: * recommendations[dts._key] = "released" # <<<<<<<<<<<<<< * * report_msg: dict = {} */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6620, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 6620, __pyx_L1_error) /* "distributed/scheduler.py":6619 * s = dts._waiters * s.discard(ts) * if not s and not dts._who_wants: # <<<<<<<<<<<<<< * recommendations[dts._key] = "released" * */ } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6622 * recommendations[dts._key] = "released" * * report_msg: dict = {} # <<<<<<<<<<<<<< * cs: ClientState * if not ts._waiters and not ts._who_wants: */ __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_report_msg = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6624 * report_msg: dict = {} * cs: ClientState * if not ts._waiters and not ts._who_wants: # <<<<<<<<<<<<<< * recommendations[ts._key] = "released" * else: */ __pyx_t_9 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); __pyx_t_13 = ((!__pyx_t_9) != 0); if (__pyx_t_13) { } else { __pyx_t_1 = __pyx_t_13; goto __pyx_L15_bool_binop_done; } __pyx_t_13 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); __pyx_t_9 = ((!__pyx_t_13) != 0); __pyx_t_1 = __pyx_t_9; __pyx_L15_bool_binop_done:; if (__pyx_t_1) { /* "distributed/scheduler.py":6625 * cs: ClientState * if not ts._waiters and not ts._who_wants: * recommendations[ts._key] = "released" # <<<<<<<<<<<<<< * else: * report_msg["op"] = "key-in-memory" */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6625, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_ts->_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 6625, __pyx_L1_error) /* "distributed/scheduler.py":6624 * report_msg: dict = {} * cs: ClientState * if not ts._waiters and not ts._who_wants: # <<<<<<<<<<<<<< * recommendations[ts._key] = "released" * else: */ goto __pyx_L14; } /* "distributed/scheduler.py":6627 * recommendations[ts._key] = "released" * else: * report_msg["op"] = "key-in-memory" # <<<<<<<<<<<<<< * report_msg["key"] = ts._key * if type is not None: */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_v_report_msg, __pyx_n_u_op, __pyx_kp_u_key_in_memory) < 0)) __PYX_ERR(0, 6627, __pyx_L1_error) /* "distributed/scheduler.py":6628 * else: * report_msg["op"] = "key-in-memory" * report_msg["key"] = ts._key # <<<<<<<<<<<<<< * if type is not None: * report_msg["type"] = type */ __pyx_t_6 = __pyx_v_ts->_key; __Pyx_INCREF(__pyx_t_6); if (unlikely(PyDict_SetItem(__pyx_v_report_msg, __pyx_n_u_key, __pyx_t_6) < 0)) __PYX_ERR(0, 6628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6629 * report_msg["op"] = "key-in-memory" * report_msg["key"] = ts._key * if type is not None: # <<<<<<<<<<<<<< * report_msg["type"] = type * */ __pyx_t_1 = (__pyx_v_type != Py_None); __pyx_t_9 = (__pyx_t_1 != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":6630 * report_msg["key"] = ts._key * if type is not None: * report_msg["type"] = type # <<<<<<<<<<<<<< * * for cs in ts._who_wants: */ if (unlikely(PyDict_SetItem(__pyx_v_report_msg, __pyx_n_u_type, __pyx_v_type) < 0)) __PYX_ERR(0, 6630, __pyx_L1_error) /* "distributed/scheduler.py":6629 * report_msg["op"] = "key-in-memory" * report_msg["key"] = ts._key * if type is not None: # <<<<<<<<<<<<<< * report_msg["type"] = type * */ } /* "distributed/scheduler.py":6632 * report_msg["type"] = type * * for cs in ts._who_wants: # <<<<<<<<<<<<<< * client_msgs[cs._client_key] = [report_msg] * */ __pyx_t_10 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_3), (&__pyx_t_11)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_3, &__pyx_t_10, &__pyx_t_5, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 6632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 6632, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6633 * * for cs in ts._who_wants: * client_msgs[cs._client_key] = [report_msg] # <<<<<<<<<<<<<< * * ts.state = "memory" */ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_report_msg); __Pyx_GIVEREF(__pyx_v_report_msg); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_report_msg); if (unlikely(__pyx_v_client_msgs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6633, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_cs->_client_key, __pyx_t_5) < 0)) __PYX_ERR(0, 6633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L14:; /* "distributed/scheduler.py":6635 * client_msgs[cs._client_key] = [report_msg] * * ts.state = "memory" # <<<<<<<<<<<<<< * ts._type = typename * ts._group._types.add(typename) */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_memory_2) < 0) __PYX_ERR(0, 6635, __pyx_L1_error) /* "distributed/scheduler.py":6636 * * ts.state = "memory" * ts._type = typename # <<<<<<<<<<<<<< * ts._group._types.add(typename) * */ __Pyx_INCREF(__pyx_v_typename); __Pyx_GIVEREF(__pyx_v_typename); __Pyx_GOTREF(__pyx_v_ts->_type); __Pyx_DECREF(__pyx_v_ts->_type); __pyx_v_ts->_type = __pyx_v_typename; /* "distributed/scheduler.py":6637 * ts.state = "memory" * ts._type = typename * ts._group._types.add(typename) # <<<<<<<<<<<<<< * * cs = state._clients["fire-and-forget"] */ if (unlikely(__pyx_v_ts->_group->_types == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(0, 6637, __pyx_L1_error) } __pyx_t_2 = PySet_Add(__pyx_v_ts->_group->_types, __pyx_v_typename); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 6637, __pyx_L1_error) /* "distributed/scheduler.py":6639 * ts._group._types.add(typename) * * cs = state._clients["fire-and-forget"] # <<<<<<<<<<<<<< * if ts in cs._wants_what: * _client_releases_keys( */ if (unlikely(__pyx_v_state->_clients == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6639, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_state->_clients, __pyx_kp_u_fire_and_forget); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 6639, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":6640 * * cs = state._clients["fire-and-forget"] * if ts in cs._wants_what: # <<<<<<<<<<<<<< * _client_releases_keys( * state, */ if (unlikely(__pyx_v_cs->_wants_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6640, __pyx_L1_error) } __pyx_t_9 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_cs->_wants_what, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 6640, __pyx_L1_error) __pyx_t_1 = (__pyx_t_9 != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6644 * state, * cs=cs, * keys=[ts._key], # <<<<<<<<<<<<<< * recommendations=recommendations, * ) */ __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_ts->_key); __Pyx_GIVEREF(__pyx_v_ts->_key); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts->_key); /* "distributed/scheduler.py":6642 * if ts in cs._wants_what: * _client_releases_keys( * state, # <<<<<<<<<<<<<< * cs=cs, * keys=[ts._key], */ __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); /* "distributed/scheduler.py":6641 * cs = state._clients["fire-and-forget"] * if ts in cs._wants_what: * _client_releases_keys( # <<<<<<<<<<<<<< * state, * cs=cs, */ __pyx_t_4 = __pyx_f_11distributed_9scheduler__client_releases_keys(__pyx_v_state, ((PyObject*)__pyx_t_5), __pyx_v_cs, __pyx_v_recommendations); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (void)(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6640 * * cs = state._clients["fire-and-forget"] * if ts in cs._wants_what: # <<<<<<<<<<<<<< * _client_releases_keys( * state, */ } /* "distributed/scheduler.py":6584 * @cfunc * @exceptval(check=False) * def _add_to_memory( # <<<<<<<<<<<<<< * state: SchedulerState, * ts: TaskState, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("distributed.scheduler._add_to_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_deps); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_report_msg); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6651 * @cfunc * @exceptval(check=False) * def _propagate_forgotten( # <<<<<<<<<<<<<< * state: SchedulerState, ts: TaskState, recommendations: dict, worker_msgs: dict * ): */ static PyObject *__pyx_f_11distributed_9scheduler__propagate_forgotten(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_state, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, PyObject *__pyx_v_recommendations, PyObject *__pyx_v_worker_msgs) { PyObject *__pyx_v_key = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; PyObject *__pyx_v_s = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_w = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_t_12 = NULL; Py_ssize_t __pyx_t_13; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_propagate_forgotten", 0); /* "distributed/scheduler.py":6654 * state: SchedulerState, ts: TaskState, recommendations: dict, worker_msgs: dict * ): * ts.state = "forgotten" # <<<<<<<<<<<<<< * key: str = ts._key * dts: TaskState */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ts), __pyx_n_s_state, __pyx_n_u_forgotten) < 0) __PYX_ERR(0, 6654, __pyx_L1_error) /* "distributed/scheduler.py":6655 * ): * ts.state = "forgotten" * key: str = ts._key # <<<<<<<<<<<<<< * dts: TaskState * for dts in ts._dependents: */ __pyx_t_1 = __pyx_v_ts->_key; __Pyx_INCREF(__pyx_t_1); __pyx_v_key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6657 * key: str = ts._key * dts: TaskState * for dts in ts._dependents: # <<<<<<<<<<<<<< * dts._has_lost_dependencies = True * dts._dependencies.remove(ts) */ __pyx_t_2 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_ts->_dependents, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 6657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6657, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6658 * dts: TaskState * for dts in ts._dependents: * dts._has_lost_dependencies = True # <<<<<<<<<<<<<< * dts._dependencies.remove(ts) * dts._waiting_on.discard(ts) */ __pyx_v_dts->_has_lost_dependencies = 1; /* "distributed/scheduler.py":6659 * for dts in ts._dependents: * dts._has_lost_dependencies = True * dts._dependencies.remove(ts) # <<<<<<<<<<<<<< * dts._waiting_on.discard(ts) * if dts._state not in ("memory", "erred"): */ if (unlikely(__pyx_v_dts->_dependencies == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 6659, __pyx_L1_error) } __pyx_t_7 = __Pyx_PySet_Remove(__pyx_v_dts->_dependencies, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6659, __pyx_L1_error) /* "distributed/scheduler.py":6660 * dts._has_lost_dependencies = True * dts._dependencies.remove(ts) * dts._waiting_on.discard(ts) # <<<<<<<<<<<<<< * if dts._state not in ("memory", "erred"): * # Cannot compute task anymore */ if (unlikely(__pyx_v_dts->_waiting_on == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 6660, __pyx_L1_error) } __pyx_t_7 = __Pyx_PySet_Discard(__pyx_v_dts->_waiting_on, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6660, __pyx_L1_error) /* "distributed/scheduler.py":6661 * dts._dependencies.remove(ts) * dts._waiting_on.discard(ts) * if dts._state not in ("memory", "erred"): # <<<<<<<<<<<<<< * # Cannot compute task anymore * recommendations[dts._key] = "forgotten" */ __Pyx_INCREF(__pyx_v_dts->_state); __pyx_t_8 = __pyx_v_dts->_state; __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_n_u_memory_2, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 6661, __pyx_L1_error) __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { } else { __pyx_t_9 = __pyx_t_11; goto __pyx_L6_bool_binop_done; } __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_n_u_erred, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 6661, __pyx_L1_error) __pyx_t_10 = (__pyx_t_11 != 0); __pyx_t_9 = __pyx_t_10; __pyx_L6_bool_binop_done:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":6663 * if dts._state not in ("memory", "erred"): * # Cannot compute task anymore * recommendations[dts._key] = "forgotten" # <<<<<<<<<<<<<< * ts._dependents.clear() * ts._waiters.clear() */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6663, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_forgotten) < 0)) __PYX_ERR(0, 6663, __pyx_L1_error) /* "distributed/scheduler.py":6661 * dts._dependencies.remove(ts) * dts._waiting_on.discard(ts) * if dts._state not in ("memory", "erred"): # <<<<<<<<<<<<<< * # Cannot compute task anymore * recommendations[dts._key] = "forgotten" */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6664 * # Cannot compute task anymore * recommendations[dts._key] = "forgotten" * ts._dependents.clear() # <<<<<<<<<<<<<< * ts._waiters.clear() * */ if (unlikely(__pyx_v_ts->_dependents == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 6664, __pyx_L1_error) } __pyx_t_7 = PySet_Clear(__pyx_v_ts->_dependents); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6664, __pyx_L1_error) /* "distributed/scheduler.py":6665 * recommendations[dts._key] = "forgotten" * ts._dependents.clear() * ts._waiters.clear() # <<<<<<<<<<<<<< * * for dts in ts._dependencies: */ if (unlikely(__pyx_v_ts->_waiters == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 6665, __pyx_L1_error) } __pyx_t_7 = PySet_Clear(__pyx_v_ts->_waiters); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6665, __pyx_L1_error) /* "distributed/scheduler.py":6667 * ts._waiters.clear() * * for dts in ts._dependencies: # <<<<<<<<<<<<<< * dts._dependents.remove(ts) * s: set = dts._waiters */ __pyx_t_3 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_3, &__pyx_t_5, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 6667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6667, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6668 * * for dts in ts._dependencies: * dts._dependents.remove(ts) # <<<<<<<<<<<<<< * s: set = dts._waiters * s.discard(ts) */ if (unlikely(__pyx_v_dts->_dependents == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 6668, __pyx_L1_error) } __pyx_t_7 = __Pyx_PySet_Remove(__pyx_v_dts->_dependents, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6668, __pyx_L1_error) /* "distributed/scheduler.py":6669 * for dts in ts._dependencies: * dts._dependents.remove(ts) * s: set = dts._waiters # <<<<<<<<<<<<<< * s.discard(ts) * if not dts._dependents and not dts._who_wants: */ __pyx_t_5 = __pyx_v_dts->_waiters; __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6670 * dts._dependents.remove(ts) * s: set = dts._waiters * s.discard(ts) # <<<<<<<<<<<<<< * if not dts._dependents and not dts._who_wants: * # Task not needed anymore */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); __PYX_ERR(0, 6670, __pyx_L1_error) } __pyx_t_7 = __Pyx_PySet_Discard(__pyx_v_s, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6670, __pyx_L1_error) /* "distributed/scheduler.py":6671 * s: set = dts._waiters * s.discard(ts) * if not dts._dependents and not dts._who_wants: # <<<<<<<<<<<<<< * # Task not needed anymore * assert dts is not ts */ __pyx_t_9 = (__pyx_v_dts->_dependents != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_dependents) != 0); __pyx_t_11 = ((!__pyx_t_9) != 0); if (__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L11_bool_binop_done; } __pyx_t_11 = (__pyx_v_dts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_wants) != 0); __pyx_t_9 = ((!__pyx_t_11) != 0); __pyx_t_10 = __pyx_t_9; __pyx_L11_bool_binop_done:; if (__pyx_t_10) { /* "distributed/scheduler.py":6673 * if not dts._dependents and not dts._who_wants: * # Task not needed anymore * assert dts is not ts # <<<<<<<<<<<<<< * recommendations[dts._key] = "forgotten" * ts._dependencies.clear() */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_10 = (__pyx_v_dts != __pyx_v_ts); if (unlikely(!(__pyx_t_10 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6673, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6674 * # Task not needed anymore * assert dts is not ts * recommendations[dts._key] = "forgotten" # <<<<<<<<<<<<<< * ts._dependencies.clear() * ts._waiting_on.clear() */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6674, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_dts->_key, __pyx_n_u_forgotten) < 0)) __PYX_ERR(0, 6674, __pyx_L1_error) /* "distributed/scheduler.py":6671 * s: set = dts._waiters * s.discard(ts) * if not dts._dependents and not dts._who_wants: # <<<<<<<<<<<<<< * # Task not needed anymore * assert dts is not ts */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6675 * assert dts is not ts * recommendations[dts._key] = "forgotten" * ts._dependencies.clear() # <<<<<<<<<<<<<< * ts._waiting_on.clear() * */ if (unlikely(__pyx_v_ts->_dependencies == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 6675, __pyx_L1_error) } __pyx_t_7 = PySet_Clear(__pyx_v_ts->_dependencies); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6675, __pyx_L1_error) /* "distributed/scheduler.py":6676 * recommendations[dts._key] = "forgotten" * ts._dependencies.clear() * ts._waiting_on.clear() # <<<<<<<<<<<<<< * * if ts._who_has: */ if (unlikely(__pyx_v_ts->_waiting_on == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 6676, __pyx_L1_error) } __pyx_t_7 = PySet_Clear(__pyx_v_ts->_waiting_on); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6676, __pyx_L1_error) /* "distributed/scheduler.py":6678 * ts._waiting_on.clear() * * if ts._who_has: # <<<<<<<<<<<<<< * ts._group._nbytes_in_memory -= ts.get_nbytes() * */ __pyx_t_10 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (__pyx_t_10) { /* "distributed/scheduler.py":6679 * * if ts._who_has: * ts._group._nbytes_in_memory -= ts.get_nbytes() # <<<<<<<<<<<<<< * * ws: WorkerState */ __Pyx_INCREF(((PyObject *)__pyx_v_ts->_group)); __pyx_t_12 = __pyx_v_ts->_group; __pyx_t_2 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6679, __pyx_L1_error) __pyx_t_12->_nbytes_in_memory = (__pyx_t_12->_nbytes_in_memory - __pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; /* "distributed/scheduler.py":6678 * ts._waiting_on.clear() * * if ts._who_has: # <<<<<<<<<<<<<< * ts._group._nbytes_in_memory -= ts.get_nbytes() * */ } /* "distributed/scheduler.py":6682 * * ws: WorkerState * for ws in ts._who_has: # <<<<<<<<<<<<<< * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() */ __pyx_t_2 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_ts->_who_has, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 6682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6682, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6683 * ws: WorkerState * for ws in ts._who_has: * ws._has_what.remove(ts) # <<<<<<<<<<<<<< * ws._nbytes -= ts.get_nbytes() * w: str = ws._address */ if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 6683, __pyx_L1_error) } __pyx_t_7 = __Pyx_PySet_Remove(__pyx_v_ws->_has_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6683, __pyx_L1_error) /* "distributed/scheduler.py":6684 * for ws in ts._who_has: * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() # <<<<<<<<<<<<<< * w: str = ws._address * if w in state._workers_dv: # in case worker has died */ __pyx_t_13 = __pyx_f_11distributed_9scheduler_9TaskState_get_nbytes(__pyx_v_ts, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6684, __pyx_L1_error) __pyx_v_ws->_nbytes = (__pyx_v_ws->_nbytes - __pyx_t_13); /* "distributed/scheduler.py":6685 * ws._has_what.remove(ts) * ws._nbytes -= ts.get_nbytes() * w: str = ws._address # <<<<<<<<<<<<<< * if w in state._workers_dv: # in case worker has died * worker_msgs[w] = [{"op": "delete-data", "keys": [key], "report": False}] */ __pyx_t_5 = __pyx_v_ws->_address; __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_w, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6686 * ws._nbytes -= ts.get_nbytes() * w: str = ws._address * if w in state._workers_dv: # in case worker has died # <<<<<<<<<<<<<< * worker_msgs[w] = [{"op": "delete-data", "keys": [key], "report": False}] * ts._who_has.clear() */ if (unlikely(__pyx_v_state->_workers_dv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6686, __pyx_L1_error) } __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_w, __pyx_v_state->_workers_dv, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 6686, __pyx_L1_error) __pyx_t_9 = (__pyx_t_10 != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":6687 * w: str = ws._address * if w in state._workers_dv: # in case worker has died * worker_msgs[w] = [{"op": "delete-data", "keys": [key], "report": False}] # <<<<<<<<<<<<<< * ts._who_has.clear() * */ __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_op, __pyx_kp_u_delete_data) < 0) __PYX_ERR(0, 6687, __pyx_L1_error) __pyx_t_14 = PyList_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 6687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyList_SET_ITEM(__pyx_t_14, 0, __pyx_v_key); if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_keys, __pyx_t_14) < 0) __PYX_ERR(0, 6687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_report, Py_False) < 0) __PYX_ERR(0, 6687, __pyx_L1_error) __pyx_t_14 = PyList_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 6687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_worker_msgs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6687, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_worker_msgs, __pyx_v_w, __pyx_t_14) < 0)) __PYX_ERR(0, 6687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "distributed/scheduler.py":6686 * ws._nbytes -= ts.get_nbytes() * w: str = ws._address * if w in state._workers_dv: # in case worker has died # <<<<<<<<<<<<<< * worker_msgs[w] = [{"op": "delete-data", "keys": [key], "report": False}] * ts._who_has.clear() */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6688 * if w in state._workers_dv: # in case worker has died * worker_msgs[w] = [{"op": "delete-data", "keys": [key], "report": False}] * ts._who_has.clear() # <<<<<<<<<<<<<< * * */ if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(0, 6688, __pyx_L1_error) } __pyx_t_7 = PySet_Clear(__pyx_v_ts->_who_has); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 6688, __pyx_L1_error) /* "distributed/scheduler.py":6651 * @cfunc * @exceptval(check=False) * def _propagate_forgotten( # <<<<<<<<<<<<<< * state: SchedulerState, ts: TaskState, recommendations: dict, worker_msgs: dict * ): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(((PyObject *)__pyx_t_12)); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("distributed.scheduler._propagate_forgotten", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_w); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6693 * @cfunc * @exceptval(check=False) * def _client_releases_keys( # <<<<<<<<<<<<<< * state: SchedulerState, keys: list, cs: ClientState, recommendations: dict * ): */ static PyObject *__pyx_f_11distributed_9scheduler__client_releases_keys(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_state, PyObject *__pyx_v_keys, struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs, PyObject *__pyx_v_recommendations) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_v_tasks2 = 0; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_s = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_client_releases_keys", 0); /* "distributed/scheduler.py":6697 * ): * """ Remove keys from client desired list """ * logger.debug("Client %s releases keys: %s", cs._client_key, keys) # <<<<<<<<<<<<<< * ts: TaskState * tasks2: set = set() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Client_s_releases_keys_s, __pyx_v_cs->_client_key, __pyx_v_keys}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6697, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Client_s_releases_keys_s, __pyx_v_cs->_client_key, __pyx_v_keys}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6697, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_u_Client_s_releases_keys_s); __Pyx_GIVEREF(__pyx_kp_u_Client_s_releases_keys_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_u_Client_s_releases_keys_s); __Pyx_INCREF(__pyx_v_cs->_client_key); __Pyx_GIVEREF(__pyx_v_cs->_client_key); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_cs->_client_key); __Pyx_INCREF(__pyx_v_keys); __Pyx_GIVEREF(__pyx_v_keys); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_keys); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6699 * logger.debug("Client %s releases keys: %s", cs._client_key, keys) * ts: TaskState * tasks2: set = set() # <<<<<<<<<<<<<< * for key in keys: * ts = state._tasks.get(key) */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tasks2 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6700 * ts: TaskState * tasks2: set = set() * for key in keys: # <<<<<<<<<<<<<< * ts = state._tasks.get(key) * if ts is not None and ts in cs._wants_what: */ if (unlikely(__pyx_v_keys == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6700, __pyx_L1_error) } __pyx_t_1 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 6700, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6701 * tasks2: set = set() * for key in keys: * ts = state._tasks.get(key) # <<<<<<<<<<<<<< * if ts is not None and ts in cs._wants_what: * cs._wants_what.remove(ts) */ if (unlikely(__pyx_v_state->_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 6701, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_state->_tasks, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6701, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":6702 * for key in keys: * ts = state._tasks.get(key) * if ts is not None and ts in cs._wants_what: # <<<<<<<<<<<<<< * cs._wants_what.remove(ts) * s: set = ts._who_wants */ __pyx_t_8 = (((PyObject *)__pyx_v_ts) != Py_None); __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } if (unlikely(__pyx_v_cs->_wants_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6702, __pyx_L1_error) } __pyx_t_9 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_cs->_wants_what, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 6702, __pyx_L1_error) __pyx_t_8 = (__pyx_t_9 != 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "distributed/scheduler.py":6703 * ts = state._tasks.get(key) * if ts is not None and ts in cs._wants_what: * cs._wants_what.remove(ts) # <<<<<<<<<<<<<< * s: set = ts._who_wants * s.remove(cs) */ if (unlikely(__pyx_v_cs->_wants_what == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 6703, __pyx_L1_error) } __pyx_t_10 = __Pyx_PySet_Remove(__pyx_v_cs->_wants_what, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 6703, __pyx_L1_error) /* "distributed/scheduler.py":6704 * if ts is not None and ts in cs._wants_what: * cs._wants_what.remove(ts) * s: set = ts._who_wants # <<<<<<<<<<<<<< * s.remove(cs) * if not s: */ __pyx_t_3 = __pyx_v_ts->_who_wants; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":6705 * cs._wants_what.remove(ts) * s: set = ts._who_wants * s.remove(cs) # <<<<<<<<<<<<<< * if not s: * tasks2.add(ts) */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove"); __PYX_ERR(0, 6705, __pyx_L1_error) } __pyx_t_10 = __Pyx_PySet_Remove(__pyx_v_s, ((PyObject *)__pyx_v_cs)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 6705, __pyx_L1_error) /* "distributed/scheduler.py":6706 * s: set = ts._who_wants * s.remove(cs) * if not s: # <<<<<<<<<<<<<< * tasks2.add(ts) * */ __pyx_t_7 = (__pyx_v_s != Py_None)&&(PySet_GET_SIZE(__pyx_v_s) != 0); __pyx_t_8 = ((!__pyx_t_7) != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":6707 * s.remove(cs) * if not s: * tasks2.add(ts) # <<<<<<<<<<<<<< * * for ts in tasks2: */ __pyx_t_10 = PySet_Add(__pyx_v_tasks2, ((PyObject *)__pyx_v_ts)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 6707, __pyx_L1_error) /* "distributed/scheduler.py":6706 * s: set = ts._who_wants * s.remove(cs) * if not s: # <<<<<<<<<<<<<< * tasks2.add(ts) * */ } /* "distributed/scheduler.py":6702 * for key in keys: * ts = state._tasks.get(key) * if ts is not None and ts in cs._wants_what: # <<<<<<<<<<<<<< * cs._wants_what.remove(ts) * s: set = ts._who_wants */ } /* "distributed/scheduler.py":6700 * ts: TaskState * tasks2: set = set() * for key in keys: # <<<<<<<<<<<<<< * ts = state._tasks.get(key) * if ts is not None and ts in cs._wants_what: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6709 * tasks2.add(ts) * * for ts in tasks2: # <<<<<<<<<<<<<< * if not ts._dependents: * # No live dependents, can forget */ __pyx_t_6 = 0; __pyx_t_3 = __Pyx_set_iterator(__pyx_v_tasks2, 1, (&__pyx_t_11), (&__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_11, &__pyx_t_6, &__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 6709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6709, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3)); __pyx_t_3 = 0; /* "distributed/scheduler.py":6710 * * for ts in tasks2: * if not ts._dependents: # <<<<<<<<<<<<<< * # No live dependents, can forget * recommendations[ts._key] = "forgotten" */ __pyx_t_8 = (__pyx_v_ts->_dependents != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_dependents) != 0); __pyx_t_7 = ((!__pyx_t_8) != 0); if (__pyx_t_7) { /* "distributed/scheduler.py":6712 * if not ts._dependents: * # No live dependents, can forget * recommendations[ts._key] = "forgotten" # <<<<<<<<<<<<<< * elif ts._state != "erred" and not ts._waiters: * recommendations[ts._key] = "released" */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6712, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_ts->_key, __pyx_n_u_forgotten) < 0)) __PYX_ERR(0, 6712, __pyx_L1_error) /* "distributed/scheduler.py":6710 * * for ts in tasks2: * if not ts._dependents: # <<<<<<<<<<<<<< * # No live dependents, can forget * recommendations[ts._key] = "forgotten" */ goto __pyx_L11; } /* "distributed/scheduler.py":6713 * # No live dependents, can forget * recommendations[ts._key] = "forgotten" * elif ts._state != "erred" and not ts._waiters: # <<<<<<<<<<<<<< * recommendations[ts._key] = "released" * */ __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_erred, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 6713, __pyx_L1_error) __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L12_bool_binop_done; } __pyx_t_9 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); __pyx_t_8 = ((!__pyx_t_9) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L12_bool_binop_done:; if (__pyx_t_7) { /* "distributed/scheduler.py":6714 * recommendations[ts._key] = "forgotten" * elif ts._state != "erred" and not ts._waiters: * recommendations[ts._key] = "released" # <<<<<<<<<<<<<< * * */ if (unlikely(__pyx_v_recommendations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 6714, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_recommendations, __pyx_v_ts->_key, __pyx_n_u_released) < 0)) __PYX_ERR(0, 6714, __pyx_L1_error) /* "distributed/scheduler.py":6713 * # No live dependents, can forget * recommendations[ts._key] = "forgotten" * elif ts._state != "erred" and not ts._waiters: # <<<<<<<<<<<<<< * recommendations[ts._key] = "released" * */ } __pyx_L11:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6693 * @cfunc * @exceptval(check=False) * def _client_releases_keys( # <<<<<<<<<<<<<< * state: SchedulerState, keys: list, cs: ClientState, recommendations: dict * ): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler._client_releases_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_tasks2); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6719 * @cfunc * @exceptval(check=False) * def _task_to_msg(state: SchedulerState, ts: TaskState, duration=None) -> dict: # <<<<<<<<<<<<<< * """ Convert a single computational task to a message """ * ws: WorkerState */ static PyObject *__pyx_f_11distributed_9scheduler__task_to_msg(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_state, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, struct __pyx_opt_args_11distributed_9scheduler__task_to_msg *__pyx_optional_args) { PyObject *__pyx_v_duration = ((PyObject *)Py_None); PyObject *__pyx_v_msg = 0; PyObject *__pyx_v_deps = 0; PyObject *__pyx_v_task = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr148__pyx_v_dts = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr149__pyx_v_ws = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr150__pyx_v_dts = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; double __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; Py_ssize_t __pyx_t_13; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_task_to_msg", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_duration = __pyx_optional_args->duration; } } __Pyx_INCREF(__pyx_v_duration); /* "distributed/scheduler.py":6724 * dts: TaskState * * if duration is None: # <<<<<<<<<<<<<< * duration = state.get_task_duration(ts) * */ __pyx_t_1 = (__pyx_v_duration == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6725 * * if duration is None: * duration = state.get_task_duration(ts) # <<<<<<<<<<<<<< * * msg: dict = { */ __pyx_t_3 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_state->__pyx_vtab)->get_task_duration(__pyx_v_state, __pyx_v_ts, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6725, __pyx_L1_error) __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_duration, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6724 * dts: TaskState * * if duration is None: # <<<<<<<<<<<<<< * duration = state.get_task_duration(ts) * */ } /* "distributed/scheduler.py":6728 * * msg: dict = { * "op": "compute-task", # <<<<<<<<<<<<<< * "key": ts._key, * "priority": ts._priority, */ __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_op, __pyx_kp_u_compute_task) < 0) __PYX_ERR(0, 6728, __pyx_L1_error) /* "distributed/scheduler.py":6729 * msg: dict = { * "op": "compute-task", * "key": ts._key, # <<<<<<<<<<<<<< * "priority": ts._priority, * "duration": duration, */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_key, __pyx_v_ts->_key) < 0) __PYX_ERR(0, 6728, __pyx_L1_error) /* "distributed/scheduler.py":6730 * "op": "compute-task", * "key": ts._key, * "priority": ts._priority, # <<<<<<<<<<<<<< * "duration": duration, * } */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_priority, __pyx_v_ts->_priority) < 0) __PYX_ERR(0, 6728, __pyx_L1_error) /* "distributed/scheduler.py":6731 * "key": ts._key, * "priority": ts._priority, * "duration": duration, # <<<<<<<<<<<<<< * } * if ts._resource_restrictions: */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_duration, __pyx_v_duration) < 0) __PYX_ERR(0, 6728, __pyx_L1_error) __pyx_v_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6733 * "duration": duration, * } * if ts._resource_restrictions: # <<<<<<<<<<<<<< * msg["resource_restrictions"] = ts._resource_restrictions * if ts._actor: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_resource_restrictions); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6733, __pyx_L1_error) if (__pyx_t_2) { /* "distributed/scheduler.py":6734 * } * if ts._resource_restrictions: * msg["resource_restrictions"] = ts._resource_restrictions # <<<<<<<<<<<<<< * if ts._actor: * msg["actor"] = True */ __pyx_t_4 = __pyx_v_ts->_resource_restrictions; __Pyx_INCREF(__pyx_t_4); if (unlikely(PyDict_SetItem(__pyx_v_msg, __pyx_n_u_resource_restrictions, __pyx_t_4) < 0)) __PYX_ERR(0, 6734, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6733 * "duration": duration, * } * if ts._resource_restrictions: # <<<<<<<<<<<<<< * msg["resource_restrictions"] = ts._resource_restrictions * if ts._actor: */ } /* "distributed/scheduler.py":6735 * if ts._resource_restrictions: * msg["resource_restrictions"] = ts._resource_restrictions * if ts._actor: # <<<<<<<<<<<<<< * msg["actor"] = True * */ __pyx_t_2 = (__pyx_v_ts->_actor != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6736 * msg["resource_restrictions"] = ts._resource_restrictions * if ts._actor: * msg["actor"] = True # <<<<<<<<<<<<<< * * deps: set = ts._dependencies */ if (unlikely(PyDict_SetItem(__pyx_v_msg, __pyx_n_u_actor, Py_True) < 0)) __PYX_ERR(0, 6736, __pyx_L1_error) /* "distributed/scheduler.py":6735 * if ts._resource_restrictions: * msg["resource_restrictions"] = ts._resource_restrictions * if ts._actor: # <<<<<<<<<<<<<< * msg["actor"] = True * */ } /* "distributed/scheduler.py":6738 * msg["actor"] = True * * deps: set = ts._dependencies # <<<<<<<<<<<<<< * if deps: * msg["who_has"] = { */ __pyx_t_4 = __pyx_v_ts->_dependencies; __Pyx_INCREF(__pyx_t_4); __pyx_v_deps = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6739 * * deps: set = ts._dependencies * if deps: # <<<<<<<<<<<<<< * msg["who_has"] = { * dts._key: [ws._address for ws in dts._who_has] for dts in deps */ __pyx_t_2 = (__pyx_v_deps != Py_None)&&(PySet_GET_SIZE(__pyx_v_deps) != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6740 * deps: set = ts._dependencies * if deps: * msg["who_has"] = { # <<<<<<<<<<<<<< * dts._key: [ws._address for ws in dts._who_has] for dts in deps * } */ { /* enter inner scope */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6740, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":6741 * if deps: * msg["who_has"] = { * dts._key: [ws._address for ws in dts._who_has] for dts in deps # <<<<<<<<<<<<<< * } * msg["nbytes"] = {dts._key: dts._nbytes for dts in deps} */ __pyx_t_6 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_v_deps, 1, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6741, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_5, __pyx_t_7, &__pyx_t_6, &__pyx_t_9, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6741, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6741, __pyx_L9_error) __Pyx_XDECREF_SET(__pyx_10genexpr148__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; { /* enter inner scope */ __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6741, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = 0; __pyx_t_14 = __Pyx_set_iterator(__pyx_10genexpr148__pyx_v_dts->_who_has, 1, (&__pyx_t_13), (&__pyx_t_10)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 6741, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = __pyx_t_14; __pyx_t_14 = 0; while (1) { __pyx_t_15 = __Pyx_set_iter_next(__pyx_t_11, __pyx_t_13, &__pyx_t_12, &__pyx_t_14, __pyx_t_10); if (unlikely(__pyx_t_15 == 0)) break; if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 6741, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_14); if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6741, __pyx_L14_error) __Pyx_XDECREF_SET(__pyx_10genexpr149__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_14)); __pyx_t_14 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_10genexpr149__pyx_v_ws->_address))) __PYX_ERR(0, 6741, __pyx_L14_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr149__pyx_v_ws); __pyx_10genexpr149__pyx_v_ws = 0; goto __pyx_L17_exit_scope; __pyx_L14_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr149__pyx_v_ws); __pyx_10genexpr149__pyx_v_ws = 0; goto __pyx_L9_error; __pyx_L17_exit_scope:; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_10genexpr148__pyx_v_dts->_key, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 6741, __pyx_L9_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr148__pyx_v_dts); __pyx_10genexpr148__pyx_v_dts = 0; goto __pyx_L18_exit_scope; __pyx_L9_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr148__pyx_v_dts); __pyx_10genexpr148__pyx_v_dts = 0; goto __pyx_L1_error; __pyx_L18_exit_scope:; } /* exit inner scope */ /* "distributed/scheduler.py":6740 * deps: set = ts._dependencies * if deps: * msg["who_has"] = { # <<<<<<<<<<<<<< * dts._key: [ws._address for ws in dts._who_has] for dts in deps * } */ if (unlikely(PyDict_SetItem(__pyx_v_msg, __pyx_n_u_who_has, __pyx_t_4) < 0)) __PYX_ERR(0, 6740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6743 * dts._key: [ws._address for ws in dts._who_has] for dts in deps * } * msg["nbytes"] = {dts._key: dts._nbytes for dts in deps} # <<<<<<<<<<<<<< * * if state._validate: */ { /* enter inner scope */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6743, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_v_deps, 1, (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6743, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_7, &__pyx_t_9, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6743, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6743, __pyx_L21_error) __Pyx_XDECREF_SET(__pyx_10genexpr150__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_t_9 = PyInt_FromSsize_t(__pyx_10genexpr150__pyx_v_dts->_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6743, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_10genexpr150__pyx_v_dts->_key, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 6743, __pyx_L21_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr150__pyx_v_dts); __pyx_10genexpr150__pyx_v_dts = 0; goto __pyx_L24_exit_scope; __pyx_L21_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr150__pyx_v_dts); __pyx_10genexpr150__pyx_v_dts = 0; goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ if (unlikely(PyDict_SetItem(__pyx_v_msg, __pyx_n_u_nbytes, __pyx_t_4) < 0)) __PYX_ERR(0, 6743, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6745 * msg["nbytes"] = {dts._key: dts._nbytes for dts in deps} * * if state._validate: # <<<<<<<<<<<<<< * assert all(msg["who_has"].values()) * */ __pyx_t_2 = (__pyx_v_state->_validate != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6746 * * if state._validate: * assert all(msg["who_has"].values()) # <<<<<<<<<<<<<< * * task = ts._run_spec */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_msg, __pyx_n_u_who_has); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_values); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6746, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6745 * msg["nbytes"] = {dts._key: dts._nbytes for dts in deps} * * if state._validate: # <<<<<<<<<<<<<< * assert all(msg["who_has"].values()) * */ } /* "distributed/scheduler.py":6739 * * deps: set = ts._dependencies * if deps: # <<<<<<<<<<<<<< * msg["who_has"] = { * dts._key: [ws._address for ws in dts._who_has] for dts in deps */ } /* "distributed/scheduler.py":6748 * assert all(msg["who_has"].values()) * * task = ts._run_spec # <<<<<<<<<<<<<< * if type(task) is dict: * msg.update(task) */ __pyx_t_9 = __pyx_v_ts->_run_spec; __Pyx_INCREF(__pyx_t_9); __pyx_v_task = __pyx_t_9; __pyx_t_9 = 0; /* "distributed/scheduler.py":6749 * * task = ts._run_spec * if type(task) is dict: # <<<<<<<<<<<<<< * msg.update(task) * else: */ __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_task)) == ((PyObject *)(&PyDict_Type))); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6750 * task = ts._run_spec * if type(task) is dict: * msg.update(task) # <<<<<<<<<<<<<< * else: * msg["task"] = task */ __pyx_t_9 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_msg, __pyx_v_task); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":6749 * * task = ts._run_spec * if type(task) is dict: # <<<<<<<<<<<<<< * msg.update(task) * else: */ goto __pyx_L26; } /* "distributed/scheduler.py":6752 * msg.update(task) * else: * msg["task"] = task # <<<<<<<<<<<<<< * * return msg */ /*else*/ { if (unlikely(PyDict_SetItem(__pyx_v_msg, __pyx_n_u_task, __pyx_v_task) < 0)) __PYX_ERR(0, 6752, __pyx_L1_error) } __pyx_L26:; /* "distributed/scheduler.py":6754 * msg["task"] = task * * return msg # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; /* "distributed/scheduler.py":6719 * @cfunc * @exceptval(check=False) * def _task_to_msg(state: SchedulerState, ts: TaskState, duration=None) -> dict: # <<<<<<<<<<<<<< * """ Convert a single computational task to a message """ * ws: WorkerState */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("distributed.scheduler._task_to_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_deps); __Pyx_XDECREF(__pyx_v_task); __Pyx_XDECREF((PyObject *)__pyx_10genexpr148__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_10genexpr149__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_10genexpr150__pyx_v_dts); __Pyx_XDECREF(__pyx_v_duration); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6759 * @cfunc * @exceptval(check=False) * def _task_to_report_msg(state: SchedulerState, ts: TaskState) -> dict: # <<<<<<<<<<<<<< * if ts is None: * return {"op": "cancelled-key", "key": ts._key} */ static PyObject *__pyx_f_11distributed_9scheduler__task_to_report_msg(CYTHON_UNUSED struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_state, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_failing_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_task_to_report_msg", 0); /* "distributed/scheduler.py":6760 * @exceptval(check=False) * def _task_to_report_msg(state: SchedulerState, ts: TaskState) -> dict: * if ts is None: # <<<<<<<<<<<<<< * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "forgotten": */ __pyx_t_1 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6761 * def _task_to_report_msg(state: SchedulerState, ts: TaskState) -> dict: * if ts is None: * return {"op": "cancelled-key", "key": ts._key} # <<<<<<<<<<<<<< * elif ts._state == "forgotten": * return {"op": "cancelled-key", "key": ts._key} */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_op, __pyx_kp_u_cancelled_key) < 0) __PYX_ERR(0, 6761, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_key, __pyx_v_ts->_key) < 0) __PYX_ERR(0, 6761, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6760 * @exceptval(check=False) * def _task_to_report_msg(state: SchedulerState, ts: TaskState) -> dict: * if ts is None: # <<<<<<<<<<<<<< * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "forgotten": */ } /* "distributed/scheduler.py":6762 * if ts is None: * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "forgotten": # <<<<<<<<<<<<<< * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "memory": */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_forgotten, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6762, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6763 * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "forgotten": * return {"op": "cancelled-key", "key": ts._key} # <<<<<<<<<<<<<< * elif ts._state == "memory": * return {"op": "key-in-memory", "key": ts._key} */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_op, __pyx_kp_u_cancelled_key) < 0) __PYX_ERR(0, 6763, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_key, __pyx_v_ts->_key) < 0) __PYX_ERR(0, 6763, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6762 * if ts is None: * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "forgotten": # <<<<<<<<<<<<<< * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "memory": */ } /* "distributed/scheduler.py":6764 * elif ts._state == "forgotten": * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "memory": # <<<<<<<<<<<<<< * return {"op": "key-in-memory", "key": ts._key} * elif ts._state == "erred": */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6764, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6765 * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "memory": * return {"op": "key-in-memory", "key": ts._key} # <<<<<<<<<<<<<< * elif ts._state == "erred": * failing_ts: TaskState = ts._exception_blame */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_op, __pyx_kp_u_key_in_memory) < 0) __PYX_ERR(0, 6765, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_key, __pyx_v_ts->_key) < 0) __PYX_ERR(0, 6765, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6764 * elif ts._state == "forgotten": * return {"op": "cancelled-key", "key": ts._key} * elif ts._state == "memory": # <<<<<<<<<<<<<< * return {"op": "key-in-memory", "key": ts._key} * elif ts._state == "erred": */ } /* "distributed/scheduler.py":6766 * elif ts._state == "memory": * return {"op": "key-in-memory", "key": ts._key} * elif ts._state == "erred": # <<<<<<<<<<<<<< * failing_ts: TaskState = ts._exception_blame * return { */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_erred, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6766, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6767 * return {"op": "key-in-memory", "key": ts._key} * elif ts._state == "erred": * failing_ts: TaskState = ts._exception_blame # <<<<<<<<<<<<<< * return { * "op": "task-erred", */ if (!(likely(((__pyx_v_ts->_exception_blame) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ts->_exception_blame, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6767, __pyx_L1_error) __pyx_t_3 = __pyx_v_ts->_exception_blame; __Pyx_INCREF(__pyx_t_3); __pyx_v_failing_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6768 * elif ts._state == "erred": * failing_ts: TaskState = ts._exception_blame * return { # <<<<<<<<<<<<<< * "op": "task-erred", * "key": ts._key, */ __Pyx_XDECREF(__pyx_r); /* "distributed/scheduler.py":6769 * failing_ts: TaskState = ts._exception_blame * return { * "op": "task-erred", # <<<<<<<<<<<<<< * "key": ts._key, * "exception": failing_ts._exception, */ __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_op, __pyx_kp_u_task_erred) < 0) __PYX_ERR(0, 6769, __pyx_L1_error) /* "distributed/scheduler.py":6770 * return { * "op": "task-erred", * "key": ts._key, # <<<<<<<<<<<<<< * "exception": failing_ts._exception, * "traceback": failing_ts._traceback, */ if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_key, __pyx_v_ts->_key) < 0) __PYX_ERR(0, 6769, __pyx_L1_error) /* "distributed/scheduler.py":6771 * "op": "task-erred", * "key": ts._key, * "exception": failing_ts._exception, # <<<<<<<<<<<<<< * "traceback": failing_ts._traceback, * } */ if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_exception, __pyx_v_failing_ts->_exception) < 0) __PYX_ERR(0, 6769, __pyx_L1_error) /* "distributed/scheduler.py":6772 * "key": ts._key, * "exception": failing_ts._exception, * "traceback": failing_ts._traceback, # <<<<<<<<<<<<<< * } * else: */ if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_traceback, __pyx_v_failing_ts->_traceback) < 0) __PYX_ERR(0, 6769, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6766 * elif ts._state == "memory": * return {"op": "key-in-memory", "key": ts._key} * elif ts._state == "erred": # <<<<<<<<<<<<<< * failing_ts: TaskState = ts._exception_blame * return { */ } /* "distributed/scheduler.py":6775 * } * else: * return None # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "distributed/scheduler.py":6759 * @cfunc * @exceptval(check=False) * def _task_to_report_msg(state: SchedulerState, ts: TaskState) -> dict: # <<<<<<<<<<<<<< * if ts is None: * return {"op": "cancelled-key", "key": ts._key} */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler._task_to_report_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_failing_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6780 * @cfunc * @exceptval(check=False) * def _task_to_client_msgs(state: SchedulerState, ts: TaskState) -> dict: # <<<<<<<<<<<<<< * cs: ClientState * client_keys: list */ static PyObject *__pyx_f_11distributed_9scheduler__task_to_client_msgs(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_state, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts) { PyObject *__pyx_v_client_keys = 0; PyObject *__pyx_v_report_msg = 0; PyObject *__pyx_v_client_msgs = 0; PyObject *__pyx_v_k = NULL; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_10genexpr151__pyx_v_cs = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_task_to_client_msgs", 0); /* "distributed/scheduler.py":6783 * cs: ClientState * client_keys: list * if ts is None: # <<<<<<<<<<<<<< * # Notify all clients * client_keys = list(state._clients) */ __pyx_t_1 = (((PyObject *)__pyx_v_ts) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6785 * if ts is None: * # Notify all clients * client_keys = list(state._clients) # <<<<<<<<<<<<<< * else: * # Notify clients interested in key */ __pyx_t_3 = PySequence_List(__pyx_v_state->_clients); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_client_keys = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6783 * cs: ClientState * client_keys: list * if ts is None: # <<<<<<<<<<<<<< * # Notify all clients * client_keys = list(state._clients) */ goto __pyx_L3; } /* "distributed/scheduler.py":6788 * else: * # Notify clients interested in key * client_keys = [cs._client_key for cs in ts._who_wants] # <<<<<<<<<<<<<< * * report_msg: dict = _task_to_report_msg(state, ts) */ /*else*/ { { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6788, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6788, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, __pyx_t_7); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 6788, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 6788, __pyx_L6_error) __Pyx_XDECREF_SET(__pyx_10genexpr151__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_8)); __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_10genexpr151__pyx_v_cs->_client_key))) __PYX_ERR(0, 6788, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr151__pyx_v_cs); __pyx_10genexpr151__pyx_v_cs = 0; goto __pyx_L9_exit_scope; __pyx_L6_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr151__pyx_v_cs); __pyx_10genexpr151__pyx_v_cs = 0; goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ __pyx_v_client_keys = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "distributed/scheduler.py":6790 * client_keys = [cs._client_key for cs in ts._who_wants] * * report_msg: dict = _task_to_report_msg(state, ts) # <<<<<<<<<<<<<< * * client_msgs: dict = {} */ __pyx_t_3 = __pyx_f_11distributed_9scheduler__task_to_report_msg(__pyx_v_state, __pyx_v_ts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_report_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6792 * report_msg: dict = _task_to_report_msg(state, ts) * * client_msgs: dict = {} # <<<<<<<<<<<<<< * for k in client_keys: * client_msgs[k] = [report_msg] */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_client_msgs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6793 * * client_msgs: dict = {} * for k in client_keys: # <<<<<<<<<<<<<< * client_msgs[k] = [report_msg] * */ __pyx_t_3 = __pyx_v_client_keys; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 6793, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6794 * client_msgs: dict = {} * for k in client_keys: * client_msgs[k] = [report_msg] # <<<<<<<<<<<<<< * * return client_msgs */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_report_msg); __Pyx_GIVEREF(__pyx_v_report_msg); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_report_msg); if (unlikely(PyDict_SetItem(__pyx_v_client_msgs, __pyx_v_k, __pyx_t_4) < 0)) __PYX_ERR(0, 6794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":6793 * * client_msgs: dict = {} * for k in client_keys: # <<<<<<<<<<<<<< * client_msgs[k] = [report_msg] * */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":6796 * client_msgs[k] = [report_msg] * * return client_msgs # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_client_msgs); __pyx_r = __pyx_v_client_msgs; goto __pyx_L0; /* "distributed/scheduler.py":6780 * @cfunc * @exceptval(check=False) * def _task_to_client_msgs(state: SchedulerState, ts: TaskState) -> dict: # <<<<<<<<<<<<<< * cs: ClientState * client_keys: list */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("distributed.scheduler._task_to_client_msgs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_client_keys); __Pyx_XDECREF(__pyx_v_report_msg); __Pyx_XDECREF(__pyx_v_client_msgs); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF((PyObject *)__pyx_10genexpr151__pyx_v_cs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6801 * @cfunc * @exceptval(check=False) * def _reevaluate_occupancy_worker(state: SchedulerState, ws: WorkerState): # <<<<<<<<<<<<<< * """ See reevaluate_occupancy """ * old: double = ws._occupancy */ static PyObject *__pyx_f_11distributed_9scheduler__reevaluate_occupancy_worker(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v_state, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws) { double __pyx_v_old; double __pyx_v_new; double __pyx_v_diff; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; double __pyx_v_est; PyObject *__pyx_v_steal = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_reevaluate_occupancy_worker", 0); /* "distributed/scheduler.py":6803 * def _reevaluate_occupancy_worker(state: SchedulerState, ws: WorkerState): * """ See reevaluate_occupancy """ * old: double = ws._occupancy # <<<<<<<<<<<<<< * new: double = 0 * diff: double */ __pyx_t_1 = __pyx_v_ws->_occupancy; __pyx_v_old = __pyx_t_1; /* "distributed/scheduler.py":6804 * """ See reevaluate_occupancy """ * old: double = ws._occupancy * new: double = 0 # <<<<<<<<<<<<<< * diff: double * ts: TaskState */ __pyx_v_new = 0.0; /* "distributed/scheduler.py":6808 * ts: TaskState * est: double * for ts in ws._processing: # <<<<<<<<<<<<<< * est = state.set_duration_estimate(ts, ws) * new += est */ __pyx_t_3 = 0; if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6808, __pyx_L1_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_ws->_processing, 1, ((PyObject *)NULL), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 6808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6808, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":6809 * est: double * for ts in ws._processing: * est = state.set_duration_estimate(ts, ws) # <<<<<<<<<<<<<< * new += est * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_state->__pyx_vtab)->set_duration_estimate(__pyx_v_state, __pyx_v_ts, __pyx_v_ws, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6809, __pyx_L1_error) __pyx_v_est = __pyx_t_1; /* "distributed/scheduler.py":6810 * for ts in ws._processing: * est = state.set_duration_estimate(ts, ws) * new += est # <<<<<<<<<<<<<< * * ws._occupancy = new */ __pyx_v_new = (__pyx_v_new + __pyx_v_est); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6812 * new += est * * ws._occupancy = new # <<<<<<<<<<<<<< * diff = new - old * state._total_occupancy += diff */ __pyx_v_ws->_occupancy = __pyx_v_new; /* "distributed/scheduler.py":6813 * * ws._occupancy = new * diff = new - old # <<<<<<<<<<<<<< * state._total_occupancy += diff * state.check_idle_saturated(ws) */ __pyx_v_diff = (__pyx_v_new - __pyx_v_old); /* "distributed/scheduler.py":6814 * ws._occupancy = new * diff = new - old * state._total_occupancy += diff # <<<<<<<<<<<<<< * state.check_idle_saturated(ws) * */ __pyx_v_state->_total_occupancy = (__pyx_v_state->_total_occupancy + __pyx_v_diff); /* "distributed/scheduler.py":6815 * diff = new - old * state._total_occupancy += diff * state.check_idle_saturated(ws) # <<<<<<<<<<<<<< * * # significant increase in duration */ __pyx_t_2 = ((struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState *)__pyx_v_state->__pyx_vtab)->check_idle_saturated(__pyx_v_state, __pyx_v_ws, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6818 * * # significant increase in duration * if new > old * 1.3: # <<<<<<<<<<<<<< * steal = state._extensions.get("stealing") * if steal is not None: */ __pyx_t_8 = ((__pyx_v_new > (__pyx_v_old * 1.3)) != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":6819 * # significant increase in duration * if new > old * 1.3: * steal = state._extensions.get("stealing") # <<<<<<<<<<<<<< * if steal is not None: * for ts in ws._processing: */ if (unlikely(__pyx_v_state->_extensions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 6819, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_state->_extensions, __pyx_n_u_stealing, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_steal = __pyx_t_2; __pyx_t_2 = 0; /* "distributed/scheduler.py":6820 * if new > old * 1.3: * steal = state._extensions.get("stealing") * if steal is not None: # <<<<<<<<<<<<<< * for ts in ws._processing: * steal.remove_key_from_stealable(ts) */ __pyx_t_8 = (__pyx_v_steal != Py_None); __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { /* "distributed/scheduler.py":6821 * steal = state._extensions.get("stealing") * if steal is not None: * for ts in ws._processing: # <<<<<<<<<<<<<< * steal.remove_key_from_stealable(ts) * steal.put_key_in_stealable(ts) */ __pyx_t_4 = 0; if (unlikely(__pyx_v_ws->_processing == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6821, __pyx_L1_error) } __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_ws->_processing, 1, ((PyObject *)NULL), (&__pyx_t_3), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_3, &__pyx_t_4, &__pyx_t_6, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 6821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6821, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; /* "distributed/scheduler.py":6822 * if steal is not None: * for ts in ws._processing: * steal.remove_key_from_stealable(ts) # <<<<<<<<<<<<<< * steal.put_key_in_stealable(ts) * */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_steal, __pyx_n_s_remove_key_from_stealable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, ((PyObject *)__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6823 * for ts in ws._processing: * steal.remove_key_from_stealable(ts) * steal.put_key_in_stealable(ts) # <<<<<<<<<<<<<< * * */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_steal, __pyx_n_s_put_key_in_stealable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, ((PyObject *)__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6820 * if new > old * 1.3: * steal = state._extensions.get("stealing") * if steal is not None: # <<<<<<<<<<<<<< * for ts in ws._processing: * steal.remove_key_from_stealable(ts) */ } /* "distributed/scheduler.py":6818 * * # significant increase in duration * if new > old * 1.3: # <<<<<<<<<<<<<< * steal = state._extensions.get("stealing") * if steal is not None: */ } /* "distributed/scheduler.py":6801 * @cfunc * @exceptval(check=False) * def _reevaluate_occupancy_worker(state: SchedulerState, ws: WorkerState): # <<<<<<<<<<<<<< * """ See reevaluate_occupancy """ * old: double = ws._occupancy */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler._reevaluate_occupancy_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF(__pyx_v_steal); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6828 * @cfunc * @exceptval(check=False) * def decide_worker( # <<<<<<<<<<<<<< * ts: TaskState, all_workers, valid_workers: set, objective * ) -> WorkerState: */ static struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_f_11distributed_9scheduler_decide_worker(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts, PyObject *__pyx_v_all_workers, PyObject *__pyx_v_valid_workers, PyObject *__pyx_v_objective) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; PyObject *__pyx_v_deps = 0; PyObject *__pyx_v_candidates = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr152__pyx_v_dts = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr153__pyx_v_dts = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr153__pyx_v_ws = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decide_worker", 0); /* "distributed/scheduler.py":6848 * ws: WorkerState * dts: TaskState * deps: set = ts._dependencies # <<<<<<<<<<<<<< * candidates: set * assert all([dts._who_has for dts in deps]) */ __pyx_t_1 = __pyx_v_ts->_dependencies; __Pyx_INCREF(__pyx_t_1); __pyx_v_deps = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6850 * deps: set = ts._dependencies * candidates: set * assert all([dts._who_has for dts in deps]) # <<<<<<<<<<<<<< * if ts._actor: * candidates = set(all_workers) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6850, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_deps, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6850, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 6850, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6850, __pyx_L5_error) __Pyx_XDECREF_SET(__pyx_10genexpr152__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_10genexpr152__pyx_v_dts->_who_has))) __PYX_ERR(0, 6850, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr152__pyx_v_dts); __pyx_10genexpr152__pyx_v_dts = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr152__pyx_v_dts); __pyx_10genexpr152__pyx_v_dts = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 6850, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6850, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6851 * candidates: set * assert all([dts._who_has for dts in deps]) * if ts._actor: # <<<<<<<<<<<<<< * candidates = set(all_workers) * else: */ __pyx_t_8 = (__pyx_v_ts->_actor != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":6852 * assert all([dts._who_has for dts in deps]) * if ts._actor: * candidates = set(all_workers) # <<<<<<<<<<<<<< * else: * candidates = {ws for dts in deps for ws in dts._who_has} */ __pyx_t_2 = PySet_New(__pyx_v_all_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6851 * candidates: set * assert all([dts._who_has for dts in deps]) * if ts._actor: # <<<<<<<<<<<<<< * candidates = set(all_workers) * else: */ goto __pyx_L9; } /* "distributed/scheduler.py":6854 * candidates = set(all_workers) * else: * candidates = {ws for dts in deps for ws in dts._who_has} # <<<<<<<<<<<<<< * if valid_workers is None: * if not candidates: */ /*else*/ { { /* enter inner scope */ __pyx_t_2 = PySet_New(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6854, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_set_iterator(__pyx_v_deps, 1, (&__pyx_t_3), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6854, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_4, &__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 6854, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6854, __pyx_L12_error) __Pyx_XDECREF_SET(__pyx_10genexpr153__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_6)); __pyx_t_6 = 0; __pyx_t_9 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_10genexpr153__pyx_v_dts->_who_has, 1, (&__pyx_t_10), (&__pyx_t_7)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6854, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_10, &__pyx_t_9, &__pyx_t_11, __pyx_t_7); if (unlikely(__pyx_t_12 == 0)) break; if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 6854, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6854, __pyx_L12_error) __Pyx_XDECREF_SET(__pyx_10genexpr153__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_11)); __pyx_t_11 = 0; if (unlikely(PySet_Add(__pyx_t_2, (PyObject*)__pyx_10genexpr153__pyx_v_ws))) __PYX_ERR(0, 6854, __pyx_L12_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr153__pyx_v_dts); __pyx_10genexpr153__pyx_v_dts = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr153__pyx_v_ws); __pyx_10genexpr153__pyx_v_ws = 0; goto __pyx_L17_exit_scope; __pyx_L12_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr153__pyx_v_dts); __pyx_10genexpr153__pyx_v_dts = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr153__pyx_v_ws); __pyx_10genexpr153__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L17_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L9:; /* "distributed/scheduler.py":6855 * else: * candidates = {ws for dts in deps for ws in dts._who_has} * if valid_workers is None: # <<<<<<<<<<<<<< * if not candidates: * candidates = set(all_workers) */ __pyx_t_8 = (__pyx_v_valid_workers == ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_8 != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":6856 * candidates = {ws for dts in deps for ws in dts._who_has} * if valid_workers is None: * if not candidates: # <<<<<<<<<<<<<< * candidates = set(all_workers) * else: */ __pyx_t_13 = (PySet_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_8 = ((!__pyx_t_13) != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":6857 * if valid_workers is None: * if not candidates: * candidates = set(all_workers) # <<<<<<<<<<<<<< * else: * candidates &= valid_workers */ __pyx_t_2 = PySet_New(__pyx_v_all_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_candidates, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":6856 * candidates = {ws for dts in deps for ws in dts._who_has} * if valid_workers is None: * if not candidates: # <<<<<<<<<<<<<< * candidates = set(all_workers) * else: */ } /* "distributed/scheduler.py":6855 * else: * candidates = {ws for dts in deps for ws in dts._who_has} * if valid_workers is None: # <<<<<<<<<<<<<< * if not candidates: * candidates = set(all_workers) */ goto __pyx_L18; } /* "distributed/scheduler.py":6859 * candidates = set(all_workers) * else: * candidates &= valid_workers # <<<<<<<<<<<<<< * if not candidates: * candidates = valid_workers */ /*else*/ { __pyx_t_2 = PyNumber_InPlaceAnd(__pyx_v_candidates, __pyx_v_valid_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_candidates, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "distributed/scheduler.py":6860 * else: * candidates &= valid_workers * if not candidates: # <<<<<<<<<<<<<< * candidates = valid_workers * if not candidates: */ __pyx_t_8 = (PySet_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_13 = ((!__pyx_t_8) != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":6861 * candidates &= valid_workers * if not candidates: * candidates = valid_workers # <<<<<<<<<<<<<< * if not candidates: * if ts._loose_restrictions: */ __Pyx_INCREF(__pyx_v_valid_workers); __Pyx_DECREF_SET(__pyx_v_candidates, __pyx_v_valid_workers); /* "distributed/scheduler.py":6862 * if not candidates: * candidates = valid_workers * if not candidates: # <<<<<<<<<<<<<< * if ts._loose_restrictions: * return decide_worker(ts, all_workers, None, objective) */ __pyx_t_13 = (__pyx_v_candidates != Py_None)&&(PySet_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_8 = ((!__pyx_t_13) != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":6863 * candidates = valid_workers * if not candidates: * if ts._loose_restrictions: # <<<<<<<<<<<<<< * return decide_worker(ts, all_workers, None, objective) * else: */ __pyx_t_8 = (__pyx_v_ts->_loose_restrictions != 0); if (__pyx_t_8) { /* "distributed/scheduler.py":6864 * if not candidates: * if ts._loose_restrictions: * return decide_worker(ts, all_workers, None, objective) # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_2 = ((PyObject *)__pyx_f_11distributed_9scheduler_decide_worker(__pyx_v_ts, __pyx_v_all_workers, ((PyObject*)Py_None), __pyx_v_objective)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "distributed/scheduler.py":6863 * candidates = valid_workers * if not candidates: * if ts._loose_restrictions: # <<<<<<<<<<<<<< * return decide_worker(ts, all_workers, None, objective) * else: */ } /* "distributed/scheduler.py":6866 * return decide_worker(ts, all_workers, None, objective) * else: * return None # <<<<<<<<<<<<<< * if not candidates: * return None */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_r = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "distributed/scheduler.py":6862 * if not candidates: * candidates = valid_workers * if not candidates: # <<<<<<<<<<<<<< * if ts._loose_restrictions: * return decide_worker(ts, all_workers, None, objective) */ } /* "distributed/scheduler.py":6860 * else: * candidates &= valid_workers * if not candidates: # <<<<<<<<<<<<<< * candidates = valid_workers * if not candidates: */ } } __pyx_L18:; /* "distributed/scheduler.py":6867 * else: * return None * if not candidates: # <<<<<<<<<<<<<< * return None * */ __pyx_t_8 = (__pyx_v_candidates != Py_None)&&(PySet_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_13 = ((!__pyx_t_8) != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":6868 * return None * if not candidates: * return None # <<<<<<<<<<<<<< * * if len(candidates) == 1: */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_r = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; /* "distributed/scheduler.py":6867 * else: * return None * if not candidates: # <<<<<<<<<<<<<< * return None * */ } /* "distributed/scheduler.py":6870 * return None * * if len(candidates) == 1: # <<<<<<<<<<<<<< * for ws in candidates: * break */ if (unlikely(__pyx_v_candidates == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 6870, __pyx_L1_error) } __pyx_t_3 = PySet_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6870, __pyx_L1_error) __pyx_t_13 = ((__pyx_t_3 == 1) != 0); if (__pyx_t_13) { /* "distributed/scheduler.py":6871 * * if len(candidates) == 1: * for ws in candidates: # <<<<<<<<<<<<<< * break * else: */ __pyx_t_3 = 0; __pyx_t_1 = __Pyx_set_iterator(__pyx_v_candidates, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; while (1) { __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 6871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6871, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6872 * if len(candidates) == 1: * for ws in candidates: * break # <<<<<<<<<<<<<< * else: * ws = min(candidates, key=objective) */ goto __pyx_L26_break; } __pyx_L26_break:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6870 * return None * * if len(candidates) == 1: # <<<<<<<<<<<<<< * for ws in candidates: * break */ goto __pyx_L24; } /* "distributed/scheduler.py":6874 * break * else: * ws = min(candidates, key=objective) # <<<<<<<<<<<<<< * return ws * */ /*else*/ { __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_candidates); __Pyx_GIVEREF(__pyx_v_candidates); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_candidates); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_v_objective) < 0) __PYX_ERR(0, 6874, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6874, __pyx_L1_error) __pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_6); __pyx_t_6 = 0; } __pyx_L24:; /* "distributed/scheduler.py":6875 * else: * ws = min(candidates, key=objective) * return ws # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(!__pyx_v_ws)) { __Pyx_RaiseUnboundLocalError("ws"); __PYX_ERR(0, 6875, __pyx_L1_error) } __Pyx_INCREF(((PyObject *)__pyx_v_ws)); __pyx_r = __pyx_v_ws; goto __pyx_L0; /* "distributed/scheduler.py":6828 * @cfunc * @exceptval(check=False) * def decide_worker( # <<<<<<<<<<<<<< * ts: TaskState, all_workers, valid_workers: set, objective * ) -> WorkerState: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.decide_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF(__pyx_v_deps); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF((PyObject *)__pyx_10genexpr152__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_10genexpr153__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_10genexpr153__pyx_v_ws); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6878 * * * def validate_task_state(ts: TaskState): # <<<<<<<<<<<<<< * """ * Validate the given TaskState. */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_29validate_task_state(PyObject *__pyx_self, PyObject *__pyx_v_ts); /*proto*/ static char __pyx_doc_11distributed_9scheduler_28validate_task_state[] = "\n Validate the given TaskState.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_29validate_task_state = {"validate_task_state", (PyCFunction)__pyx_pw_11distributed_9scheduler_29validate_task_state, METH_O, __pyx_doc_11distributed_9scheduler_28validate_task_state}; static PyObject *__pyx_pw_11distributed_9scheduler_29validate_task_state(PyObject *__pyx_self, PyObject *__pyx_v_ts) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_task_state (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ts), __pyx_ptype_11distributed_9scheduler_TaskState, 1, "ts", 0))) __PYX_ERR(0, 6878, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_28validate_task_state(__pyx_self, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v_ts)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_28validate_task_state(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts) { struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_dts = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr154__pyx_v_dts = NULL; struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_10genexpr155__pyx_v_dts = NULL; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_10genexpr156__pyx_v_ws = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_task_state", 0); /* "distributed/scheduler.py":6885 * dts: TaskState * * assert ts._state in ALL_TASK_STATES or ts._state == "forgotten", ts # <<<<<<<<<<<<<< * * if ts._waiting_on: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_11distributed_9scheduler_ALL_TASK_STATES == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6885, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_ts->_state, __pyx_v_11distributed_9scheduler_ALL_TASK_STATES, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6885, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_forgotten, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6885, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_1)) { __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 6885, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6887 * assert ts._state in ALL_TASK_STATES or ts._state == "forgotten", ts * * if ts._waiting_on: # <<<<<<<<<<<<<< * assert ts._waiting_on.issubset(ts._dependencies), ( * "waiting not subset of dependencies", */ __pyx_t_1 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6888 * * if ts._waiting_on: * assert ts._waiting_on.issubset(ts._dependencies), ( # <<<<<<<<<<<<<< * "waiting not subset of dependencies", * str(ts._waiting_on), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts->_waiting_on, __pyx_n_s_issubset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_ts->_dependencies) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_ts->_dependencies); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) { /* "distributed/scheduler.py":6890 * assert ts._waiting_on.issubset(ts._dependencies), ( * "waiting not subset of dependencies", * str(ts._waiting_on), # <<<<<<<<<<<<<< * str(ts._dependencies), * ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ts->_waiting_on); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":6891 * "waiting not subset of dependencies", * str(ts._waiting_on), * str(ts._dependencies), # <<<<<<<<<<<<<< * ) * if ts._waiters: */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ts->_dependencies); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6889 * if ts._waiting_on: * assert ts._waiting_on.issubset(ts._dependencies), ( * "waiting not subset of dependencies", # <<<<<<<<<<<<<< * str(ts._waiting_on), * str(ts._dependencies), */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_kp_u_waiting_not_subset_of_dependenci); __Pyx_GIVEREF(__pyx_kp_u_waiting_not_subset_of_dependenci); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_waiting_not_subset_of_dependenci); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyTuple_Pack(1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 6888, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6887 * assert ts._state in ALL_TASK_STATES or ts._state == "forgotten", ts * * if ts._waiting_on: # <<<<<<<<<<<<<< * assert ts._waiting_on.issubset(ts._dependencies), ( * "waiting not subset of dependencies", */ } /* "distributed/scheduler.py":6893 * str(ts._dependencies), * ) * if ts._waiters: # <<<<<<<<<<<<<< * assert ts._waiters.issubset(ts._dependents), ( * "waiters not subset of dependents", */ __pyx_t_1 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); if (__pyx_t_1) { /* "distributed/scheduler.py":6894 * ) * if ts._waiters: * assert ts._waiters.issubset(ts._dependents), ( # <<<<<<<<<<<<<< * "waiters not subset of dependents", * str(ts._waiters), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts->_waiters, __pyx_n_s_issubset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_ts->_dependents) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_ts->_dependents); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6894, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) { /* "distributed/scheduler.py":6896 * assert ts._waiters.issubset(ts._dependents), ( * "waiters not subset of dependents", * str(ts._waiters), # <<<<<<<<<<<<<< * str(ts._dependents), * ) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ts->_waiters); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6897 * "waiters not subset of dependents", * str(ts._waiters), * str(ts._dependents), # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ts->_dependents); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "distributed/scheduler.py":6895 * if ts._waiters: * assert ts._waiters.issubset(ts._dependents), ( * "waiters not subset of dependents", # <<<<<<<<<<<<<< * str(ts._waiters), * str(ts._dependents), */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_u_waiters_not_subset_of_dependents); __Pyx_GIVEREF(__pyx_kp_u_waiters_not_subset_of_dependents); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_waiters_not_subset_of_dependents); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_6 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 6894, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6893 * str(ts._dependencies), * ) * if ts._waiters: # <<<<<<<<<<<<<< * assert ts._waiters.issubset(ts._dependents), ( * "waiters not subset of dependents", */ } /* "distributed/scheduler.py":6900 * ) * * for dts in ts._waiting_on: # <<<<<<<<<<<<<< * assert not dts._who_has, ("waiting on in-memory dep", str(ts), str(dts)) * assert dts._state != "released", ("waiting on released dep", str(ts), str(dts)) */ __pyx_t_7 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_ts->_waiting_on, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_4, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6900, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":6901 * * for dts in ts._waiting_on: * assert not dts._who_has, ("waiting on in-memory dep", str(ts), str(dts)) # <<<<<<<<<<<<<< * assert dts._state != "released", ("waiting on released dep", str(ts), str(dts)) * for dts in ts._dependencies: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = (__pyx_v_dts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_has) != 0); if (unlikely(!((!__pyx_t_1) != 0))) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_dts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_kp_u_waiting_on_in_memory_dep); __Pyx_GIVEREF(__pyx_kp_u_waiting_on_in_memory_dep); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_u_waiting_on_in_memory_dep); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 6901, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6902 * for dts in ts._waiting_on: * assert not dts._who_has, ("waiting on in-memory dep", str(ts), str(dts)) * assert dts._state != "released", ("waiting on released dep", str(ts), str(dts)) # <<<<<<<<<<<<<< * for dts in ts._dependencies: * assert ts in dts._dependents, ( */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_dts->_state, __pyx_n_u_released, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6902, __pyx_L1_error) if (unlikely(!(__pyx_t_1 != 0))) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_dts)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_u_waiting_on_released_dep); __Pyx_GIVEREF(__pyx_kp_u_waiting_on_released_dep); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_waiting_on_released_dep); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11); __pyx_t_5 = 0; __pyx_t_11 = 0; __pyx_t_11 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(0, 6902, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6903 * assert not dts._who_has, ("waiting on in-memory dep", str(ts), str(dts)) * assert dts._state != "released", ("waiting on released dep", str(ts), str(dts)) * for dts in ts._dependencies: # <<<<<<<<<<<<<< * assert ts in dts._dependents, ( * "not in dependency's dependents", */ __pyx_t_8 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_11, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6903, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_11)); __pyx_t_11 = 0; /* "distributed/scheduler.py":6904 * assert dts._state != "released", ("waiting on released dep", str(ts), str(dts)) * for dts in ts._dependencies: * assert ts in dts._dependents, ( # <<<<<<<<<<<<<< * "not in dependency's dependents", * str(ts), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_dts->_dependents == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6904, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_dts->_dependents, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6904, __pyx_L1_error) if (unlikely(!(__pyx_t_1 != 0))) { /* "distributed/scheduler.py":6906 * assert ts in dts._dependents, ( * "not in dependency's dependents", * str(ts), # <<<<<<<<<<<<<< * str(dts), * str(dts._dependents), */ __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); /* "distributed/scheduler.py":6907 * "not in dependency's dependents", * str(ts), * str(dts), # <<<<<<<<<<<<<< * str(dts._dependents), * ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_dts)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":6908 * str(ts), * str(dts), * str(dts._dependents), # <<<<<<<<<<<<<< * ) * if ts._state in ("waiting", "processing"): */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dts->_dependents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6905 * for dts in ts._dependencies: * assert ts in dts._dependents, ( * "not in dependency's dependents", # <<<<<<<<<<<<<< * str(ts), * str(dts), */ __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_kp_u_not_in_dependency_s_dependents); __Pyx_GIVEREF(__pyx_kp_u_not_in_dependency_s_dependents); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_u_not_in_dependency_s_dependents); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_5); __pyx_t_11 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyTuple_Pack(1, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 6904, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6910 * str(dts._dependents), * ) * if ts._state in ("waiting", "processing"): # <<<<<<<<<<<<<< * assert dts in ts._waiting_on or dts._who_has, ( * "dep missing", */ __Pyx_INCREF(__pyx_v_ts->_state); __pyx_t_13 = __pyx_v_ts->_state; __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_13, __pyx_n_u_waiting, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6910, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L12_bool_binop_done; } __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_13, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6910, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L12_bool_binop_done:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6911 * ) * if ts._state in ("waiting", "processing"): * assert dts in ts._waiting_on or dts._who_has, ( # <<<<<<<<<<<<<< * "dep missing", * str(ts), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ts->_waiting_on == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6911, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_dts), __pyx_v_ts->_waiting_on, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6911, __pyx_L1_error) __pyx_t_3 = (__pyx_t_1 != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L14_bool_binop_done; } __pyx_t_3 = (__pyx_v_dts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_dts->_who_has) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L14_bool_binop_done:; if (unlikely(!__pyx_t_2)) { /* "distributed/scheduler.py":6913 * assert dts in ts._waiting_on or dts._who_has, ( * "dep missing", * str(ts), # <<<<<<<<<<<<<< * str(dts), * ) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6914 * "dep missing", * str(ts), * str(dts), # <<<<<<<<<<<<<< * ) * assert dts._state != "forgotten" */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_dts)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "distributed/scheduler.py":6912 * if ts._state in ("waiting", "processing"): * assert dts in ts._waiting_on or dts._who_has, ( * "dep missing", # <<<<<<<<<<<<<< * str(ts), * str(dts), */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_u_dep_missing); __Pyx_GIVEREF(__pyx_kp_u_dep_missing); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_dep_missing); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_12); __pyx_t_5 = 0; __pyx_t_12 = 0; __pyx_t_12 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 6911, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6910 * str(dts._dependents), * ) * if ts._state in ("waiting", "processing"): # <<<<<<<<<<<<<< * assert dts in ts._waiting_on or dts._who_has, ( * "dep missing", */ } /* "distributed/scheduler.py":6916 * str(dts), * ) * assert dts._state != "forgotten" # <<<<<<<<<<<<<< * * for dts in ts._waiters: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_dts->_state, __pyx_n_u_forgotten, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6916, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6916, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6918 * assert dts._state != "forgotten" * * for dts in ts._waiters: # <<<<<<<<<<<<<< * assert dts._state in ("waiting", "processing"), ( * "waiter not in play", */ __pyx_t_7 = 0; __pyx_t_12 = __Pyx_set_iterator(__pyx_v_ts->_waiters, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_12; __pyx_t_12 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_12, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6918, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_12)); __pyx_t_12 = 0; /* "distributed/scheduler.py":6919 * * for dts in ts._waiters: * assert dts._state in ("waiting", "processing"), ( # <<<<<<<<<<<<<< * "waiter not in play", * str(ts), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __Pyx_INCREF(__pyx_v_dts->_state); __pyx_t_13 = __pyx_v_dts->_state; __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_13, __pyx_n_u_waiting, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6919, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L18_bool_binop_done; } __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_13, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 6919, __pyx_L1_error) __pyx_t_3 = (__pyx_t_1 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L18_bool_binop_done:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!(__pyx_t_2 != 0))) { /* "distributed/scheduler.py":6921 * assert dts._state in ("waiting", "processing"), ( * "waiter not in play", * str(ts), # <<<<<<<<<<<<<< * str(dts), * ) */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "distributed/scheduler.py":6922 * "waiter not in play", * str(ts), * str(dts), # <<<<<<<<<<<<<< * ) * for dts in ts._dependents: */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_dts)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":6920 * for dts in ts._waiters: * assert dts._state in ("waiting", "processing"), ( * "waiter not in play", # <<<<<<<<<<<<<< * str(ts), * str(dts), */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_u_waiter_not_in_play); __Pyx_GIVEREF(__pyx_kp_u_waiter_not_in_play); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_waiter_not_in_play); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_12 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 6919, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6924 * str(dts), * ) * for dts in ts._dependents: # <<<<<<<<<<<<<< * assert ts in dts._dependencies, ( * "not in dependent's dependencies", */ __pyx_t_8 = 0; __pyx_t_4 = __Pyx_set_iterator(__pyx_v_ts->_dependents, 1, (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_4, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6924, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_4)); __pyx_t_4 = 0; /* "distributed/scheduler.py":6925 * ) * for dts in ts._dependents: * assert ts in dts._dependencies, ( # <<<<<<<<<<<<<< * "not in dependent's dependencies", * str(ts), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_dts->_dependencies == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6925, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_dts->_dependencies, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6925, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { /* "distributed/scheduler.py":6927 * assert ts in dts._dependencies, ( * "not in dependent's dependencies", * str(ts), # <<<<<<<<<<<<<< * str(dts), * str(dts._dependencies), */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":6928 * "not in dependent's dependencies", * str(ts), * str(dts), # <<<<<<<<<<<<<< * str(dts._dependencies), * ) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_dts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6929 * str(ts), * str(dts), * str(dts._dependencies), # <<<<<<<<<<<<<< * ) * assert dts._state != "forgotten" */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dts->_dependencies); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "distributed/scheduler.py":6926 * for dts in ts._dependents: * assert ts in dts._dependencies, ( * "not in dependent's dependencies", # <<<<<<<<<<<<<< * str(ts), * str(dts), */ __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_kp_u_not_in_dependent_s_dependencies); __Pyx_GIVEREF(__pyx_kp_u_not_in_dependent_s_dependencies); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_u_not_in_dependent_s_dependencies); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_12); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_12 = 0; __pyx_t_12 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 6925, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6931 * str(dts._dependencies), * ) * assert dts._state != "forgotten" # <<<<<<<<<<<<<< * * assert (ts._processing_on is not None) == (ts._state == "processing") */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_dts->_state, __pyx_n_u_forgotten, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6931, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6931, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6933 * assert dts._state != "forgotten" * * assert (ts._processing_on is not None) == (ts._state == "processing") # <<<<<<<<<<<<<< * assert (not not ts._who_has) == (ts._state == "memory"), (ts, ts._who_has) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (((PyObject *)__pyx_v_ts->_processing_on) != Py_None); __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6933, __pyx_L1_error) if (unlikely(!((__pyx_t_2 == __pyx_t_3) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6933, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6934 * * assert (ts._processing_on is not None) == (ts._state == "processing") * assert (not not ts._who_has) == (ts._state == "memory"), (ts, ts._who_has) # <<<<<<<<<<<<<< * * if ts._state == "processing": */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6934, __pyx_L1_error) if (unlikely(!(((!((!__pyx_t_3) != 0)) == __pyx_t_2) != 0))) { __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ts)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_ts)); __Pyx_INCREF(__pyx_v_ts->_who_has); __Pyx_GIVEREF(__pyx_v_ts->_who_has); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ts->_who_has); __pyx_t_12 = PyTuple_Pack(1, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 6934, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6936 * assert (not not ts._who_has) == (ts._state == "memory"), (ts, ts._who_has) * * if ts._state == "processing": # <<<<<<<<<<<<<< * assert all([dts._who_has for dts in ts._dependencies]), ( * "task processing without all deps", */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6936, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6937 * * if ts._state == "processing": * assert all([dts._who_has for dts in ts._dependencies]), ( # <<<<<<<<<<<<<< * "task processing without all deps", * str(ts), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { { /* enter inner scope */ __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6937, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_v_ts->_dependencies, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6937, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_11, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6937, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6937, __pyx_L25_error) __Pyx_XDECREF_SET(__pyx_10genexpr154__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_11)); __pyx_t_11 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_10genexpr154__pyx_v_dts->_who_has))) __PYX_ERR(0, 6937, __pyx_L25_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr154__pyx_v_dts); __pyx_10genexpr154__pyx_v_dts = 0; goto __pyx_L28_exit_scope; __pyx_L25_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr154__pyx_v_dts); __pyx_10genexpr154__pyx_v_dts = 0; goto __pyx_L1_error; __pyx_L28_exit_scope:; } /* exit inner scope */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6937, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) { /* "distributed/scheduler.py":6939 * assert all([dts._who_has for dts in ts._dependencies]), ( * "task processing without all deps", * str(ts), # <<<<<<<<<<<<<< * str(ts._dependencies), * ) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "distributed/scheduler.py":6940 * "task processing without all deps", * str(ts), * str(ts._dependencies), # <<<<<<<<<<<<<< * ) * assert not ts._waiting_on */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ts->_dependencies); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "distributed/scheduler.py":6938 * if ts._state == "processing": * assert all([dts._who_has for dts in ts._dependencies]), ( * "task processing without all deps", # <<<<<<<<<<<<<< * str(ts), * str(ts._dependencies), */ __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_kp_u_task_processing_without_all_deps); __Pyx_GIVEREF(__pyx_kp_u_task_processing_without_all_deps); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_u_task_processing_without_all_deps); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_12); __pyx_t_6 = 0; __pyx_t_12 = 0; __pyx_t_12 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 6937, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6942 * str(ts._dependencies), * ) * assert not ts._waiting_on # <<<<<<<<<<<<<< * * if ts._who_has: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = (__pyx_v_ts->_waiting_on != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiting_on) != 0); if (unlikely(!((!__pyx_t_3) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6942, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6936 * assert (not not ts._who_has) == (ts._state == "memory"), (ts, ts._who_has) * * if ts._state == "processing": # <<<<<<<<<<<<<< * assert all([dts._who_has for dts in ts._dependencies]), ( * "task processing without all deps", */ } /* "distributed/scheduler.py":6944 * assert not ts._waiting_on * * if ts._who_has: # <<<<<<<<<<<<<< * assert ts._waiters or ts._who_wants, ( * "unneeded task in memory", */ __pyx_t_3 = (__pyx_v_ts->_who_has != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_has) != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6945 * * if ts._who_has: * assert ts._waiters or ts._who_wants, ( # <<<<<<<<<<<<<< * "unneeded task in memory", * str(ts), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_ts->_waiters != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_waiters) != 0); if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L30_bool_binop_done; } __pyx_t_2 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L30_bool_binop_done:; if (unlikely(!__pyx_t_3)) { /* "distributed/scheduler.py":6947 * assert ts._waiters or ts._who_wants, ( * "unneeded task in memory", * str(ts), # <<<<<<<<<<<<<< * str(ts._who_has), * ) */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "distributed/scheduler.py":6948 * "unneeded task in memory", * str(ts), * str(ts._who_has), # <<<<<<<<<<<<<< * ) * if ts._run_spec: # was computed */ __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ts->_who_has); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); /* "distributed/scheduler.py":6946 * if ts._who_has: * assert ts._waiters or ts._who_wants, ( * "unneeded task in memory", # <<<<<<<<<<<<<< * str(ts), * str(ts._who_has), */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_kp_u_unneeded_task_in_memory); __Pyx_GIVEREF(__pyx_kp_u_unneeded_task_in_memory); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_unneeded_task_in_memory); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_11); __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_11 = PyTuple_Pack(1, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(0, 6945, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6950 * str(ts._who_has), * ) * if ts._run_spec: # was computed # <<<<<<<<<<<<<< * assert ts._type * assert isinstance(ts._type, str) */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_ts->_run_spec); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6950, __pyx_L1_error) if (__pyx_t_3) { /* "distributed/scheduler.py":6951 * ) * if ts._run_spec: # was computed * assert ts._type # <<<<<<<<<<<<<< * assert isinstance(ts._type, str) * assert not any([ts in dts._waiting_on for dts in ts._dependents]) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = (__pyx_v_ts->_type != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_ts->_type) != 0); if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6951, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6952 * if ts._run_spec: # was computed * assert ts._type * assert isinstance(ts._type, str) # <<<<<<<<<<<<<< * assert not any([ts in dts._waiting_on for dts in ts._dependents]) * for ws in ts._who_has: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_11 = __pyx_v_ts->_type; __Pyx_INCREF(__pyx_t_11); __pyx_t_3 = PyUnicode_Check(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!(__pyx_t_3 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6952, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6950 * str(ts._who_has), * ) * if ts._run_spec: # was computed # <<<<<<<<<<<<<< * assert ts._type * assert isinstance(ts._type, str) */ } /* "distributed/scheduler.py":6953 * assert ts._type * assert isinstance(ts._type, str) * assert not any([ts in dts._waiting_on for dts in ts._dependents]) # <<<<<<<<<<<<<< * for ws in ts._who_has: * assert ts in ws._has_what, ( */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { { /* enter inner scope */ __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6953, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = 0; __pyx_t_12 = __Pyx_set_iterator(__pyx_v_ts->_dependents, 1, (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6953, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_12; __pyx_t_12 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_12, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6953, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_12); if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6953, __pyx_L35_error) __Pyx_XDECREF_SET(__pyx_10genexpr155__pyx_v_dts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_12)); __pyx_t_12 = 0; if (unlikely(__pyx_10genexpr155__pyx_v_dts->_waiting_on == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6953, __pyx_L35_error) } __pyx_t_3 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_10genexpr155__pyx_v_dts->_waiting_on, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6953, __pyx_L35_error) __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6953, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_12); if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 6953, __pyx_L35_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr155__pyx_v_dts); __pyx_10genexpr155__pyx_v_dts = 0; goto __pyx_L38_exit_scope; __pyx_L35_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr155__pyx_v_dts); __pyx_10genexpr155__pyx_v_dts = 0; goto __pyx_L1_error; __pyx_L38_exit_scope:; } /* exit inner scope */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!((!__pyx_t_3) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6953, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6954 * assert isinstance(ts._type, str) * assert not any([ts in dts._waiting_on for dts in ts._dependents]) * for ws in ts._who_has: # <<<<<<<<<<<<<< * assert ts in ws._has_what, ( * "not in who_has' has_what", */ __pyx_t_7 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_v_ts->_who_has, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_11, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6954, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_11)); __pyx_t_11 = 0; /* "distributed/scheduler.py":6955 * assert not any([ts in dts._waiting_on for dts in ts._dependents]) * for ws in ts._who_has: * assert ts in ws._has_what, ( # <<<<<<<<<<<<<< * "not in who_has' has_what", * str(ts), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ws->_has_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6955, __pyx_L1_error) } __pyx_t_3 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_ws->_has_what, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6955, __pyx_L1_error) if (unlikely(!(__pyx_t_3 != 0))) { /* "distributed/scheduler.py":6957 * assert ts in ws._has_what, ( * "not in who_has' has_what", * str(ts), # <<<<<<<<<<<<<< * str(ws), * str(ws._has_what), */ __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); /* "distributed/scheduler.py":6958 * "not in who_has' has_what", * str(ts), * str(ws), # <<<<<<<<<<<<<< * str(ws._has_what), * ) */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ws)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "distributed/scheduler.py":6959 * str(ts), * str(ws), * str(ws._has_what), # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ws->_has_what); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6956 * for ws in ts._who_has: * assert ts in ws._has_what, ( * "not in who_has' has_what", # <<<<<<<<<<<<<< * str(ts), * str(ws), */ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_u_not_in_who_has_has_what); __Pyx_GIVEREF(__pyx_kp_u_not_in_who_has_has_what); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_not_in_who_has_has_what); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_5); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 6955, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6944 * assert not ts._waiting_on * * if ts._who_has: # <<<<<<<<<<<<<< * assert ts._waiters or ts._who_wants, ( * "unneeded task in memory", */ } /* "distributed/scheduler.py":6962 * ) * * if ts._who_wants: # <<<<<<<<<<<<<< * cs: ClientState * for cs in ts._who_wants: */ __pyx_t_3 = (__pyx_v_ts->_who_wants != Py_None)&&(PySet_GET_SIZE(__pyx_v_ts->_who_wants) != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6964 * if ts._who_wants: * cs: ClientState * for cs in ts._who_wants: # <<<<<<<<<<<<<< * assert ts in cs._wants_what, ( * "not in who_wants' wants_what", */ __pyx_t_8 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_ts->_who_wants, 1, (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_5, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 6964, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6965 * cs: ClientState * for cs in ts._who_wants: * assert ts in cs._wants_what, ( # <<<<<<<<<<<<<< * "not in who_wants' wants_what", * str(ts), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_cs->_wants_what == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6965, __pyx_L1_error) } __pyx_t_3 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_v_cs->_wants_what, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6965, __pyx_L1_error) if (unlikely(!(__pyx_t_3 != 0))) { /* "distributed/scheduler.py":6967 * assert ts in cs._wants_what, ( * "not in who_wants' wants_what", * str(ts), # <<<<<<<<<<<<<< * str(cs), * str(cs._wants_what), */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6968 * "not in who_wants' wants_what", * str(ts), * str(cs), # <<<<<<<<<<<<<< * str(cs._wants_what), * ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_cs)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":6969 * str(ts), * str(cs), * str(cs._wants_what), # <<<<<<<<<<<<<< * ) * */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_cs->_wants_what); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "distributed/scheduler.py":6966 * for cs in ts._who_wants: * assert ts in cs._wants_what, ( * "not in who_wants' wants_what", # <<<<<<<<<<<<<< * str(ts), * str(cs), */ __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_kp_u_not_in_who_wants_wants_what); __Pyx_GIVEREF(__pyx_kp_u_not_in_who_wants_wants_what); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_u_not_in_who_wants_wants_what); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_12); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_12 = 0; __pyx_t_12 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 6965, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "distributed/scheduler.py":6962 * ) * * if ts._who_wants: # <<<<<<<<<<<<<< * cs: ClientState * for cs in ts._who_wants: */ } /* "distributed/scheduler.py":6972 * ) * * if ts._actor: # <<<<<<<<<<<<<< * if ts._state == "memory": * assert sum([ts in ws._actors for ws in ts._who_has]) == 1 */ __pyx_t_3 = (__pyx_v_ts->_actor != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6973 * * if ts._actor: * if ts._state == "memory": # <<<<<<<<<<<<<< * assert sum([ts in ws._actors for ws in ts._who_has]) == 1 * if ts._state == "processing": */ __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6973, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "distributed/scheduler.py":6974 * if ts._actor: * if ts._state == "memory": * assert sum([ts in ws._actors for ws in ts._who_has]) == 1 # <<<<<<<<<<<<<< * if ts._state == "processing": * assert ts in ts._processing_on.actors */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { { /* enter inner scope */ __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6974, __pyx_L48_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_11 = __Pyx_set_iterator(__pyx_v_ts->_who_has, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6974, __pyx_L48_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = __pyx_t_11; __pyx_t_11 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_12, __pyx_t_8, &__pyx_t_7, &__pyx_t_11, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 6974, __pyx_L48_error) __Pyx_GOTREF(__pyx_t_11); if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 6974, __pyx_L48_error) __Pyx_XDECREF_SET(__pyx_10genexpr156__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_11)); __pyx_t_11 = 0; if (unlikely(__pyx_10genexpr156__pyx_v_ws->_actors == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6974, __pyx_L48_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_10genexpr156__pyx_v_ws->_actors, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6974, __pyx_L48_error) __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 6974, __pyx_L48_error) __Pyx_GOTREF(__pyx_t_11); if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 6974, __pyx_L48_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF((PyObject *)__pyx_10genexpr156__pyx_v_ws); __pyx_10genexpr156__pyx_v_ws = 0; goto __pyx_L51_exit_scope; __pyx_L48_error:; __Pyx_XDECREF((PyObject *)__pyx_10genexpr156__pyx_v_ws); __pyx_10genexpr156__pyx_v_ws = 0; goto __pyx_L1_error; __pyx_L51_exit_scope:; } /* exit inner scope */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_12, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6974, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6973 * * if ts._actor: * if ts._state == "memory": # <<<<<<<<<<<<<< * assert sum([ts in ws._actors for ws in ts._who_has]) == 1 * if ts._state == "processing": */ } /* "distributed/scheduler.py":6975 * if ts._state == "memory": * assert sum([ts in ws._actors for ws in ts._who_has]) == 1 * if ts._state == "processing": # <<<<<<<<<<<<<< * assert ts in ts._processing_on.actors * */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_ts->_state, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 6975, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "distributed/scheduler.py":6976 * assert sum([ts in ws._actors for ws in ts._who_has]) == 1 * if ts._state == "processing": * assert ts in ts._processing_on.actors # <<<<<<<<<<<<<< * * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ts->_processing_on), __pyx_n_s_actors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(((PyObject *)__pyx_v_ts), __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 6976, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!(__pyx_t_3 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6976, __pyx_L1_error) } } #endif /* "distributed/scheduler.py":6975 * if ts._state == "memory": * assert sum([ts in ws._actors for ws in ts._who_has]) == 1 * if ts._state == "processing": # <<<<<<<<<<<<<< * assert ts in ts._processing_on.actors * */ } /* "distributed/scheduler.py":6972 * ) * * if ts._actor: # <<<<<<<<<<<<<< * if ts._state == "memory": * assert sum([ts in ws._actors for ws in ts._who_has]) == 1 */ } /* "distributed/scheduler.py":6878 * * * def validate_task_state(ts: TaskState): # <<<<<<<<<<<<<< * """ * Validate the given TaskState. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("distributed.scheduler.validate_task_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XDECREF((PyObject *)__pyx_10genexpr154__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_10genexpr155__pyx_v_dts); __Pyx_XDECREF((PyObject *)__pyx_10genexpr156__pyx_v_ws); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6979 * * * def validate_worker_state(ws: WorkerState): # <<<<<<<<<<<<<< * ts: TaskState * for ts in ws._has_what: */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_31validate_worker_state(PyObject *__pyx_self, PyObject *__pyx_v_ws); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_31validate_worker_state = {"validate_worker_state", (PyCFunction)__pyx_pw_11distributed_9scheduler_31validate_worker_state, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_31validate_worker_state(PyObject *__pyx_self, PyObject *__pyx_v_ws) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_worker_state (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ws), __pyx_ptype_11distributed_9scheduler_WorkerState, 1, "ws", 0))) __PYX_ERR(0, 6979, __pyx_L1_error) __pyx_r = __pyx_pf_11distributed_9scheduler_30validate_worker_state(__pyx_self, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v_ws)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_30validate_worker_state(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_worker_state", 0); /* "distributed/scheduler.py":6981 * def validate_worker_state(ws: WorkerState): * ts: TaskState * for ts in ws._has_what: # <<<<<<<<<<<<<< * assert ws in ts._who_has, ( * "not in has_what' who_has", */ __pyx_t_2 = 0; __pyx_t_5 = __Pyx_set_iterator(__pyx_v_ws->_has_what, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 6981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6981, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":6982 * ts: TaskState * for ts in ws._has_what: * assert ws in ts._who_has, ( # <<<<<<<<<<<<<< * "not in has_what' who_has", * str(ws), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ts->_who_has == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 6982, __pyx_L1_error) } __pyx_t_7 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_ws), __pyx_v_ts->_who_has, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 6982, __pyx_L1_error) if (unlikely(!(__pyx_t_7 != 0))) { /* "distributed/scheduler.py":6984 * assert ws in ts._who_has, ( * "not in has_what' who_has", * str(ws), # <<<<<<<<<<<<<< * str(ts), * str(ts._who_has), */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ws)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "distributed/scheduler.py":6985 * "not in has_what' who_has", * str(ws), * str(ts), # <<<<<<<<<<<<<< * str(ts._who_has), * ) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 6985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "distributed/scheduler.py":6986 * str(ws), * str(ts), * str(ts._who_has), # <<<<<<<<<<<<<< * ) * */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ts->_who_has); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "distributed/scheduler.py":6983 * for ts in ws._has_what: * assert ws in ts._who_has, ( * "not in has_what' who_has", # <<<<<<<<<<<<<< * str(ws), * str(ts), */ __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_kp_u_not_in_has_what_who_has); __Pyx_GIVEREF(__pyx_kp_u_not_in_has_what_who_has); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_not_in_has_what_who_has); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9); __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_9 = PyTuple_Pack(1, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 6982, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6989 * ) * * for ts in ws._actors: # <<<<<<<<<<<<<< * assert ts._state in ("memory", "processing") * */ __pyx_t_3 = 0; __pyx_t_9 = __Pyx_set_iterator(__pyx_v_ws->_actors, 1, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_6 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_3, &__pyx_t_9, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 6989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 6989, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_9)); __pyx_t_9 = 0; /* "distributed/scheduler.py":6990 * * for ts in ws._actors: * assert ts._state in ("memory", "processing") # <<<<<<<<<<<<<< * * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __Pyx_INCREF(__pyx_v_ts->_state); __pyx_t_11 = __pyx_v_ts->_state; __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_11, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 6990, __pyx_L1_error) __pyx_t_13 = (__pyx_t_12 != 0); if (!__pyx_t_13) { } else { __pyx_t_7 = __pyx_t_13; goto __pyx_L7_bool_binop_done; } __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_t_11, __pyx_n_u_processing_2, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 6990, __pyx_L1_error) __pyx_t_12 = (__pyx_t_13 != 0); __pyx_t_7 = __pyx_t_12; __pyx_L7_bool_binop_done:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!(__pyx_t_7 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 6990, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6979 * * * def validate_worker_state(ws: WorkerState): # <<<<<<<<<<<<<< * ts: TaskState * for ts in ws._has_what: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("distributed.scheduler.validate_worker_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":6993 * * * def validate_state(tasks, workers, clients): # <<<<<<<<<<<<<< * """ * Validate a current runtime state */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_33validate_state(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11distributed_9scheduler_32validate_state[] = "\n Validate a current runtime state\n\n This performs a sequence of checks on the entire graph, running in about\n linear time. This raises assert errors if anything doesn't check out.\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_33validate_state = {"validate_state", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_33validate_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_32validate_state}; static PyObject *__pyx_pw_11distributed_9scheduler_33validate_state(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tasks = 0; PyObject *__pyx_v_workers = 0; PyObject *__pyx_v_clients = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("validate_state (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tasks,&__pyx_n_s_workers,&__pyx_n_s_clients,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tasks)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_state", 1, 3, 3, 1); __PYX_ERR(0, 6993, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clients)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("validate_state", 1, 3, 3, 2); __PYX_ERR(0, 6993, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate_state") < 0)) __PYX_ERR(0, 6993, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_tasks = values[0]; __pyx_v_workers = values[1]; __pyx_v_clients = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("validate_state", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6993, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.validate_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_32validate_state(__pyx_self, __pyx_v_tasks, __pyx_v_workers, __pyx_v_clients); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_32validate_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tasks, PyObject *__pyx_v_workers, PyObject *__pyx_v_clients) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v_ws = 0; struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v_cs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate_state", 0); /* "distributed/scheduler.py":7001 * """ * ts: TaskState * for ts in tasks.values(): # <<<<<<<<<<<<<< * validate_task_state(ts) * */ __pyx_t_2 = 0; if (unlikely(__pyx_v_tasks == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 7001, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_tasks, 0, __pyx_n_s_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 7001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 7001, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":7002 * ts: TaskState * for ts in tasks.values(): * validate_task_state(ts) # <<<<<<<<<<<<<< * * ws: WorkerState */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_validate_task_state); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, ((PyObject *)__pyx_v_ts)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_ts)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7005 * * ws: WorkerState * for ws in workers.values(): # <<<<<<<<<<<<<< * validate_worker_state(ws) * */ __pyx_t_3 = 0; if (unlikely(__pyx_v_workers == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 7005, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_workers, 0, __pyx_n_s_values, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_3, NULL, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 7005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(0, 7005, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ws, ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":7006 * ws: WorkerState * for ws in workers.values(): * validate_worker_state(ws) # <<<<<<<<<<<<<< * * cs: ClientState */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_validate_worker_state); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, ((PyObject *)__pyx_v_ws)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_ws)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7009 * * cs: ClientState * for cs in clients.values(): # <<<<<<<<<<<<<< * for ts in cs._wants_what: * assert cs in ts._who_wants, ( */ __pyx_t_2 = 0; if (unlikely(__pyx_v_clients == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); __PYX_ERR(0, 7009, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_clients, 0, __pyx_n_s_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 7009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11distributed_9scheduler_ClientState))))) __PYX_ERR(0, 7009, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cs, ((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_t_5)); __pyx_t_5 = 0; /* "distributed/scheduler.py":7010 * cs: ClientState * for cs in clients.values(): * for ts in cs._wants_what: # <<<<<<<<<<<<<< * assert cs in ts._who_wants, ( * "not in wants_what' who_wants", */ __pyx_t_9 = 0; __pyx_t_7 = __Pyx_set_iterator(__pyx_v_cs->_wants_what, 1, (&__pyx_t_10), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_5, __pyx_t_10, &__pyx_t_9, &__pyx_t_7, __pyx_t_6); if (unlikely(__pyx_t_11 == 0)) break; if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 7010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 7010, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_7)); __pyx_t_7 = 0; /* "distributed/scheduler.py":7011 * for cs in clients.values(): * for ts in cs._wants_what: * assert cs in ts._who_wants, ( # <<<<<<<<<<<<<< * "not in wants_what' who_wants", * str(cs), */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(__pyx_v_ts->_who_wants == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 7011, __pyx_L1_error) } __pyx_t_12 = (__Pyx_PySet_ContainsTF(((PyObject *)__pyx_v_cs), __pyx_v_ts->_who_wants, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 7011, __pyx_L1_error) if (unlikely(!(__pyx_t_12 != 0))) { /* "distributed/scheduler.py":7013 * assert cs in ts._who_wants, ( * "not in wants_what' who_wants", * str(cs), # <<<<<<<<<<<<<< * str(ts), * str(ts._who_wants), */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_cs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "distributed/scheduler.py":7014 * "not in wants_what' who_wants", * str(cs), * str(ts), # <<<<<<<<<<<<<< * str(ts._who_wants), * ) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_ts)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 7014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "distributed/scheduler.py":7015 * str(cs), * str(ts), * str(ts._who_wants), # <<<<<<<<<<<<<< * ) * */ __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_ts->_who_wants); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "distributed/scheduler.py":7012 * for ts in cs._wants_what: * assert cs in ts._who_wants, ( * "not in wants_what' who_wants", # <<<<<<<<<<<<<< * str(cs), * str(ts), */ __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 7012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_kp_u_not_in_wants_what_who_wants); __Pyx_GIVEREF(__pyx_kp_u_not_in_wants_what_who_wants); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_kp_u_not_in_wants_what_who_wants); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_13); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_13 = 0; __pyx_t_13 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(0, 7011, __pyx_L1_error) } } #endif } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":6993 * * * def validate_state(tasks, workers, clients): # <<<<<<<<<<<<<< * """ * Validate a current runtime state */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("distributed.scheduler.validate_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XDECREF((PyObject *)__pyx_v_ws); __Pyx_XDECREF((PyObject *)__pyx_v_cs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7022 * * * def heartbeat_interval(n): # <<<<<<<<<<<<<< * """ * Interval in seconds that we desire heartbeats based on number of workers */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_35heartbeat_interval(PyObject *__pyx_self, PyObject *__pyx_v_n); /*proto*/ static char __pyx_doc_11distributed_9scheduler_34heartbeat_interval[] = "\n Interval in seconds that we desire heartbeats based on number of workers\n "; static PyMethodDef __pyx_mdef_11distributed_9scheduler_35heartbeat_interval = {"heartbeat_interval", (PyCFunction)__pyx_pw_11distributed_9scheduler_35heartbeat_interval, METH_O, __pyx_doc_11distributed_9scheduler_34heartbeat_interval}; static PyObject *__pyx_pw_11distributed_9scheduler_35heartbeat_interval(PyObject *__pyx_self, PyObject *__pyx_v_n) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("heartbeat_interval (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_34heartbeat_interval(__pyx_self, ((PyObject *)__pyx_v_n)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_34heartbeat_interval(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("heartbeat_interval", 0); /* "distributed/scheduler.py":7026 * Interval in seconds that we desire heartbeats based on number of workers * """ * if n <= 10: # <<<<<<<<<<<<<< * return 0.5 * elif n < 50: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_int_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7026, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 7026, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":7027 * """ * if n <= 10: * return 0.5 # <<<<<<<<<<<<<< * elif n < 50: * return 1 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_float_0_5); __pyx_r = __pyx_float_0_5; goto __pyx_L0; /* "distributed/scheduler.py":7026 * Interval in seconds that we desire heartbeats based on number of workers * """ * if n <= 10: # <<<<<<<<<<<<<< * return 0.5 * elif n < 50: */ } /* "distributed/scheduler.py":7028 * if n <= 10: * return 0.5 * elif n < 50: # <<<<<<<<<<<<<< * return 1 * elif n < 200: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_int_50, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7028, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 7028, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":7029 * return 0.5 * elif n < 50: * return 1 # <<<<<<<<<<<<<< * elif n < 200: * return 2 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_1); __pyx_r = __pyx_int_1; goto __pyx_L0; /* "distributed/scheduler.py":7028 * if n <= 10: * return 0.5 * elif n < 50: # <<<<<<<<<<<<<< * return 1 * elif n < 200: */ } /* "distributed/scheduler.py":7030 * elif n < 50: * return 1 * elif n < 200: # <<<<<<<<<<<<<< * return 2 * else: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_int_200, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7030, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 7030, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "distributed/scheduler.py":7031 * return 1 * elif n < 200: * return 2 # <<<<<<<<<<<<<< * else: * # no more than 200 hearbeats a second scaled by workers */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_2); __pyx_r = __pyx_int_2; goto __pyx_L0; /* "distributed/scheduler.py":7030 * elif n < 50: * return 1 * elif n < 200: # <<<<<<<<<<<<<< * return 2 * else: */ } /* "distributed/scheduler.py":7034 * else: * # no more than 200 hearbeats a second scaled by workers * return n / 200 + 1 # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_200, 0xC8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "distributed/scheduler.py":7022 * * * def heartbeat_interval(n): # <<<<<<<<<<<<<< * """ * Interval in seconds that we desire heartbeats based on number of workers */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.heartbeat_interval", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7038 * * class KilledWorker(Exception): * def __init__(self, task, last_worker): # <<<<<<<<<<<<<< * super().__init__(task, last_worker) * self.task = task */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_12KilledWorker_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_12KilledWorker_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_12KilledWorker_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_12KilledWorker_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_task = 0; PyObject *__pyx_v_last_worker = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_task,&__pyx_n_s_last_worker,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_task)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 7038, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_last_worker)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 7038, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7038, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_task = values[1]; __pyx_v_last_worker = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7038, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.KilledWorker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_12KilledWorker___init__(__pyx_self, __pyx_v_self, __pyx_v_task, __pyx_v_last_worker); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_12KilledWorker___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task, PyObject *__pyx_v_last_worker) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":7039 * class KilledWorker(Exception): * def __init__(self, task, last_worker): * super().__init__(task, last_worker) # <<<<<<<<<<<<<< * self.task = task * self.last_worker = last_worker */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 7039, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_task, __pyx_v_last_worker}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7039, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_task, __pyx_v_last_worker}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7039, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_task); __Pyx_GIVEREF(__pyx_v_task); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_task); __Pyx_INCREF(__pyx_v_last_worker); __Pyx_GIVEREF(__pyx_v_last_worker); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_last_worker); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7040 * def __init__(self, task, last_worker): * super().__init__(task, last_worker) * self.task = task # <<<<<<<<<<<<<< * self.last_worker = last_worker * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_task, __pyx_v_task) < 0) __PYX_ERR(0, 7040, __pyx_L1_error) /* "distributed/scheduler.py":7041 * super().__init__(task, last_worker) * self.task = task * self.last_worker = last_worker # <<<<<<<<<<<<<< * * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_worker, __pyx_v_last_worker) < 0) __PYX_ERR(0, 7041, __pyx_L1_error) /* "distributed/scheduler.py":7038 * * class KilledWorker(Exception): * def __init__(self, task, last_worker): # <<<<<<<<<<<<<< * super().__init__(task, last_worker) * self.task = task */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.KilledWorker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7052 * """ * * def __init__(self, scheduler, comm): # <<<<<<<<<<<<<< * self.bcomm = BatchedSend(interval="5ms") * self.bcomm.start(comm) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_18WorkerStatusPlugin_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_scheduler = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_scheduler,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scheduler)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 7052, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 7052, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7052, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_scheduler = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7052, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin___init__(__pyx_self, __pyx_v_self, __pyx_v_scheduler, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scheduler, PyObject *__pyx_v_comm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":7053 * * def __init__(self, scheduler, comm): * self.bcomm = BatchedSend(interval="5ms") # <<<<<<<<<<<<<< * self.bcomm.start(comm) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BatchedSend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interval, __pyx_kp_u_5ms) < 0) __PYX_ERR(0, 7053, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bcomm, __pyx_t_3) < 0) __PYX_ERR(0, 7053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":7054 * def __init__(self, scheduler, comm): * self.bcomm = BatchedSend(interval="5ms") * self.bcomm.start(comm) # <<<<<<<<<<<<<< * * self.scheduler = scheduler */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bcomm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_comm) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_comm); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":7056 * self.bcomm.start(comm) * * self.scheduler = scheduler # <<<<<<<<<<<<<< * self.scheduler.add_plugin(self) * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheduler, __pyx_v_scheduler) < 0) __PYX_ERR(0, 7056, __pyx_L1_error) /* "distributed/scheduler.py":7057 * * self.scheduler = scheduler * self.scheduler.add_plugin(self) # <<<<<<<<<<<<<< * * def add_worker(self, worker=None, **kwargs): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheduler); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_add_plugin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":7052 * """ * * def __init__(self, scheduler, comm): # <<<<<<<<<<<<<< * self.bcomm = BatchedSend(interval="5ms") * self.bcomm.start(comm) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7059 * self.scheduler.add_plugin(self) * * def add_worker(self, worker=None, **kwargs): # <<<<<<<<<<<<<< * ident = self.scheduler.workers[worker].identity() * del ident["metrics"] */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_3add_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_18WorkerStatusPlugin_3add_worker = {"add_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_3add_worker, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_3add_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_worker = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_worker (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "add_worker") < 0)) __PYX_ERR(0, 7059, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_worker = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_worker", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7059, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.add_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_2add_worker(__pyx_self, __pyx_v_self, __pyx_v_worker, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_2add_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_ident = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_worker", 0); /* "distributed/scheduler.py":7060 * * def add_worker(self, worker=None, **kwargs): * ident = self.scheduler.workers[worker].identity() # <<<<<<<<<<<<<< * del ident["metrics"] * del ident["last_seen"] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_workers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_identity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_ident = __pyx_t_1; __pyx_t_1 = 0; /* "distributed/scheduler.py":7061 * def add_worker(self, worker=None, **kwargs): * ident = self.scheduler.workers[worker].identity() * del ident["metrics"] # <<<<<<<<<<<<<< * del ident["last_seen"] * try: */ if (unlikely(PyObject_DelItem(__pyx_v_ident, __pyx_n_u_metrics) < 0)) __PYX_ERR(0, 7061, __pyx_L1_error) /* "distributed/scheduler.py":7062 * ident = self.scheduler.workers[worker].identity() * del ident["metrics"] * del ident["last_seen"] # <<<<<<<<<<<<<< * try: * self.bcomm.send(["add", {"workers": {worker: ident}}]) */ if (unlikely(PyObject_DelItem(__pyx_v_ident, __pyx_n_u_last_seen) < 0)) __PYX_ERR(0, 7062, __pyx_L1_error) /* "distributed/scheduler.py":7063 * del ident["metrics"] * del ident["last_seen"] * try: # <<<<<<<<<<<<<< * self.bcomm.send(["add", {"workers": {worker: ident}}]) * except CommClosedError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "distributed/scheduler.py":7064 * del ident["last_seen"] * try: * self.bcomm.send(["add", {"workers": {worker: ident}}]) # <<<<<<<<<<<<<< * except CommClosedError: * self.scheduler.remove_plugin(self) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bcomm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_send); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_v_worker, __pyx_v_ident) < 0) __PYX_ERR(0, 7064, __pyx_L3_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_workers, __pyx_t_7) < 0) __PYX_ERR(0, 7064, __pyx_L3_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_u_add); __Pyx_GIVEREF(__pyx_n_u_add); PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_add); __Pyx_GIVEREF(__pyx_t_3); PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7064, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7063 * del ident["metrics"] * del ident["last_seen"] * try: # <<<<<<<<<<<<<< * self.bcomm.send(["add", {"workers": {worker: ident}}]) * except CommClosedError: */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":7065 * try: * self.bcomm.send(["add", {"workers": {worker: ident}}]) * except CommClosedError: # <<<<<<<<<<<<<< * self.scheduler.remove_plugin(self) * */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7065, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_7 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.add_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 7065, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":7066 * self.bcomm.send(["add", {"workers": {worker: ident}}]) * except CommClosedError: * self.scheduler.remove_plugin(self) # <<<<<<<<<<<<<< * * def remove_worker(self, worker=None, **kwargs): */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheduler); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 7066, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_remove_plugin); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 7066, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_self); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7066, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":7063 * del ident["metrics"] * del ident["last_seen"] * try: # <<<<<<<<<<<<<< * self.bcomm.send(["add", {"workers": {worker: ident}}]) * except CommClosedError: */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L8_try_end:; } /* "distributed/scheduler.py":7059 * self.scheduler.add_plugin(self) * * def add_worker(self, worker=None, **kwargs): # <<<<<<<<<<<<<< * ident = self.scheduler.workers[worker].identity() * del ident["metrics"] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.add_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ident); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7068 * self.scheduler.remove_plugin(self) * * def remove_worker(self, worker=None, **kwargs): # <<<<<<<<<<<<<< * try: * self.bcomm.send(["remove", worker]) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_5remove_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_18WorkerStatusPlugin_5remove_worker = {"remove_worker", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_5remove_worker, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_5remove_worker(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_worker = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_worker (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_worker,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_worker); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "remove_worker") < 0)) __PYX_ERR(0, 7068, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_worker = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_worker", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7068, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_4remove_worker(__pyx_self, __pyx_v_self, __pyx_v_worker, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_4remove_worker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_worker, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_worker", 0); /* "distributed/scheduler.py":7069 * * def remove_worker(self, worker=None, **kwargs): * try: # <<<<<<<<<<<<<< * self.bcomm.send(["remove", worker]) * except CommClosedError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":7070 * def remove_worker(self, worker=None, **kwargs): * try: * self.bcomm.send(["remove", worker]) # <<<<<<<<<<<<<< * except CommClosedError: * self.scheduler.remove_plugin(self) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bcomm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7070, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_send); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7070, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7070, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_u_remove); __Pyx_GIVEREF(__pyx_n_u_remove); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_u_remove); __Pyx_INCREF(__pyx_v_worker); __Pyx_GIVEREF(__pyx_v_worker); PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_worker); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7070, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "distributed/scheduler.py":7069 * * def remove_worker(self, worker=None, **kwargs): * try: # <<<<<<<<<<<<<< * self.bcomm.send(["remove", worker]) * except CommClosedError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "distributed/scheduler.py":7071 * try: * self.bcomm.send(["remove", worker]) * except CommClosedError: # <<<<<<<<<<<<<< * self.scheduler.remove_plugin(self) * */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7071, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 7071, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_4); /* "distributed/scheduler.py":7072 * self.bcomm.send(["remove", worker]) * except CommClosedError: * self.scheduler.remove_plugin(self) # <<<<<<<<<<<<<< * * def teardown(self): */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheduler); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 7072, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_remove_plugin); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 7072, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_self); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7072, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "distributed/scheduler.py":7069 * * def remove_worker(self, worker=None, **kwargs): * try: # <<<<<<<<<<<<<< * self.bcomm.send(["remove", worker]) * except CommClosedError: */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "distributed/scheduler.py":7068 * self.scheduler.remove_plugin(self) * * def remove_worker(self, worker=None, **kwargs): # <<<<<<<<<<<<<< * try: * self.bcomm.send(["remove", worker]) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.remove_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7074 * self.scheduler.remove_plugin(self) * * def teardown(self): # <<<<<<<<<<<<<< * self.bcomm.close() * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_7teardown(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_18WorkerStatusPlugin_7teardown = {"teardown", (PyCFunction)__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_7teardown, METH_O, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_18WorkerStatusPlugin_7teardown(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("teardown (wrapper)", 0); __pyx_r = __pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_6teardown(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_18WorkerStatusPlugin_6teardown(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("teardown", 0); /* "distributed/scheduler.py":7075 * * def teardown(self): * self.bcomm.close() # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bcomm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7074 * self.scheduler.remove_plugin(self) * * def teardown(self): # <<<<<<<<<<<<<< * self.bcomm.close() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.WorkerStatusPlugin.teardown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7079 * * class CollectTaskMetaDataPlugin(SchedulerPlugin): * def __init__(self, scheduler, name): # <<<<<<<<<<<<<< * self.scheduler = scheduler * self.name = name */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_25CollectTaskMetaDataPlugin_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_scheduler = 0; PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_scheduler,&__pyx_n_s_name,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scheduler)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 7079, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 7079, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7079, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_scheduler = values[1]; __pyx_v_name = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7079, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.CollectTaskMetaDataPlugin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin___init__(__pyx_self, __pyx_v_self, __pyx_v_scheduler, __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scheduler, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "distributed/scheduler.py":7080 * class CollectTaskMetaDataPlugin(SchedulerPlugin): * def __init__(self, scheduler, name): * self.scheduler = scheduler # <<<<<<<<<<<<<< * self.name = name * self.keys = set() */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheduler, __pyx_v_scheduler) < 0) __PYX_ERR(0, 7080, __pyx_L1_error) /* "distributed/scheduler.py":7081 * def __init__(self, scheduler, name): * self.scheduler = scheduler * self.name = name # <<<<<<<<<<<<<< * self.keys = set() * self.metadata = {} */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 7081, __pyx_L1_error) /* "distributed/scheduler.py":7082 * self.scheduler = scheduler * self.name = name * self.keys = set() # <<<<<<<<<<<<<< * self.metadata = {} * self.state = {} */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_keys, __pyx_t_1) < 0) __PYX_ERR(0, 7082, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7083 * self.name = name * self.keys = set() * self.metadata = {} # <<<<<<<<<<<<<< * self.state = {} * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_metadata, __pyx_t_1) < 0) __PYX_ERR(0, 7083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7084 * self.keys = set() * self.metadata = {} * self.state = {} # <<<<<<<<<<<<<< * * def update_graph(self, scheduler, dsk=None, keys=None, restrictions=None, **kwargs): */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_state, __pyx_t_1) < 0) __PYX_ERR(0, 7084, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7079 * * class CollectTaskMetaDataPlugin(SchedulerPlugin): * def __init__(self, scheduler, name): # <<<<<<<<<<<<<< * self.scheduler = scheduler * self.name = name */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("distributed.scheduler.CollectTaskMetaDataPlugin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7086 * self.state = {} * * def update_graph(self, scheduler, dsk=None, keys=None, restrictions=None, **kwargs): # <<<<<<<<<<<<<< * self.keys.update(keys) * */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_3update_graph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_25CollectTaskMetaDataPlugin_3update_graph = {"update_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_3update_graph, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_3update_graph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_scheduler = 0; CYTHON_UNUSED PyObject *__pyx_v_dsk = 0; PyObject *__pyx_v_keys = 0; CYTHON_UNUSED PyObject *__pyx_v_restrictions = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update_graph (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_scheduler,&__pyx_n_s_dsk,&__pyx_n_s_keys,&__pyx_n_s_restrictions,0}; PyObject* values[5] = {0,0,0,0,0}; values[2] = ((PyObject *)((PyObject *)Py_None)); values[3] = ((PyObject *)((PyObject *)Py_None)); values[4] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scheduler)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("update_graph", 0, 2, 5, 1); __PYX_ERR(0, 7086, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsk); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_restrictions); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "update_graph") < 0)) __PYX_ERR(0, 7086, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_scheduler = values[1]; __pyx_v_dsk = values[2]; __pyx_v_keys = values[3]; __pyx_v_restrictions = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update_graph", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7086, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.CollectTaskMetaDataPlugin.update_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin_2update_graph(__pyx_self, __pyx_v_self, __pyx_v_scheduler, __pyx_v_dsk, __pyx_v_keys, __pyx_v_restrictions, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin_2update_graph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_scheduler, CYTHON_UNUSED PyObject *__pyx_v_dsk, PyObject *__pyx_v_keys, CYTHON_UNUSED PyObject *__pyx_v_restrictions, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update_graph", 0); /* "distributed/scheduler.py":7087 * * def update_graph(self, scheduler, dsk=None, keys=None, restrictions=None, **kwargs): * self.keys.update(keys) # <<<<<<<<<<<<<< * * def transition(self, key, start, finish, *args, **kwargs): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_keys) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7086 * self.state = {} * * def update_graph(self, scheduler, dsk=None, keys=None, restrictions=None, **kwargs): # <<<<<<<<<<<<<< * self.keys.update(keys) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("distributed.scheduler.CollectTaskMetaDataPlugin.update_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "distributed/scheduler.py":7089 * self.keys.update(keys) * * def transition(self, key, start, finish, *args, **kwargs): # <<<<<<<<<<<<<< * if finish == "memory" or finish == "erred": * ts: TaskState = self.scheduler.tasks.get(key) */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_5transition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_25CollectTaskMetaDataPlugin_5transition = {"transition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_5transition, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_25CollectTaskMetaDataPlugin_5transition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; CYTHON_UNUSED PyObject *__pyx_v_start = 0; PyObject *__pyx_v_finish = 0; CYTHON_UNUSED PyObject *__pyx_v_args = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transition (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); if (PyTuple_GET_SIZE(__pyx_args) > 4) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 4, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_start,&__pyx_n_s_finish,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("transition", 0, 4, 4, 1); __PYX_ERR(0, 7089, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("transition", 0, 4, 4, 2); __PYX_ERR(0, 7089, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_finish)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("transition", 0, 4, 4, 3); __PYX_ERR(0, 7089, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 4) ? pos_args : 4; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "transition") < 0)) __PYX_ERR(0, 7089, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_start = values[2]; __pyx_v_finish = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transition", 0, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7089, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("distributed.scheduler.CollectTaskMetaDataPlugin.transition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin_4transition(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_start, __pyx_v_finish, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_25CollectTaskMetaDataPlugin_4transition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, CYTHON_UNUSED PyObject *__pyx_v_start, PyObject *__pyx_v_finish, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transition", 0); /* "distributed/scheduler.py":7090 * * def transition(self, key, start, finish, *args, **kwargs): * if finish == "memory" or finish == "erred": # <<<<<<<<<<<<<< * ts: TaskState = self.scheduler.tasks.get(key) * if ts is not None and ts._key in self.keys: */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_finish, __pyx_n_u_memory_2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 7090, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_finish, __pyx_n_u_erred, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 7090, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "distributed/scheduler.py":7091 * def transition(self, key, start, finish, *args, **kwargs): * if finish == "memory" or finish == "erred": * ts: TaskState = self.scheduler.tasks.get(key) # <<<<<<<<<<<<<< * if ts is not None and ts._key in self.keys: * self.metadata[key] = ts._metadata */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheduler); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tasks); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11distributed_9scheduler_TaskState))))) __PYX_ERR(0, 7091, __pyx_L1_error) __pyx_v_ts = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":7092 * if finish == "memory" or finish == "erred": * ts: TaskState = self.scheduler.tasks.get(key) * if ts is not None and ts._key in self.keys: # <<<<<<<<<<<<<< * self.metadata[key] = ts._metadata * self.state[key] = finish */ __pyx_t_2 = (((PyObject *)__pyx_v_ts) != Py_None); __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_ts->_key, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 7092, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { /* "distributed/scheduler.py":7093 * ts: TaskState = self.scheduler.tasks.get(key) * if ts is not None and ts._key in self.keys: * self.metadata[key] = ts._metadata # <<<<<<<<<<<<<< * self.state[key] = finish * self.keys.discard(key) */ __pyx_t_3 = __pyx_v_ts->_metadata; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_key, __pyx_t_3) < 0)) __PYX_ERR(0, 7093, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":7094 * if ts is not None and ts._key in self.keys: * self.metadata[key] = ts._metadata * self.state[key] = finish # <<<<<<<<<<<<<< * self.keys.discard(key) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_key, __pyx_v_finish) < 0)) __PYX_ERR(0, 7094, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":7095 * self.metadata[key] = ts._metadata * self.state[key] = finish * self.keys.discard(key) # <<<<<<<<<<<<<< */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_discard); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "distributed/scheduler.py":7092 * if finish == "memory" or finish == "erred": * ts: TaskState = self.scheduler.tasks.get(key) * if ts is not None and ts._key in self.keys: # <<<<<<<<<<<<<< * self.metadata[key] = ts._metadata * self.state[key] = finish */ } /* "distributed/scheduler.py":7090 * * def transition(self, key, start, finish, *args, **kwargs): * if finish == "memory" or finish == "erred": # <<<<<<<<<<<<<< * ts: TaskState = self.scheduler.tasks.get(key) * if ts is not None and ts._key in self.keys: */ } /* "distributed/scheduler.py":7089 * self.keys.update(keys) * * def transition(self, key, start, finish, *args, **kwargs): # <<<<<<<<<<<<<< * if finish == "memory" or finish == "erred": * ts: TaskState = self.scheduler.tasks.get(key) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.CollectTaskMetaDataPlugin.transition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_ClientState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_37__pyx_unpickle_ClientState(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_37__pyx_unpickle_ClientState = {"__pyx_unpickle_ClientState", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_37__pyx_unpickle_ClientState, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_37__pyx_unpickle_ClientState(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_ClientState (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientState", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientState", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ClientState") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientState", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_ClientState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_36__pyx_unpickle_ClientState(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_36__pyx_unpickle_ClientState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_ClientState", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x38edd31: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x38edd31 = (_client_key, _hash, _last_seen, _versions, _wants_what))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x38edd31) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0x38edd31: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x38edd31 = (_client_key, _hash, _last_seen, _versions, _wants_what))" % __pyx_checksum) * __pyx_result = ClientState.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0x38edd31: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x38edd31 = (_client_key, _hash, _last_seen, _versions, _wants_what))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = ClientState.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x38, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x38edd31: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x38edd31 = (_client_key, _hash, _last_seen, _versions, _wants_what))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x38edd31 = (_client_key, _hash, _last_seen, _versions, _wants_what))" % __pyx_checksum) * __pyx_result = ClientState.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_ClientState__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11distributed_9scheduler_ClientState), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x38edd31 = (_client_key, _hash, _last_seen, _versions, _wants_what))" % __pyx_checksum) * __pyx_result = ClientState.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_ClientState__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = ClientState.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_ClientState__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_ClientState__set_state(ClientState __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_3 = __pyx_f_11distributed_9scheduler___pyx_unpickle_ClientState__set_state(((struct __pyx_obj_11distributed_9scheduler_ClientState *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x38edd31 = (_client_key, _hash, _last_seen, _versions, _wants_what))" % __pyx_checksum) * __pyx_result = ClientState.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_ClientState__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_ClientState__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_ClientState__set_state(ClientState __pyx_result, tuple __pyx_state): * __pyx_result._client_key = __pyx_state[0]; __pyx_result._hash = __pyx_state[1]; __pyx_result._last_seen = __pyx_state[2]; __pyx_result._versions = __pyx_state[3]; __pyx_result._wants_what = __pyx_state[4] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_ClientState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_ClientState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_ClientState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_ClientState__set_state(ClientState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._client_key = __pyx_state[0]; __pyx_result._hash = __pyx_state[1]; __pyx_result._last_seen = __pyx_state[2]; __pyx_result._versions = __pyx_state[3]; __pyx_result._wants_what = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_ClientState__set_state(struct __pyx_obj_11distributed_9scheduler_ClientState *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_hash_t __pyx_t_2; double __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_ClientState__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_ClientState__set_state(ClientState __pyx_result, tuple __pyx_state): * __pyx_result._client_key = __pyx_state[0]; __pyx_result._hash = __pyx_state[1]; __pyx_result._last_seen = __pyx_state[2]; __pyx_result._versions = __pyx_state[3]; __pyx_result._wants_what = __pyx_state[4] # <<<<<<<<<<<<<< * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[5]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_client_key); __Pyx_DECREF(__pyx_v___pyx_result->_client_key); __pyx_v___pyx_result->_client_key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AsHash_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_hash_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_hash = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_last_seen = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_versions); __Pyx_DECREF(__pyx_v___pyx_result->_versions); __pyx_v___pyx_result->_versions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_wants_what); __Pyx_DECREF(__pyx_v___pyx_result->_wants_what); __pyx_v___pyx_result->_wants_what = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_ClientState__set_state(ClientState __pyx_result, tuple __pyx_state): * __pyx_result._client_key = __pyx_state[0]; __pyx_result._hash = __pyx_state[1]; __pyx_result._last_seen = __pyx_state[2]; __pyx_result._versions = __pyx_state[3]; __pyx_result._wants_what = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[5]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_5 > 5) != 0); if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_4 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "(tree fragment)":14 * __pyx_result._client_key = __pyx_state[0]; __pyx_result._hash = __pyx_state[1]; __pyx_result._last_seen = __pyx_state[2]; __pyx_result._versions = __pyx_state[3]; __pyx_result._wants_what = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[5]) # <<<<<<<<<<<<<< */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_ClientState__set_state(ClientState __pyx_result, tuple __pyx_state): * __pyx_result._client_key = __pyx_state[0]; __pyx_result._hash = __pyx_state[1]; __pyx_result._last_seen = __pyx_state[2]; __pyx_result._versions = __pyx_state[3]; __pyx_result._wants_what = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[5]) */ } /* "(tree fragment)":11 * __pyx_unpickle_ClientState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_ClientState__set_state(ClientState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._client_key = __pyx_state[0]; __pyx_result._hash = __pyx_state[1]; __pyx_result._last_seen = __pyx_state[2]; __pyx_result._versions = __pyx_state[3]; __pyx_result._wants_what = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_ClientState__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_WorkerState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_39__pyx_unpickle_WorkerState(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_39__pyx_unpickle_WorkerState = {"__pyx_unpickle_WorkerState", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_39__pyx_unpickle_WorkerState, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_39__pyx_unpickle_WorkerState(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_WorkerState (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_WorkerState", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_WorkerState", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_WorkerState") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_WorkerState", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_WorkerState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_38__pyx_unpickle_WorkerState(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_38__pyx_unpickle_WorkerState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_WorkerState", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x694d44f: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x694d44f = (_actors, _address, _bandwidth, _executing, _extra, _has_what, _hash, _last_seen, _local_directory, _memory_limit, _metrics, _name, _nanny, _nbytes, _nthreads, _occupancy, _pid, _processing, _resources, _services, _status, _time_delay, _used_resources, _versions))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x694d44f) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0x694d44f: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x694d44f = (_actors, _address, _bandwidth, _executing, _extra, _has_what, _hash, _last_seen, _local_directory, _memory_limit, _metrics, _name, _nanny, _nbytes, _nthreads, _occupancy, _pid, _processing, _resources, _services, _status, _time_delay, _used_resources, _versions))" % __pyx_checksum) * __pyx_result = WorkerState.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0x694d44f: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x694d44f = (_actors, _address, _bandwidth, _executing, _extra, _has_what, _hash, _last_seen, _local_directory, _memory_limit, _metrics, _name, _nanny, _nbytes, _nthreads, _occupancy, _pid, _processing, _resources, _services, _status, _time_delay, _used_resources, _versions))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = WorkerState.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x69, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x694d44f: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x694d44f = (_actors, _address, _bandwidth, _executing, _extra, _has_what, _hash, _last_seen, _local_directory, _memory_limit, _metrics, _name, _nanny, _nbytes, _nthreads, _occupancy, _pid, _processing, _resources, _services, _status, _time_delay, _used_resources, _versions))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x694d44f = (_actors, _address, _bandwidth, _executing, _extra, _has_what, _hash, _last_seen, _local_directory, _memory_limit, _metrics, _name, _nanny, _nbytes, _nthreads, _occupancy, _pid, _processing, _resources, _services, _status, _time_delay, _used_resources, _versions))" % __pyx_checksum) * __pyx_result = WorkerState.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_WorkerState__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11distributed_9scheduler_WorkerState), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x694d44f = (_actors, _address, _bandwidth, _executing, _extra, _has_what, _hash, _last_seen, _local_directory, _memory_limit, _metrics, _name, _nanny, _nbytes, _nthreads, _occupancy, _pid, _processing, _resources, _services, _status, _time_delay, _used_resources, _versions))" % __pyx_checksum) * __pyx_result = WorkerState.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_WorkerState__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = WorkerState.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_WorkerState__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_WorkerState__set_state(WorkerState __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_3 = __pyx_f_11distributed_9scheduler___pyx_unpickle_WorkerState__set_state(((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x694d44f = (_actors, _address, _bandwidth, _executing, _extra, _has_what, _hash, _last_seen, _local_directory, _memory_limit, _metrics, _name, _nanny, _nbytes, _nthreads, _occupancy, _pid, _processing, _resources, _services, _status, _time_delay, _used_resources, _versions))" % __pyx_checksum) * __pyx_result = WorkerState.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_WorkerState__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_WorkerState__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_WorkerState__set_state(WorkerState __pyx_result, tuple __pyx_state): * __pyx_result._actors = __pyx_state[0]; __pyx_result._address = __pyx_state[1]; __pyx_result._bandwidth = __pyx_state[2]; __pyx_result._executing = __pyx_state[3]; __pyx_result._extra = __pyx_state[4]; __pyx_result._has_what = __pyx_state[5]; __pyx_result._hash = __pyx_state[6]; __pyx_result._last_seen = __pyx_state[7]; __pyx_result._local_directory = __pyx_state[8]; __pyx_result._memory_limit = __pyx_state[9]; __pyx_result._metrics = __pyx_state[10]; __pyx_result._name = __pyx_state[11]; __pyx_result._nanny = __pyx_state[12]; __pyx_result._nbytes = __pyx_state[13]; __pyx_result._nthreads = __pyx_state[14]; __pyx_result._occupancy = __pyx_state[15]; __pyx_result._pid = __pyx_state[16]; __pyx_result._processing = __pyx_state[17]; __pyx_result._resources = __pyx_state[18]; __pyx_result._services = __pyx_state[19]; __pyx_result._status = __pyx_state[20]; __pyx_result._time_delay = __pyx_state[21]; __pyx_result._used_resources = __pyx_state[22]; __pyx_result._versions = __pyx_state[23] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_WorkerState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_WorkerState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_WorkerState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_WorkerState__set_state(WorkerState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._actors = __pyx_state[0]; __pyx_result._address = __pyx_state[1]; __pyx_result._bandwidth = __pyx_state[2]; __pyx_result._executing = __pyx_state[3]; __pyx_result._extra = __pyx_state[4]; __pyx_result._has_what = __pyx_state[5]; __pyx_result._hash = __pyx_state[6]; __pyx_result._last_seen = __pyx_state[7]; __pyx_result._local_directory = __pyx_state[8]; __pyx_result._memory_limit = __pyx_state[9]; __pyx_result._metrics = __pyx_state[10]; __pyx_result._name = __pyx_state[11]; __pyx_result._nanny = __pyx_state[12]; __pyx_result._nbytes = __pyx_state[13]; __pyx_result._nthreads = __pyx_state[14]; __pyx_result._occupancy = __pyx_state[15]; __pyx_result._pid = __pyx_state[16]; __pyx_result._processing = __pyx_state[17]; __pyx_result._resources = __pyx_state[18]; __pyx_result._services = __pyx_state[19]; __pyx_result._status = __pyx_state[20]; __pyx_result._time_delay = __pyx_state[21]; __pyx_result._used_resources = __pyx_state[22]; __pyx_result._versions = __pyx_state[23] * if len(__pyx_state) > 24 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_WorkerState__set_state(struct __pyx_obj_11distributed_9scheduler_WorkerState *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; Py_hash_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_WorkerState__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_WorkerState__set_state(WorkerState __pyx_result, tuple __pyx_state): * __pyx_result._actors = __pyx_state[0]; __pyx_result._address = __pyx_state[1]; __pyx_result._bandwidth = __pyx_state[2]; __pyx_result._executing = __pyx_state[3]; __pyx_result._extra = __pyx_state[4]; __pyx_result._has_what = __pyx_state[5]; __pyx_result._hash = __pyx_state[6]; __pyx_result._last_seen = __pyx_state[7]; __pyx_result._local_directory = __pyx_state[8]; __pyx_result._memory_limit = __pyx_state[9]; __pyx_result._metrics = __pyx_state[10]; __pyx_result._name = __pyx_state[11]; __pyx_result._nanny = __pyx_state[12]; __pyx_result._nbytes = __pyx_state[13]; __pyx_result._nthreads = __pyx_state[14]; __pyx_result._occupancy = __pyx_state[15]; __pyx_result._pid = __pyx_state[16]; __pyx_result._processing = __pyx_state[17]; __pyx_result._resources = __pyx_state[18]; __pyx_result._services = __pyx_state[19]; __pyx_result._status = __pyx_state[20]; __pyx_result._time_delay = __pyx_state[21]; __pyx_result._used_resources = __pyx_state[22]; __pyx_result._versions = __pyx_state[23] # <<<<<<<<<<<<<< * if len(__pyx_state) > 24 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[24]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_actors); __Pyx_DECREF(__pyx_v___pyx_result->_actors); __pyx_v___pyx_result->_actors = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_address); __Pyx_DECREF(__pyx_v___pyx_result->_address); __pyx_v___pyx_result->_address = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_bandwidth = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_executing); __Pyx_DECREF(__pyx_v___pyx_result->_executing); __pyx_v___pyx_result->_executing = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_extra); __Pyx_DECREF(__pyx_v___pyx_result->_extra); __pyx_v___pyx_result->_extra = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_has_what); __Pyx_DECREF(__pyx_v___pyx_result->_has_what); __pyx_v___pyx_result->_has_what = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_AsHash_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_hash_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_hash = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_last_seen = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_local_directory); __Pyx_DECREF(__pyx_v___pyx_result->_local_directory); __pyx_v___pyx_result->_local_directory = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_memory_limit = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_metrics); __Pyx_DECREF(__pyx_v___pyx_result->_metrics); __pyx_v___pyx_result->_metrics = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_name); __Pyx_DECREF(__pyx_v___pyx_result->_name); __pyx_v___pyx_result->_name = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_nanny); __Pyx_DECREF(__pyx_v___pyx_result->_nanny); __pyx_v___pyx_result->_nanny = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_nbytes = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_nthreads = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_occupancy = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_pid = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_processing); __Pyx_DECREF(__pyx_v___pyx_result->_processing); __pyx_v___pyx_result->_processing = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_resources); __Pyx_DECREF(__pyx_v___pyx_result->_resources); __pyx_v___pyx_result->_resources = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_services); __Pyx_DECREF(__pyx_v___pyx_result->_services); __pyx_v___pyx_result->_services = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_status); __Pyx_DECREF(__pyx_v___pyx_result->_status); __pyx_v___pyx_result->_status = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_time_delay = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_used_resources); __Pyx_DECREF(__pyx_v___pyx_result->_used_resources); __pyx_v___pyx_result->_used_resources = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_versions); __Pyx_DECREF(__pyx_v___pyx_result->_versions); __pyx_v___pyx_result->_versions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_WorkerState__set_state(WorkerState __pyx_result, tuple __pyx_state): * __pyx_result._actors = __pyx_state[0]; __pyx_result._address = __pyx_state[1]; __pyx_result._bandwidth = __pyx_state[2]; __pyx_result._executing = __pyx_state[3]; __pyx_result._extra = __pyx_state[4]; __pyx_result._has_what = __pyx_state[5]; __pyx_result._hash = __pyx_state[6]; __pyx_result._last_seen = __pyx_state[7]; __pyx_result._local_directory = __pyx_state[8]; __pyx_result._memory_limit = __pyx_state[9]; __pyx_result._metrics = __pyx_state[10]; __pyx_result._name = __pyx_state[11]; __pyx_result._nanny = __pyx_state[12]; __pyx_result._nbytes = __pyx_state[13]; __pyx_result._nthreads = __pyx_state[14]; __pyx_result._occupancy = __pyx_state[15]; __pyx_result._pid = __pyx_state[16]; __pyx_result._processing = __pyx_state[17]; __pyx_result._resources = __pyx_state[18]; __pyx_result._services = __pyx_state[19]; __pyx_result._status = __pyx_state[20]; __pyx_result._time_delay = __pyx_state[21]; __pyx_result._used_resources = __pyx_state[22]; __pyx_result._versions = __pyx_state[23] * if len(__pyx_state) > 24 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[24]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_4 > 24) != 0); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_5 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_5) { /* "(tree fragment)":14 * __pyx_result._actors = __pyx_state[0]; __pyx_result._address = __pyx_state[1]; __pyx_result._bandwidth = __pyx_state[2]; __pyx_result._executing = __pyx_state[3]; __pyx_result._extra = __pyx_state[4]; __pyx_result._has_what = __pyx_state[5]; __pyx_result._hash = __pyx_state[6]; __pyx_result._last_seen = __pyx_state[7]; __pyx_result._local_directory = __pyx_state[8]; __pyx_result._memory_limit = __pyx_state[9]; __pyx_result._metrics = __pyx_state[10]; __pyx_result._name = __pyx_state[11]; __pyx_result._nanny = __pyx_state[12]; __pyx_result._nbytes = __pyx_state[13]; __pyx_result._nthreads = __pyx_state[14]; __pyx_result._occupancy = __pyx_state[15]; __pyx_result._pid = __pyx_state[16]; __pyx_result._processing = __pyx_state[17]; __pyx_result._resources = __pyx_state[18]; __pyx_result._services = __pyx_state[19]; __pyx_result._status = __pyx_state[20]; __pyx_result._time_delay = __pyx_state[21]; __pyx_result._used_resources = __pyx_state[22]; __pyx_result._versions = __pyx_state[23] * if len(__pyx_state) > 24 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[24]) # <<<<<<<<<<<<<< */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_WorkerState__set_state(WorkerState __pyx_result, tuple __pyx_state): * __pyx_result._actors = __pyx_state[0]; __pyx_result._address = __pyx_state[1]; __pyx_result._bandwidth = __pyx_state[2]; __pyx_result._executing = __pyx_state[3]; __pyx_result._extra = __pyx_state[4]; __pyx_result._has_what = __pyx_state[5]; __pyx_result._hash = __pyx_state[6]; __pyx_result._last_seen = __pyx_state[7]; __pyx_result._local_directory = __pyx_state[8]; __pyx_result._memory_limit = __pyx_state[9]; __pyx_result._metrics = __pyx_state[10]; __pyx_result._name = __pyx_state[11]; __pyx_result._nanny = __pyx_state[12]; __pyx_result._nbytes = __pyx_state[13]; __pyx_result._nthreads = __pyx_state[14]; __pyx_result._occupancy = __pyx_state[15]; __pyx_result._pid = __pyx_state[16]; __pyx_result._processing = __pyx_state[17]; __pyx_result._resources = __pyx_state[18]; __pyx_result._services = __pyx_state[19]; __pyx_result._status = __pyx_state[20]; __pyx_result._time_delay = __pyx_state[21]; __pyx_result._used_resources = __pyx_state[22]; __pyx_result._versions = __pyx_state[23] * if len(__pyx_state) > 24 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[24]) */ } /* "(tree fragment)":11 * __pyx_unpickle_WorkerState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_WorkerState__set_state(WorkerState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._actors = __pyx_state[0]; __pyx_result._address = __pyx_state[1]; __pyx_result._bandwidth = __pyx_state[2]; __pyx_result._executing = __pyx_state[3]; __pyx_result._extra = __pyx_state[4]; __pyx_result._has_what = __pyx_state[5]; __pyx_result._hash = __pyx_state[6]; __pyx_result._last_seen = __pyx_state[7]; __pyx_result._local_directory = __pyx_state[8]; __pyx_result._memory_limit = __pyx_state[9]; __pyx_result._metrics = __pyx_state[10]; __pyx_result._name = __pyx_state[11]; __pyx_result._nanny = __pyx_state[12]; __pyx_result._nbytes = __pyx_state[13]; __pyx_result._nthreads = __pyx_state[14]; __pyx_result._occupancy = __pyx_state[15]; __pyx_result._pid = __pyx_state[16]; __pyx_result._processing = __pyx_state[17]; __pyx_result._resources = __pyx_state[18]; __pyx_result._services = __pyx_state[19]; __pyx_result._status = __pyx_state[20]; __pyx_result._time_delay = __pyx_state[21]; __pyx_result._used_resources = __pyx_state[22]; __pyx_result._versions = __pyx_state[23] * if len(__pyx_state) > 24 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_WorkerState__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_TaskPrefix(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_41__pyx_unpickle_TaskPrefix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_41__pyx_unpickle_TaskPrefix = {"__pyx_unpickle_TaskPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_41__pyx_unpickle_TaskPrefix, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_41__pyx_unpickle_TaskPrefix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_TaskPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskPrefix", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskPrefix", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_TaskPrefix") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskPrefix", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_40__pyx_unpickle_TaskPrefix(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_40__pyx_unpickle_TaskPrefix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TaskPrefix", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x9bc1f9f: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9bc1f9f = (_all_durations, _duration_average, _groups, _name, _suspicious))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x9bc1f9f) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0x9bc1f9f: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9bc1f9f = (_all_durations, _duration_average, _groups, _name, _suspicious))" % __pyx_checksum) * __pyx_result = TaskPrefix.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0x9bc1f9f: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9bc1f9f = (_all_durations, _duration_average, _groups, _name, _suspicious))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = TaskPrefix.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x9b, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x9bc1f9f: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9bc1f9f = (_all_durations, _duration_average, _groups, _name, _suspicious))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9bc1f9f = (_all_durations, _duration_average, _groups, _name, _suspicious))" % __pyx_checksum) * __pyx_result = TaskPrefix.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_TaskPrefix__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11distributed_9scheduler_TaskPrefix), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9bc1f9f = (_all_durations, _duration_average, _groups, _name, _suspicious))" % __pyx_checksum) * __pyx_result = TaskPrefix.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TaskPrefix__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = TaskPrefix.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_TaskPrefix__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_TaskPrefix__set_state(TaskPrefix __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_3 = __pyx_f_11distributed_9scheduler___pyx_unpickle_TaskPrefix__set_state(((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9bc1f9f = (_all_durations, _duration_average, _groups, _name, _suspicious))" % __pyx_checksum) * __pyx_result = TaskPrefix.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TaskPrefix__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_TaskPrefix__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_TaskPrefix__set_state(TaskPrefix __pyx_result, tuple __pyx_state): * __pyx_result._all_durations = __pyx_state[0]; __pyx_result._duration_average = __pyx_state[1]; __pyx_result._groups = __pyx_state[2]; __pyx_result._name = __pyx_state[3]; __pyx_result._suspicious = __pyx_state[4] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_TaskPrefix(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_TaskPrefix__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TaskPrefix__set_state(TaskPrefix __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._all_durations = __pyx_state[0]; __pyx_result._duration_average = __pyx_state[1]; __pyx_result._groups = __pyx_state[2]; __pyx_result._name = __pyx_state[3]; __pyx_result._suspicious = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_TaskPrefix__set_state(struct __pyx_obj_11distributed_9scheduler_TaskPrefix *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TaskPrefix__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_TaskPrefix__set_state(TaskPrefix __pyx_result, tuple __pyx_state): * __pyx_result._all_durations = __pyx_state[0]; __pyx_result._duration_average = __pyx_state[1]; __pyx_result._groups = __pyx_state[2]; __pyx_result._name = __pyx_state[3]; __pyx_result._suspicious = __pyx_state[4] # <<<<<<<<<<<<<< * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[5]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_all_durations); __Pyx_DECREF(__pyx_v___pyx_result->_all_durations); __pyx_v___pyx_result->_all_durations = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_duration_average = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_groups); __Pyx_DECREF(__pyx_v___pyx_result->_groups); __pyx_v___pyx_result->_groups = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_name); __Pyx_DECREF(__pyx_v___pyx_result->_name); __pyx_v___pyx_result->_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_suspicious = __pyx_t_3; /* "(tree fragment)":13 * cdef __pyx_unpickle_TaskPrefix__set_state(TaskPrefix __pyx_result, tuple __pyx_state): * __pyx_result._all_durations = __pyx_state[0]; __pyx_result._duration_average = __pyx_state[1]; __pyx_result._groups = __pyx_state[2]; __pyx_result._name = __pyx_state[3]; __pyx_result._suspicious = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[5]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_3 > 5) != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); __pyx_t_4 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "(tree fragment)":14 * __pyx_result._all_durations = __pyx_state[0]; __pyx_result._duration_average = __pyx_state[1]; __pyx_result._groups = __pyx_state[2]; __pyx_result._name = __pyx_state[3]; __pyx_result._suspicious = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[5]) # <<<<<<<<<<<<<< */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TaskPrefix__set_state(TaskPrefix __pyx_result, tuple __pyx_state): * __pyx_result._all_durations = __pyx_state[0]; __pyx_result._duration_average = __pyx_state[1]; __pyx_result._groups = __pyx_state[2]; __pyx_result._name = __pyx_state[3]; __pyx_result._suspicious = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[5]) */ } /* "(tree fragment)":11 * __pyx_unpickle_TaskPrefix__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TaskPrefix__set_state(TaskPrefix __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._all_durations = __pyx_state[0]; __pyx_result._duration_average = __pyx_state[1]; __pyx_result._groups = __pyx_state[2]; __pyx_result._name = __pyx_state[3]; __pyx_result._suspicious = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskPrefix__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_TaskGroup(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_43__pyx_unpickle_TaskGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_43__pyx_unpickle_TaskGroup = {"__pyx_unpickle_TaskGroup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_43__pyx_unpickle_TaskGroup, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_43__pyx_unpickle_TaskGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_TaskGroup (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskGroup", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskGroup", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_TaskGroup") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskGroup", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_42__pyx_unpickle_TaskGroup(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_42__pyx_unpickle_TaskGroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TaskGroup", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x813f495: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x813f495 = (_dependencies, _duration, _name, _nbytes_in_memory, _nbytes_total, _prefix, _states, _types))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x813f495) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0x813f495: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x813f495 = (_dependencies, _duration, _name, _nbytes_in_memory, _nbytes_total, _prefix, _states, _types))" % __pyx_checksum) * __pyx_result = TaskGroup.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0x813f495: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x813f495 = (_dependencies, _duration, _name, _nbytes_in_memory, _nbytes_total, _prefix, _states, _types))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = TaskGroup.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x81, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x813f495: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x813f495 = (_dependencies, _duration, _name, _nbytes_in_memory, _nbytes_total, _prefix, _states, _types))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x813f495 = (_dependencies, _duration, _name, _nbytes_in_memory, _nbytes_total, _prefix, _states, _types))" % __pyx_checksum) * __pyx_result = TaskGroup.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_TaskGroup__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11distributed_9scheduler_TaskGroup), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x813f495 = (_dependencies, _duration, _name, _nbytes_in_memory, _nbytes_total, _prefix, _states, _types))" % __pyx_checksum) * __pyx_result = TaskGroup.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TaskGroup__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = TaskGroup.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_TaskGroup__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_TaskGroup__set_state(TaskGroup __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_3 = __pyx_f_11distributed_9scheduler___pyx_unpickle_TaskGroup__set_state(((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x813f495 = (_dependencies, _duration, _name, _nbytes_in_memory, _nbytes_total, _prefix, _states, _types))" % __pyx_checksum) * __pyx_result = TaskGroup.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TaskGroup__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_TaskGroup__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_TaskGroup__set_state(TaskGroup __pyx_result, tuple __pyx_state): * __pyx_result._dependencies = __pyx_state[0]; __pyx_result._duration = __pyx_state[1]; __pyx_result._name = __pyx_state[2]; __pyx_result._nbytes_in_memory = __pyx_state[3]; __pyx_result._nbytes_total = __pyx_state[4]; __pyx_result._prefix = __pyx_state[5]; __pyx_result._states = __pyx_state[6]; __pyx_result._types = __pyx_state[7] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_TaskGroup(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_TaskGroup__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TaskGroup__set_state(TaskGroup __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._dependencies = __pyx_state[0]; __pyx_result._duration = __pyx_state[1]; __pyx_result._name = __pyx_state[2]; __pyx_result._nbytes_in_memory = __pyx_state[3]; __pyx_result._nbytes_total = __pyx_state[4]; __pyx_result._prefix = __pyx_state[5]; __pyx_result._states = __pyx_state[6]; __pyx_result._types = __pyx_state[7] * if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_TaskGroup__set_state(struct __pyx_obj_11distributed_9scheduler_TaskGroup *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TaskGroup__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_TaskGroup__set_state(TaskGroup __pyx_result, tuple __pyx_state): * __pyx_result._dependencies = __pyx_state[0]; __pyx_result._duration = __pyx_state[1]; __pyx_result._name = __pyx_state[2]; __pyx_result._nbytes_in_memory = __pyx_state[3]; __pyx_result._nbytes_total = __pyx_state[4]; __pyx_result._prefix = __pyx_state[5]; __pyx_result._states = __pyx_state[6]; __pyx_result._types = __pyx_state[7] # <<<<<<<<<<<<<< * if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[8]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_dependencies); __Pyx_DECREF(__pyx_v___pyx_result->_dependencies); __pyx_v___pyx_result->_dependencies = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_duration = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_name); __Pyx_DECREF(__pyx_v___pyx_result->_name); __pyx_v___pyx_result->_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_nbytes_in_memory = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_nbytes_total = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskPrefix))))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_prefix); __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_prefix)); __pyx_v___pyx_result->_prefix = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_states); __Pyx_DECREF(__pyx_v___pyx_result->_states); __pyx_v___pyx_result->_states = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_types); __Pyx_DECREF(__pyx_v___pyx_result->_types); __pyx_v___pyx_result->_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TaskGroup__set_state(TaskGroup __pyx_result, tuple __pyx_state): * __pyx_result._dependencies = __pyx_state[0]; __pyx_result._duration = __pyx_state[1]; __pyx_result._name = __pyx_state[2]; __pyx_result._nbytes_in_memory = __pyx_state[3]; __pyx_result._nbytes_total = __pyx_state[4]; __pyx_result._prefix = __pyx_state[5]; __pyx_result._states = __pyx_state[6]; __pyx_result._types = __pyx_state[7] * if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[8]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_3 > 8) != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); __pyx_t_4 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "(tree fragment)":14 * __pyx_result._dependencies = __pyx_state[0]; __pyx_result._duration = __pyx_state[1]; __pyx_result._name = __pyx_state[2]; __pyx_result._nbytes_in_memory = __pyx_state[3]; __pyx_result._nbytes_total = __pyx_state[4]; __pyx_result._prefix = __pyx_state[5]; __pyx_result._states = __pyx_state[6]; __pyx_result._types = __pyx_state[7] * if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[8]) # <<<<<<<<<<<<<< */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TaskGroup__set_state(TaskGroup __pyx_result, tuple __pyx_state): * __pyx_result._dependencies = __pyx_state[0]; __pyx_result._duration = __pyx_state[1]; __pyx_result._name = __pyx_state[2]; __pyx_result._nbytes_in_memory = __pyx_state[3]; __pyx_result._nbytes_total = __pyx_state[4]; __pyx_result._prefix = __pyx_state[5]; __pyx_result._states = __pyx_state[6]; __pyx_result._types = __pyx_state[7] * if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[8]) */ } /* "(tree fragment)":11 * __pyx_unpickle_TaskGroup__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TaskGroup__set_state(TaskGroup __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._dependencies = __pyx_state[0]; __pyx_result._duration = __pyx_state[1]; __pyx_result._name = __pyx_state[2]; __pyx_result._nbytes_in_memory = __pyx_state[3]; __pyx_result._nbytes_total = __pyx_state[4]; __pyx_result._prefix = __pyx_state[5]; __pyx_result._states = __pyx_state[6]; __pyx_result._types = __pyx_state[7] * if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskGroup__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_TaskState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_45__pyx_unpickle_TaskState(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_45__pyx_unpickle_TaskState = {"__pyx_unpickle_TaskState", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_45__pyx_unpickle_TaskState, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_45__pyx_unpickle_TaskState(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_TaskState (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskState", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskState", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_TaskState") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaskState", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_44__pyx_unpickle_TaskState(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_44__pyx_unpickle_TaskState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TaskState", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x3d65355: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3d65355 = (_actor, _annotations, _dependencies, _dependents, _exception, _exception_blame, _group, _group_key, _has_lost_dependencies, _hash, _host_restrictions, _key, _loose_restrictions, _metadata, _nbytes, _prefix, _priority, _processing_on, _resource_restrictions, _retries, _run_spec, _state, _suspicious, _traceback, _type, _waiters, _waiting_on, _who_has, _who_wants, _worker_restrictions))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x3d65355) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0x3d65355: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3d65355 = (_actor, _annotations, _dependencies, _dependents, _exception, _exception_blame, _group, _group_key, _has_lost_dependencies, _hash, _host_restrictions, _key, _loose_restrictions, _metadata, _nbytes, _prefix, _priority, _processing_on, _resource_restrictions, _retries, _run_spec, _state, _suspicious, _traceback, _type, _waiters, _waiting_on, _who_has, _who_wants, _worker_restrictions))" % __pyx_checksum) * __pyx_result = TaskState.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0x3d65355: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3d65355 = (_actor, _annotations, _dependencies, _dependents, _exception, _exception_blame, _group, _group_key, _has_lost_dependencies, _hash, _host_restrictions, _key, _loose_restrictions, _metadata, _nbytes, _prefix, _priority, _processing_on, _resource_restrictions, _retries, _run_spec, _state, _suspicious, _traceback, _type, _waiters, _waiting_on, _who_has, _who_wants, _worker_restrictions))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = TaskState.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x3d, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x3d65355: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3d65355 = (_actor, _annotations, _dependencies, _dependents, _exception, _exception_blame, _group, _group_key, _has_lost_dependencies, _hash, _host_restrictions, _key, _loose_restrictions, _metadata, _nbytes, _prefix, _priority, _processing_on, _resource_restrictions, _retries, _run_spec, _state, _suspicious, _traceback, _type, _waiters, _waiting_on, _who_has, _who_wants, _worker_restrictions))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3d65355 = (_actor, _annotations, _dependencies, _dependents, _exception, _exception_blame, _group, _group_key, _has_lost_dependencies, _hash, _host_restrictions, _key, _loose_restrictions, _metadata, _nbytes, _prefix, _priority, _processing_on, _resource_restrictions, _retries, _run_spec, _state, _suspicious, _traceback, _type, _waiters, _waiting_on, _who_has, _who_wants, _worker_restrictions))" % __pyx_checksum) * __pyx_result = TaskState.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_TaskState__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11distributed_9scheduler_TaskState), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3d65355 = (_actor, _annotations, _dependencies, _dependents, _exception, _exception_blame, _group, _group_key, _has_lost_dependencies, _hash, _host_restrictions, _key, _loose_restrictions, _metadata, _nbytes, _prefix, _priority, _processing_on, _resource_restrictions, _retries, _run_spec, _state, _suspicious, _traceback, _type, _waiters, _waiting_on, _who_has, _who_wants, _worker_restrictions))" % __pyx_checksum) * __pyx_result = TaskState.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TaskState__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = TaskState.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_TaskState__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_TaskState__set_state(TaskState __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_3 = __pyx_f_11distributed_9scheduler___pyx_unpickle_TaskState__set_state(((struct __pyx_obj_11distributed_9scheduler_TaskState *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x3d65355 = (_actor, _annotations, _dependencies, _dependents, _exception, _exception_blame, _group, _group_key, _has_lost_dependencies, _hash, _host_restrictions, _key, _loose_restrictions, _metadata, _nbytes, _prefix, _priority, _processing_on, _resource_restrictions, _retries, _run_spec, _state, _suspicious, _traceback, _type, _waiters, _waiting_on, _who_has, _who_wants, _worker_restrictions))" % __pyx_checksum) * __pyx_result = TaskState.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TaskState__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_TaskState__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_TaskState__set_state(TaskState __pyx_result, tuple __pyx_state): * __pyx_result._actor = __pyx_state[0]; __pyx_result._annotations = __pyx_state[1]; __pyx_result._dependencies = __pyx_state[2]; __pyx_result._dependents = __pyx_state[3]; __pyx_result._exception = __pyx_state[4]; __pyx_result._exception_blame = __pyx_state[5]; __pyx_result._group = __pyx_state[6]; __pyx_result._group_key = __pyx_state[7]; __pyx_result._has_lost_dependencies = __pyx_state[8]; __pyx_result._hash = __pyx_state[9]; __pyx_result._host_restrictions = __pyx_state[10]; __pyx_result._key = __pyx_state[11]; __pyx_result._loose_restrictions = __pyx_state[12]; __pyx_result._metadata = __pyx_state[13]; __pyx_result._nbytes = __pyx_state[14]; __pyx_result._prefix = __pyx_state[15]; __pyx_result._priority = __pyx_state[16]; __pyx_result._processing_on = __pyx_state[17]; __pyx_result._resource_restrictions = __pyx_state[18]; __pyx_result._retries = __pyx_state[19]; __pyx_result._run_spec = __pyx_state[20]; __pyx_result._state = __pyx_state[21]; __pyx_result._suspicious = __pyx_state[22]; __pyx_result._traceback = __pyx_state[23]; __pyx_result._type = __pyx_state[24]; __pyx_result._waiters = __pyx_state[25]; __pyx_result._waiting_on = __pyx_state[26]; __pyx_result._who_has = __pyx_state[27]; __pyx_result._who_wants = __pyx_state[28]; __pyx_result._worker_restrictions = __pyx_state[29] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_TaskState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_TaskState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TaskState__set_state(TaskState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._actor = __pyx_state[0]; __pyx_result._annotations = __pyx_state[1]; __pyx_result._dependencies = __pyx_state[2]; __pyx_result._dependents = __pyx_state[3]; __pyx_result._exception = __pyx_state[4]; __pyx_result._exception_blame = __pyx_state[5]; __pyx_result._group = __pyx_state[6]; __pyx_result._group_key = __pyx_state[7]; __pyx_result._has_lost_dependencies = __pyx_state[8]; __pyx_result._hash = __pyx_state[9]; __pyx_result._host_restrictions = __pyx_state[10]; __pyx_result._key = __pyx_state[11]; __pyx_result._loose_restrictions = __pyx_state[12]; __pyx_result._metadata = __pyx_state[13]; __pyx_result._nbytes = __pyx_state[14]; __pyx_result._prefix = __pyx_state[15]; __pyx_result._priority = __pyx_state[16]; __pyx_result._processing_on = __pyx_state[17]; __pyx_result._resource_restrictions = __pyx_state[18]; __pyx_result._retries = __pyx_state[19]; __pyx_result._run_spec = __pyx_state[20]; __pyx_result._state = __pyx_state[21]; __pyx_result._suspicious = __pyx_state[22]; __pyx_result._traceback = __pyx_state[23]; __pyx_result._type = __pyx_state[24]; __pyx_result._waiters = __pyx_state[25]; __pyx_result._waiting_on = __pyx_state[26]; __pyx_result._who_has = __pyx_state[27]; __pyx_result._who_wants = __pyx_state[28]; __pyx_result._worker_restrictions = __pyx_state[29] * if len(__pyx_state) > 30 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_TaskState__set_state(struct __pyx_obj_11distributed_9scheduler_TaskState *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_hash_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TaskState__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_TaskState__set_state(TaskState __pyx_result, tuple __pyx_state): * __pyx_result._actor = __pyx_state[0]; __pyx_result._annotations = __pyx_state[1]; __pyx_result._dependencies = __pyx_state[2]; __pyx_result._dependents = __pyx_state[3]; __pyx_result._exception = __pyx_state[4]; __pyx_result._exception_blame = __pyx_state[5]; __pyx_result._group = __pyx_state[6]; __pyx_result._group_key = __pyx_state[7]; __pyx_result._has_lost_dependencies = __pyx_state[8]; __pyx_result._hash = __pyx_state[9]; __pyx_result._host_restrictions = __pyx_state[10]; __pyx_result._key = __pyx_state[11]; __pyx_result._loose_restrictions = __pyx_state[12]; __pyx_result._metadata = __pyx_state[13]; __pyx_result._nbytes = __pyx_state[14]; __pyx_result._prefix = __pyx_state[15]; __pyx_result._priority = __pyx_state[16]; __pyx_result._processing_on = __pyx_state[17]; __pyx_result._resource_restrictions = __pyx_state[18]; __pyx_result._retries = __pyx_state[19]; __pyx_result._run_spec = __pyx_state[20]; __pyx_result._state = __pyx_state[21]; __pyx_result._suspicious = __pyx_state[22]; __pyx_result._traceback = __pyx_state[23]; __pyx_result._type = __pyx_state[24]; __pyx_result._waiters = __pyx_state[25]; __pyx_result._waiting_on = __pyx_state[26]; __pyx_result._who_has = __pyx_state[27]; __pyx_result._who_wants = __pyx_state[28]; __pyx_result._worker_restrictions = __pyx_state[29] # <<<<<<<<<<<<<< * if len(__pyx_state) > 30 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[30]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_actor = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_annotations); __Pyx_DECREF(__pyx_v___pyx_result->_annotations); __pyx_v___pyx_result->_annotations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_dependencies); __Pyx_DECREF(__pyx_v___pyx_result->_dependencies); __pyx_v___pyx_result->_dependencies = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_dependents); __Pyx_DECREF(__pyx_v___pyx_result->_dependents); __pyx_v___pyx_result->_dependents = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_exception); __Pyx_DECREF(__pyx_v___pyx_result->_exception); __pyx_v___pyx_result->_exception = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_exception_blame); __Pyx_DECREF(__pyx_v___pyx_result->_exception_blame); __pyx_v___pyx_result->_exception_blame = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskGroup))))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_group); __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_group)); __pyx_v___pyx_result->_group = ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_group_key); __Pyx_DECREF(__pyx_v___pyx_result->_group_key); __pyx_v___pyx_result->_group_key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_has_lost_dependencies = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_AsHash_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_hash_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_hash = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_host_restrictions); __Pyx_DECREF(__pyx_v___pyx_result->_host_restrictions); __pyx_v___pyx_result->_host_restrictions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_key); __Pyx_DECREF(__pyx_v___pyx_result->_key); __pyx_v___pyx_result->_key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_loose_restrictions = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_metadata); __Pyx_DECREF(__pyx_v___pyx_result->_metadata); __pyx_v___pyx_result->_metadata = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_nbytes = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_TaskPrefix))))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_prefix); __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_prefix)); __pyx_v___pyx_result->_prefix = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_priority); __Pyx_DECREF(__pyx_v___pyx_result->_priority); __pyx_v___pyx_result->_priority = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_11distributed_9scheduler_WorkerState))))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_processing_on); __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_processing_on)); __pyx_v___pyx_result->_processing_on = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_resource_restrictions); __Pyx_DECREF(__pyx_v___pyx_result->_resource_restrictions); __pyx_v___pyx_result->_resource_restrictions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_retries = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_run_spec); __Pyx_DECREF(__pyx_v___pyx_result->_run_spec); __pyx_v___pyx_result->_run_spec = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_state); __Pyx_DECREF(__pyx_v___pyx_result->_state); __pyx_v___pyx_result->_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_suspicious = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_traceback); __Pyx_DECREF(__pyx_v___pyx_result->_traceback); __pyx_v___pyx_result->_traceback = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_type); __Pyx_DECREF(__pyx_v___pyx_result->_type); __pyx_v___pyx_result->_type = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_waiters); __Pyx_DECREF(__pyx_v___pyx_result->_waiters); __pyx_v___pyx_result->_waiters = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_waiting_on); __Pyx_DECREF(__pyx_v___pyx_result->_waiting_on); __pyx_v___pyx_result->_waiting_on = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_who_has); __Pyx_DECREF(__pyx_v___pyx_result->_who_has); __pyx_v___pyx_result->_who_has = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_who_wants); __Pyx_DECREF(__pyx_v___pyx_result->_who_wants); __pyx_v___pyx_result->_who_wants = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_worker_restrictions); __Pyx_DECREF(__pyx_v___pyx_result->_worker_restrictions); __pyx_v___pyx_result->_worker_restrictions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TaskState__set_state(TaskState __pyx_result, tuple __pyx_state): * __pyx_result._actor = __pyx_state[0]; __pyx_result._annotations = __pyx_state[1]; __pyx_result._dependencies = __pyx_state[2]; __pyx_result._dependents = __pyx_state[3]; __pyx_result._exception = __pyx_state[4]; __pyx_result._exception_blame = __pyx_state[5]; __pyx_result._group = __pyx_state[6]; __pyx_result._group_key = __pyx_state[7]; __pyx_result._has_lost_dependencies = __pyx_state[8]; __pyx_result._hash = __pyx_state[9]; __pyx_result._host_restrictions = __pyx_state[10]; __pyx_result._key = __pyx_state[11]; __pyx_result._loose_restrictions = __pyx_state[12]; __pyx_result._metadata = __pyx_state[13]; __pyx_result._nbytes = __pyx_state[14]; __pyx_result._prefix = __pyx_state[15]; __pyx_result._priority = __pyx_state[16]; __pyx_result._processing_on = __pyx_state[17]; __pyx_result._resource_restrictions = __pyx_state[18]; __pyx_result._retries = __pyx_state[19]; __pyx_result._run_spec = __pyx_state[20]; __pyx_result._state = __pyx_state[21]; __pyx_result._suspicious = __pyx_state[22]; __pyx_result._traceback = __pyx_state[23]; __pyx_result._type = __pyx_state[24]; __pyx_result._waiters = __pyx_state[25]; __pyx_result._waiting_on = __pyx_state[26]; __pyx_result._who_has = __pyx_state[27]; __pyx_result._who_wants = __pyx_state[28]; __pyx_result._worker_restrictions = __pyx_state[29] * if len(__pyx_state) > 30 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[30]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_4 > 30) != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); __pyx_t_2 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result._actor = __pyx_state[0]; __pyx_result._annotations = __pyx_state[1]; __pyx_result._dependencies = __pyx_state[2]; __pyx_result._dependents = __pyx_state[3]; __pyx_result._exception = __pyx_state[4]; __pyx_result._exception_blame = __pyx_state[5]; __pyx_result._group = __pyx_state[6]; __pyx_result._group_key = __pyx_state[7]; __pyx_result._has_lost_dependencies = __pyx_state[8]; __pyx_result._hash = __pyx_state[9]; __pyx_result._host_restrictions = __pyx_state[10]; __pyx_result._key = __pyx_state[11]; __pyx_result._loose_restrictions = __pyx_state[12]; __pyx_result._metadata = __pyx_state[13]; __pyx_result._nbytes = __pyx_state[14]; __pyx_result._prefix = __pyx_state[15]; __pyx_result._priority = __pyx_state[16]; __pyx_result._processing_on = __pyx_state[17]; __pyx_result._resource_restrictions = __pyx_state[18]; __pyx_result._retries = __pyx_state[19]; __pyx_result._run_spec = __pyx_state[20]; __pyx_result._state = __pyx_state[21]; __pyx_result._suspicious = __pyx_state[22]; __pyx_result._traceback = __pyx_state[23]; __pyx_result._type = __pyx_state[24]; __pyx_result._waiters = __pyx_state[25]; __pyx_result._waiting_on = __pyx_state[26]; __pyx_result._who_has = __pyx_state[27]; __pyx_result._who_wants = __pyx_state[28]; __pyx_result._worker_restrictions = __pyx_state[29] * if len(__pyx_state) > 30 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[30]) # <<<<<<<<<<<<<< */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TaskState__set_state(TaskState __pyx_result, tuple __pyx_state): * __pyx_result._actor = __pyx_state[0]; __pyx_result._annotations = __pyx_state[1]; __pyx_result._dependencies = __pyx_state[2]; __pyx_result._dependents = __pyx_state[3]; __pyx_result._exception = __pyx_state[4]; __pyx_result._exception_blame = __pyx_state[5]; __pyx_result._group = __pyx_state[6]; __pyx_result._group_key = __pyx_state[7]; __pyx_result._has_lost_dependencies = __pyx_state[8]; __pyx_result._hash = __pyx_state[9]; __pyx_result._host_restrictions = __pyx_state[10]; __pyx_result._key = __pyx_state[11]; __pyx_result._loose_restrictions = __pyx_state[12]; __pyx_result._metadata = __pyx_state[13]; __pyx_result._nbytes = __pyx_state[14]; __pyx_result._prefix = __pyx_state[15]; __pyx_result._priority = __pyx_state[16]; __pyx_result._processing_on = __pyx_state[17]; __pyx_result._resource_restrictions = __pyx_state[18]; __pyx_result._retries = __pyx_state[19]; __pyx_result._run_spec = __pyx_state[20]; __pyx_result._state = __pyx_state[21]; __pyx_result._suspicious = __pyx_state[22]; __pyx_result._traceback = __pyx_state[23]; __pyx_result._type = __pyx_state[24]; __pyx_result._waiters = __pyx_state[25]; __pyx_result._waiting_on = __pyx_state[26]; __pyx_result._who_has = __pyx_state[27]; __pyx_result._who_wants = __pyx_state[28]; __pyx_result._worker_restrictions = __pyx_state[29] * if len(__pyx_state) > 30 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[30]) */ } /* "(tree fragment)":11 * __pyx_unpickle_TaskState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TaskState__set_state(TaskState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._actor = __pyx_state[0]; __pyx_result._annotations = __pyx_state[1]; __pyx_result._dependencies = __pyx_state[2]; __pyx_result._dependents = __pyx_state[3]; __pyx_result._exception = __pyx_state[4]; __pyx_result._exception_blame = __pyx_state[5]; __pyx_result._group = __pyx_state[6]; __pyx_result._group_key = __pyx_state[7]; __pyx_result._has_lost_dependencies = __pyx_state[8]; __pyx_result._hash = __pyx_state[9]; __pyx_result._host_restrictions = __pyx_state[10]; __pyx_result._key = __pyx_state[11]; __pyx_result._loose_restrictions = __pyx_state[12]; __pyx_result._metadata = __pyx_state[13]; __pyx_result._nbytes = __pyx_state[14]; __pyx_result._prefix = __pyx_state[15]; __pyx_result._priority = __pyx_state[16]; __pyx_result._processing_on = __pyx_state[17]; __pyx_result._resource_restrictions = __pyx_state[18]; __pyx_result._retries = __pyx_state[19]; __pyx_result._run_spec = __pyx_state[20]; __pyx_result._state = __pyx_state[21]; __pyx_result._suspicious = __pyx_state[22]; __pyx_result._traceback = __pyx_state[23]; __pyx_result._type = __pyx_state[24]; __pyx_result._waiters = __pyx_state[25]; __pyx_result._waiting_on = __pyx_state[26]; __pyx_result._who_has = __pyx_state[27]; __pyx_result._who_wants = __pyx_state[28]; __pyx_result._worker_restrictions = __pyx_state[29] * if len(__pyx_state) > 30 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_TaskState__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_SchedulerState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11distributed_9scheduler_47__pyx_unpickle_SchedulerState(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11distributed_9scheduler_47__pyx_unpickle_SchedulerState = {"__pyx_unpickle_SchedulerState", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_47__pyx_unpickle_SchedulerState, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11distributed_9scheduler_47__pyx_unpickle_SchedulerState(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_SchedulerState (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SchedulerState", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SchedulerState", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SchedulerState") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SchedulerState", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_SchedulerState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11distributed_9scheduler_46__pyx_unpickle_SchedulerState(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11distributed_9scheduler_46__pyx_unpickle_SchedulerState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_SchedulerState", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0xebac261: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xebac261 = (_aliases, _bandwidth, _clients, _extensions, _host_info, _idle, _idle_dv, _n_tasks, _resources, _saturated, _task_groups, _task_metadata, _task_prefixes, _tasks, _total_nthreads, _total_occupancy, _unknown_durations, _unrunnable, _validate, _workers, _workers_dv))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xebac261) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0xebac261: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0xebac261 = (_aliases, _bandwidth, _clients, _extensions, _host_info, _idle, _idle_dv, _n_tasks, _resources, _saturated, _task_groups, _task_metadata, _task_prefixes, _tasks, _total_nthreads, _total_occupancy, _unknown_durations, _unrunnable, _validate, _workers, _workers_dv))" % __pyx_checksum) * __pyx_result = SchedulerState.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0xebac261: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xebac261 = (_aliases, _bandwidth, _clients, _extensions, _host_info, _idle, _idle_dv, _n_tasks, _resources, _saturated, _task_groups, _task_metadata, _task_prefixes, _tasks, _total_nthreads, _total_occupancy, _unknown_durations, _unrunnable, _validate, _workers, _workers_dv))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = SchedulerState.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xeb, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0xebac261: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xebac261 = (_aliases, _bandwidth, _clients, _extensions, _host_info, _idle, _idle_dv, _n_tasks, _resources, _saturated, _task_groups, _task_metadata, _task_prefixes, _tasks, _total_nthreads, _total_occupancy, _unknown_durations, _unrunnable, _validate, _workers, _workers_dv))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xebac261 = (_aliases, _bandwidth, _clients, _extensions, _host_info, _idle, _idle_dv, _n_tasks, _resources, _saturated, _task_groups, _task_metadata, _task_prefixes, _tasks, _total_nthreads, _total_occupancy, _unknown_durations, _unrunnable, _validate, _workers, _workers_dv))" % __pyx_checksum) * __pyx_result = SchedulerState.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_SchedulerState__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11distributed_9scheduler_SchedulerState), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xebac261 = (_aliases, _bandwidth, _clients, _extensions, _host_info, _idle, _idle_dv, _n_tasks, _resources, _saturated, _task_groups, _task_metadata, _task_prefixes, _tasks, _total_nthreads, _total_occupancy, _unknown_durations, _unrunnable, _validate, _workers, _workers_dv))" % __pyx_checksum) * __pyx_result = SchedulerState.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_SchedulerState__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = SchedulerState.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_SchedulerState__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_SchedulerState__set_state(SchedulerState __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_3 = __pyx_f_11distributed_9scheduler___pyx_unpickle_SchedulerState__set_state(((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xebac261 = (_aliases, _bandwidth, _clients, _extensions, _host_info, _idle, _idle_dv, _n_tasks, _resources, _saturated, _task_groups, _task_metadata, _task_prefixes, _tasks, _total_nthreads, _total_occupancy, _unknown_durations, _unrunnable, _validate, _workers, _workers_dv))" % __pyx_checksum) * __pyx_result = SchedulerState.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_SchedulerState__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_SchedulerState__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_SchedulerState__set_state(SchedulerState __pyx_result, tuple __pyx_state): * __pyx_result._aliases = __pyx_state[0]; __pyx_result._bandwidth = __pyx_state[1]; __pyx_result._clients = __pyx_state[2]; __pyx_result._extensions = __pyx_state[3]; __pyx_result._host_info = __pyx_state[4]; __pyx_result._idle = __pyx_state[5]; __pyx_result._idle_dv = __pyx_state[6]; __pyx_result._n_tasks = __pyx_state[7]; __pyx_result._resources = __pyx_state[8]; __pyx_result._saturated = __pyx_state[9]; __pyx_result._task_groups = __pyx_state[10]; __pyx_result._task_metadata = __pyx_state[11]; __pyx_result._task_prefixes = __pyx_state[12]; __pyx_result._tasks = __pyx_state[13]; __pyx_result._total_nthreads = __pyx_state[14]; __pyx_result._total_occupancy = __pyx_state[15]; __pyx_result._unknown_durations = __pyx_state[16]; __pyx_result._unrunnable = __pyx_state[17]; __pyx_result._validate = __pyx_state[18]; __pyx_result._workers = __pyx_state[19]; __pyx_result._workers_dv = __pyx_state[20] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_SchedulerState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_SchedulerState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_SchedulerState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_SchedulerState__set_state(SchedulerState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._aliases = __pyx_state[0]; __pyx_result._bandwidth = __pyx_state[1]; __pyx_result._clients = __pyx_state[2]; __pyx_result._extensions = __pyx_state[3]; __pyx_result._host_info = __pyx_state[4]; __pyx_result._idle = __pyx_state[5]; __pyx_result._idle_dv = __pyx_state[6]; __pyx_result._n_tasks = __pyx_state[7]; __pyx_result._resources = __pyx_state[8]; __pyx_result._saturated = __pyx_state[9]; __pyx_result._task_groups = __pyx_state[10]; __pyx_result._task_metadata = __pyx_state[11]; __pyx_result._task_prefixes = __pyx_state[12]; __pyx_result._tasks = __pyx_state[13]; __pyx_result._total_nthreads = __pyx_state[14]; __pyx_result._total_occupancy = __pyx_state[15]; __pyx_result._unknown_durations = __pyx_state[16]; __pyx_result._unrunnable = __pyx_state[17]; __pyx_result._validate = __pyx_state[18]; __pyx_result._workers = __pyx_state[19]; __pyx_result._workers_dv = __pyx_state[20] * if len(__pyx_state) > 21 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11distributed_9scheduler___pyx_unpickle_SchedulerState__set_state(struct __pyx_obj_11distributed_9scheduler_SchedulerState *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_SchedulerState__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_SchedulerState__set_state(SchedulerState __pyx_result, tuple __pyx_state): * __pyx_result._aliases = __pyx_state[0]; __pyx_result._bandwidth = __pyx_state[1]; __pyx_result._clients = __pyx_state[2]; __pyx_result._extensions = __pyx_state[3]; __pyx_result._host_info = __pyx_state[4]; __pyx_result._idle = __pyx_state[5]; __pyx_result._idle_dv = __pyx_state[6]; __pyx_result._n_tasks = __pyx_state[7]; __pyx_result._resources = __pyx_state[8]; __pyx_result._saturated = __pyx_state[9]; __pyx_result._task_groups = __pyx_state[10]; __pyx_result._task_metadata = __pyx_state[11]; __pyx_result._task_prefixes = __pyx_state[12]; __pyx_result._tasks = __pyx_state[13]; __pyx_result._total_nthreads = __pyx_state[14]; __pyx_result._total_occupancy = __pyx_state[15]; __pyx_result._unknown_durations = __pyx_state[16]; __pyx_result._unrunnable = __pyx_state[17]; __pyx_result._validate = __pyx_state[18]; __pyx_result._workers = __pyx_state[19]; __pyx_result._workers_dv = __pyx_state[20] # <<<<<<<<<<<<<< * if len(__pyx_state) > 21 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[21]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_aliases); __Pyx_DECREF(__pyx_v___pyx_result->_aliases); __pyx_v___pyx_result->_aliases = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_bandwidth = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_clients); __Pyx_DECREF(__pyx_v___pyx_result->_clients); __pyx_v___pyx_result->_clients = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_extensions); __Pyx_DECREF(__pyx_v___pyx_result->_extensions); __pyx_v___pyx_result->_extensions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_host_info); __Pyx_DECREF(__pyx_v___pyx_result->_host_info); __pyx_v___pyx_result->_host_info = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_idle); __Pyx_DECREF(__pyx_v___pyx_result->_idle); __pyx_v___pyx_result->_idle = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_idle_dv); __Pyx_DECREF(__pyx_v___pyx_result->_idle_dv); __pyx_v___pyx_result->_idle_dv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_n_tasks = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_resources); __Pyx_DECREF(__pyx_v___pyx_result->_resources); __pyx_v___pyx_result->_resources = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_saturated); __Pyx_DECREF(__pyx_v___pyx_result->_saturated); __pyx_v___pyx_result->_saturated = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_task_groups); __Pyx_DECREF(__pyx_v___pyx_result->_task_groups); __pyx_v___pyx_result->_task_groups = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_task_metadata); __Pyx_DECREF(__pyx_v___pyx_result->_task_metadata); __pyx_v___pyx_result->_task_metadata = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_task_prefixes); __Pyx_DECREF(__pyx_v___pyx_result->_task_prefixes); __pyx_v___pyx_result->_task_prefixes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_tasks); __Pyx_DECREF(__pyx_v___pyx_result->_tasks); __pyx_v___pyx_result->_tasks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_total_nthreads = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_total_occupancy = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_unknown_durations); __Pyx_DECREF(__pyx_v___pyx_result->_unknown_durations); __pyx_v___pyx_result->_unknown_durations = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_unrunnable); __Pyx_DECREF(__pyx_v___pyx_result->_unrunnable); __pyx_v___pyx_result->_unrunnable = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_validate = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_workers); __Pyx_DECREF(__pyx_v___pyx_result->_workers); __pyx_v___pyx_result->_workers = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_workers_dv); __Pyx_DECREF(__pyx_v___pyx_result->_workers_dv); __pyx_v___pyx_result->_workers_dv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_SchedulerState__set_state(SchedulerState __pyx_result, tuple __pyx_state): * __pyx_result._aliases = __pyx_state[0]; __pyx_result._bandwidth = __pyx_state[1]; __pyx_result._clients = __pyx_state[2]; __pyx_result._extensions = __pyx_state[3]; __pyx_result._host_info = __pyx_state[4]; __pyx_result._idle = __pyx_state[5]; __pyx_result._idle_dv = __pyx_state[6]; __pyx_result._n_tasks = __pyx_state[7]; __pyx_result._resources = __pyx_state[8]; __pyx_result._saturated = __pyx_state[9]; __pyx_result._task_groups = __pyx_state[10]; __pyx_result._task_metadata = __pyx_state[11]; __pyx_result._task_prefixes = __pyx_state[12]; __pyx_result._tasks = __pyx_state[13]; __pyx_result._total_nthreads = __pyx_state[14]; __pyx_result._total_occupancy = __pyx_state[15]; __pyx_result._unknown_durations = __pyx_state[16]; __pyx_result._unrunnable = __pyx_state[17]; __pyx_result._validate = __pyx_state[18]; __pyx_result._workers = __pyx_state[19]; __pyx_result._workers_dv = __pyx_state[20] * if len(__pyx_state) > 21 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[21]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_3 > 21) != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); __pyx_t_4 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "(tree fragment)":14 * __pyx_result._aliases = __pyx_state[0]; __pyx_result._bandwidth = __pyx_state[1]; __pyx_result._clients = __pyx_state[2]; __pyx_result._extensions = __pyx_state[3]; __pyx_result._host_info = __pyx_state[4]; __pyx_result._idle = __pyx_state[5]; __pyx_result._idle_dv = __pyx_state[6]; __pyx_result._n_tasks = __pyx_state[7]; __pyx_result._resources = __pyx_state[8]; __pyx_result._saturated = __pyx_state[9]; __pyx_result._task_groups = __pyx_state[10]; __pyx_result._task_metadata = __pyx_state[11]; __pyx_result._task_prefixes = __pyx_state[12]; __pyx_result._tasks = __pyx_state[13]; __pyx_result._total_nthreads = __pyx_state[14]; __pyx_result._total_occupancy = __pyx_state[15]; __pyx_result._unknown_durations = __pyx_state[16]; __pyx_result._unrunnable = __pyx_state[17]; __pyx_result._validate = __pyx_state[18]; __pyx_result._workers = __pyx_state[19]; __pyx_result._workers_dv = __pyx_state[20] * if len(__pyx_state) > 21 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[21]) # <<<<<<<<<<<<<< */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_SchedulerState__set_state(SchedulerState __pyx_result, tuple __pyx_state): * __pyx_result._aliases = __pyx_state[0]; __pyx_result._bandwidth = __pyx_state[1]; __pyx_result._clients = __pyx_state[2]; __pyx_result._extensions = __pyx_state[3]; __pyx_result._host_info = __pyx_state[4]; __pyx_result._idle = __pyx_state[5]; __pyx_result._idle_dv = __pyx_state[6]; __pyx_result._n_tasks = __pyx_state[7]; __pyx_result._resources = __pyx_state[8]; __pyx_result._saturated = __pyx_state[9]; __pyx_result._task_groups = __pyx_state[10]; __pyx_result._task_metadata = __pyx_state[11]; __pyx_result._task_prefixes = __pyx_state[12]; __pyx_result._tasks = __pyx_state[13]; __pyx_result._total_nthreads = __pyx_state[14]; __pyx_result._total_occupancy = __pyx_state[15]; __pyx_result._unknown_durations = __pyx_state[16]; __pyx_result._unrunnable = __pyx_state[17]; __pyx_result._validate = __pyx_state[18]; __pyx_result._workers = __pyx_state[19]; __pyx_result._workers_dv = __pyx_state[20] * if len(__pyx_state) > 21 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[21]) */ } /* "(tree fragment)":11 * __pyx_unpickle_SchedulerState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_SchedulerState__set_state(SchedulerState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._aliases = __pyx_state[0]; __pyx_result._bandwidth = __pyx_state[1]; __pyx_result._clients = __pyx_state[2]; __pyx_result._extensions = __pyx_state[3]; __pyx_result._host_info = __pyx_state[4]; __pyx_result._idle = __pyx_state[5]; __pyx_result._idle_dv = __pyx_state[6]; __pyx_result._n_tasks = __pyx_state[7]; __pyx_result._resources = __pyx_state[8]; __pyx_result._saturated = __pyx_state[9]; __pyx_result._task_groups = __pyx_state[10]; __pyx_result._task_metadata = __pyx_state[11]; __pyx_result._task_prefixes = __pyx_state[12]; __pyx_result._tasks = __pyx_state[13]; __pyx_result._total_nthreads = __pyx_state[14]; __pyx_result._total_occupancy = __pyx_state[15]; __pyx_result._unknown_durations = __pyx_state[16]; __pyx_result._unrunnable = __pyx_state[17]; __pyx_result._validate = __pyx_state[18]; __pyx_result._workers = __pyx_state[19]; __pyx_result._workers_dv = __pyx_state[20] * if len(__pyx_state) > 21 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("distributed.scheduler.__pyx_unpickle_SchedulerState__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11distributed_9scheduler_ClientState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11distributed_9scheduler_ClientState *p; PyObject *o; o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11distributed_9scheduler_ClientState *)o); p->_client_key = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_wants_what = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_versions = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11distributed_9scheduler_ClientState(PyObject *o) { struct __pyx_obj_11distributed_9scheduler_ClientState *p = (struct __pyx_obj_11distributed_9scheduler_ClientState *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->_client_key); Py_CLEAR(p->_wants_what); Py_CLEAR(p->_versions); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11distributed_9scheduler_ClientState(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler_ClientState *p = (struct __pyx_obj_11distributed_9scheduler_ClientState *)o; if (p->_wants_what) { e = (*v)(p->_wants_what, a); if (e) return e; } if (p->_versions) { e = (*v)(p->_versions, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler_ClientState(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler_ClientState *p = (struct __pyx_obj_11distributed_9scheduler_ClientState *)o; tmp = ((PyObject*)p->_wants_what); p->_wants_what = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_versions); p->_versions = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_richcompare_11distributed_9scheduler_ClientState(PyObject *o1, PyObject *o2, int op) { switch (op) { case Py_EQ: { return __pyx_pw_11distributed_9scheduler_11ClientState_5__eq__(o1, o2); } case Py_NE: { PyObject *ret; ret = __pyx_pw_11distributed_9scheduler_11ClientState_5__eq__(o1, o2); if (likely(ret && ret != Py_NotImplemented)) { int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret); if (unlikely(b < 0)) return NULL; ret = (b) ? Py_False : Py_True; Py_INCREF(ret); } return ret; } default: { return __Pyx_NewRef(Py_NotImplemented); } } } static PyObject *__pyx_getprop_11distributed_9scheduler_11ClientState_client_key(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11ClientState_10client_key_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11ClientState_wants_what(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11ClientState_10wants_what_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11ClientState_last_seen(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11ClientState_9last_seen_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11ClientState_versions(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11ClientState_8versions_1__get__(o); } static PyMethodDef __pyx_methods_11distributed_9scheduler_ClientState[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_11ClientState_11__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_11ClientState_13__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11distributed_9scheduler_ClientState[] = { {(char *)"client_key", __pyx_getprop_11distributed_9scheduler_11ClientState_client_key, 0, (char *)0, 0}, {(char *)"wants_what", __pyx_getprop_11distributed_9scheduler_11ClientState_wants_what, 0, (char *)0, 0}, {(char *)"last_seen", __pyx_getprop_11distributed_9scheduler_11ClientState_last_seen, 0, (char *)0, 0}, {(char *)"versions", __pyx_getprop_11distributed_9scheduler_11ClientState_versions, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11distributed_9scheduler_ClientState = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.ClientState", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler_ClientState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler_ClientState, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11distributed_9scheduler_11ClientState_7__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ __pyx_pw_11distributed_9scheduler_11ClientState_3__hash__, /*tp_hash*/ 0, /*tp_call*/ __pyx_pw_11distributed_9scheduler_11ClientState_9__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "\n A simple object holding information about a client.\n\n .. attribute:: client_key: str\n\n A unique identifier for this client. This is generally an opaque\n string generated by the client itself.\n\n .. attribute:: wants_what: {TaskState}\n\n A set of tasks this client wants kept in memory, so that it can\n download its result when desired. This is the reverse mapping of\n :class:`TaskState.who_wants`.\n\n Tasks are typically removed from this set when the corresponding\n object in the client's space (for example a ``Future`` or a Dask\n collection) gets garbage-collected.\n\n ", /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler_ClientState, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler_ClientState, /*tp_clear*/ __pyx_tp_richcompare_11distributed_9scheduler_ClientState, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11distributed_9scheduler_ClientState, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11distributed_9scheduler_ClientState, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11distributed_9scheduler_11ClientState_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler_ClientState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11distributed_9scheduler_WorkerState __pyx_vtable_11distributed_9scheduler_WorkerState; static PyObject *__pyx_tp_new_11distributed_9scheduler_WorkerState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11distributed_9scheduler_WorkerState *p; PyObject *o; o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)o); p->__pyx_vtab = __pyx_vtabptr_11distributed_9scheduler_WorkerState; p->_actors = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_address = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_executing = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_extra = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_has_what = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_local_directory = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_metrics = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_name = Py_None; Py_INCREF(Py_None); p->_nanny = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_processing = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_resources = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_services = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_status = Py_None; Py_INCREF(Py_None); p->_used_resources = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_versions = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11distributed_9scheduler_WorkerState(PyObject *o) { struct __pyx_obj_11distributed_9scheduler_WorkerState *p = (struct __pyx_obj_11distributed_9scheduler_WorkerState *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->_actors); Py_CLEAR(p->_address); Py_CLEAR(p->_executing); Py_CLEAR(p->_extra); Py_CLEAR(p->_has_what); Py_CLEAR(p->_local_directory); Py_CLEAR(p->_metrics); Py_CLEAR(p->_name); Py_CLEAR(p->_nanny); Py_CLEAR(p->_processing); Py_CLEAR(p->_resources); Py_CLEAR(p->_services); Py_CLEAR(p->_status); Py_CLEAR(p->_used_resources); Py_CLEAR(p->_versions); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11distributed_9scheduler_WorkerState(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler_WorkerState *p = (struct __pyx_obj_11distributed_9scheduler_WorkerState *)o; if (p->_actors) { e = (*v)(p->_actors, a); if (e) return e; } if (p->_executing) { e = (*v)(p->_executing, a); if (e) return e; } if (p->_extra) { e = (*v)(p->_extra, a); if (e) return e; } if (p->_has_what) { e = (*v)(p->_has_what, a); if (e) return e; } if (p->_metrics) { e = (*v)(p->_metrics, a); if (e) return e; } if (p->_name) { e = (*v)(p->_name, a); if (e) return e; } if (p->_processing) { e = (*v)(p->_processing, a); if (e) return e; } if (p->_resources) { e = (*v)(p->_resources, a); if (e) return e; } if (p->_services) { e = (*v)(p->_services, a); if (e) return e; } if (p->_status) { e = (*v)(p->_status, a); if (e) return e; } if (p->_used_resources) { e = (*v)(p->_used_resources, a); if (e) return e; } if (p->_versions) { e = (*v)(p->_versions, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler_WorkerState(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler_WorkerState *p = (struct __pyx_obj_11distributed_9scheduler_WorkerState *)o; tmp = ((PyObject*)p->_actors); p->_actors = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_executing); p->_executing = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_extra); p->_extra = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_has_what); p->_has_what = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_metrics); p->_metrics = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_name); p->_name = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_processing); p->_processing = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_resources); p->_resources = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_services); p->_services = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_status); p->_status = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_used_resources); p->_used_resources = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_versions); p->_versions = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_richcompare_11distributed_9scheduler_WorkerState(PyObject *o1, PyObject *o2, int op) { switch (op) { case Py_EQ: { return __pyx_pw_11distributed_9scheduler_11WorkerState_5__eq__(o1, o2); } case Py_NE: { PyObject *ret; ret = __pyx_pw_11distributed_9scheduler_11WorkerState_5__eq__(o1, o2); if (likely(ret && ret != Py_NotImplemented)) { int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret); if (unlikely(b < 0)) return NULL; ret = (b) ? Py_False : Py_True; Py_INCREF(ret); } return ret; } default: { return __Pyx_NewRef(Py_NotImplemented); } } } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_actors(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_6actors_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_address(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_7address_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_bandwidth(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_9bandwidth_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_executing(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_9executing_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_extra(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_5extra_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_has_what(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_8has_what_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_host(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_4host_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_last_seen(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_9last_seen_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_local_directory(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_15local_directory_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_memory_limit(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_12memory_limit_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_metrics(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_7metrics_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_4name_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_nanny(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_5nanny_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_nbytes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_6nbytes_1__get__(o); } static int __pyx_setprop_11distributed_9scheduler_11WorkerState_nbytes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11distributed_9scheduler_11WorkerState_6nbytes_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_nthreads(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_8nthreads_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_occupancy(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_9occupancy_1__get__(o); } static int __pyx_setprop_11distributed_9scheduler_11WorkerState_occupancy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11distributed_9scheduler_11WorkerState_9occupancy_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_pid(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_3pid_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_processing(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_10processing_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_resources(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_9resources_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_services(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_8services_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_status(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_6status_1__get__(o); } static int __pyx_setprop_11distributed_9scheduler_11WorkerState_status(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11distributed_9scheduler_11WorkerState_6status_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_time_delay(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_10time_delay_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_used_resources(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_14used_resources_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_versions(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_8versions_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_11WorkerState_ncores(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_11WorkerState_6ncores_1__get__(o); } static PyMethodDef __pyx_methods_11distributed_9scheduler_WorkerState[] = { {"clean", (PyCFunction)__pyx_pw_11distributed_9scheduler_11WorkerState_7clean, METH_NOARGS, __pyx_doc_11distributed_9scheduler_11WorkerState_6clean}, {"identity", (PyCFunction)__pyx_pw_11distributed_9scheduler_11WorkerState_11identity, METH_NOARGS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_11WorkerState_13__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_11WorkerState_15__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11distributed_9scheduler_WorkerState[] = { {(char *)"actors", __pyx_getprop_11distributed_9scheduler_11WorkerState_actors, 0, (char *)0, 0}, {(char *)"address", __pyx_getprop_11distributed_9scheduler_11WorkerState_address, 0, (char *)0, 0}, {(char *)"bandwidth", __pyx_getprop_11distributed_9scheduler_11WorkerState_bandwidth, 0, (char *)0, 0}, {(char *)"executing", __pyx_getprop_11distributed_9scheduler_11WorkerState_executing, 0, (char *)0, 0}, {(char *)"extra", __pyx_getprop_11distributed_9scheduler_11WorkerState_extra, 0, (char *)0, 0}, {(char *)"has_what", __pyx_getprop_11distributed_9scheduler_11WorkerState_has_what, 0, (char *)0, 0}, {(char *)"host", __pyx_getprop_11distributed_9scheduler_11WorkerState_host, 0, (char *)0, 0}, {(char *)"last_seen", __pyx_getprop_11distributed_9scheduler_11WorkerState_last_seen, 0, (char *)0, 0}, {(char *)"local_directory", __pyx_getprop_11distributed_9scheduler_11WorkerState_local_directory, 0, (char *)0, 0}, {(char *)"memory_limit", __pyx_getprop_11distributed_9scheduler_11WorkerState_memory_limit, 0, (char *)0, 0}, {(char *)"metrics", __pyx_getprop_11distributed_9scheduler_11WorkerState_metrics, 0, (char *)0, 0}, {(char *)"name", __pyx_getprop_11distributed_9scheduler_11WorkerState_name, 0, (char *)0, 0}, {(char *)"nanny", __pyx_getprop_11distributed_9scheduler_11WorkerState_nanny, 0, (char *)0, 0}, {(char *)"nbytes", __pyx_getprop_11distributed_9scheduler_11WorkerState_nbytes, __pyx_setprop_11distributed_9scheduler_11WorkerState_nbytes, (char *)0, 0}, {(char *)"nthreads", __pyx_getprop_11distributed_9scheduler_11WorkerState_nthreads, 0, (char *)0, 0}, {(char *)"occupancy", __pyx_getprop_11distributed_9scheduler_11WorkerState_occupancy, __pyx_setprop_11distributed_9scheduler_11WorkerState_occupancy, (char *)0, 0}, {(char *)"pid", __pyx_getprop_11distributed_9scheduler_11WorkerState_pid, 0, (char *)0, 0}, {(char *)"processing", __pyx_getprop_11distributed_9scheduler_11WorkerState_processing, 0, (char *)0, 0}, {(char *)"resources", __pyx_getprop_11distributed_9scheduler_11WorkerState_resources, 0, (char *)0, 0}, {(char *)"services", __pyx_getprop_11distributed_9scheduler_11WorkerState_services, 0, (char *)0, 0}, {(char *)"status", __pyx_getprop_11distributed_9scheduler_11WorkerState_status, __pyx_setprop_11distributed_9scheduler_11WorkerState_status, (char *)0, 0}, {(char *)"time_delay", __pyx_getprop_11distributed_9scheduler_11WorkerState_time_delay, 0, (char *)0, 0}, {(char *)"used_resources", __pyx_getprop_11distributed_9scheduler_11WorkerState_used_resources, 0, (char *)0, 0}, {(char *)"versions", __pyx_getprop_11distributed_9scheduler_11WorkerState_versions, 0, (char *)0, 0}, {(char *)"ncores", __pyx_getprop_11distributed_9scheduler_11WorkerState_ncores, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11distributed_9scheduler_WorkerState = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.WorkerState", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler_WorkerState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler_WorkerState, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11distributed_9scheduler_11WorkerState_9__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ __pyx_pw_11distributed_9scheduler_11WorkerState_3__hash__, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "\n A simple object holding information about a worker.\n\n .. attribute:: address: str\n\n This worker's unique key. This can be its connected address\n (such as ``'tcp://127.0.0.1:8891'``) or an alias (such as ``'alice'``).\n\n .. attribute:: processing: {TaskState: cost}\n\n A dictionary of tasks that have been submitted to this worker.\n Each task state is asssociated with the expected cost in seconds\n of running that task, summing both the task's expected computation\n time and the expected communication time of its result.\n\n Multiple tasks may be submitted to a worker in advance and the worker\n will run them eventually, depending on its execution resources\n (but see :doc:`work-stealing`).\n\n All the tasks here are in the \"processing\" state.\n\n This attribute is kept in sync with :attr:`TaskState.processing_on`.\n\n .. attribute:: executing: {TaskState: duration}\n\n A dictionary of tasks that are currently being run on this worker.\n Each task state is asssociated with the duration in seconds which\n the task has been running.\n\n .. attribute:: has_what: {TaskState}\n\n The set of tasks which currently reside on this worker.\n All the tasks here are in the \"memory\" state.\n\n This is the reverse mapping of :class:`TaskState.who_has`.\n\n .. attribute:: nbytes: int\n\n The total memory size, in bytes, used by the tasks this worker\n holds in memory (i.e. the tasks in this worker's :attr:`has_what`).\n\n .. attribute:: nthreads: int\n\n The number of CPU threads made available on this worker.\n\n .. attribute:: resources: {str: Number}\n\n The available resources on this worker like ``{'gpu': 2}``.\n These are abstract quantities that constrain certain tasks from\n running at the same time on this worker.\n\n .. attribute:: used_resources: {str: Number}\n\n The sum of each resource ""used by all tasks allocated to this worker.\n The numbers in this dictionary can only be less or equal than\n those in this worker's :attr:`resources`.\n\n .. attribute:: occupancy: double\n\n The total expected runtime, in seconds, of all tasks currently\n processing on this worker. This is the sum of all the costs in\n this worker's :attr:`processing` dictionary.\n\n .. attribute:: status: str\n\n The current status of the worker, either ``'running'`` or ``'closed'``\n\n .. attribute:: nanny: str\n\n Address of the associated Nanny, if present\n\n .. attribute:: last_seen: Py_ssize_t\n\n The last time we received a heartbeat from this worker, in local\n scheduler time.\n\n .. attribute:: actors: {TaskState}\n\n A set of all TaskStates on this worker that are actors. This only\n includes those actors whose state actually lives on this worker, not\n actors to which this worker has a reference.\n\n ", /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler_WorkerState, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler_WorkerState, /*tp_clear*/ __pyx_tp_richcompare_11distributed_9scheduler_WorkerState, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11distributed_9scheduler_WorkerState, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11distributed_9scheduler_WorkerState, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11distributed_9scheduler_11WorkerState_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler_WorkerState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_11distributed_9scheduler_TaskPrefix(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11distributed_9scheduler_TaskPrefix *p; PyObject *o; o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)o); p->_name = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_all_durations = Py_None; Py_INCREF(Py_None); p->_groups = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11distributed_9scheduler_TaskPrefix(PyObject *o) { struct __pyx_obj_11distributed_9scheduler_TaskPrefix *p = (struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->_name); Py_CLEAR(p->_all_durations); Py_CLEAR(p->_groups); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11distributed_9scheduler_TaskPrefix(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler_TaskPrefix *p = (struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)o; if (p->_all_durations) { e = (*v)(p->_all_durations, a); if (e) return e; } if (p->_groups) { e = (*v)(p->_groups, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler_TaskPrefix(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler_TaskPrefix *p = (struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)o; tmp = ((PyObject*)p->_all_durations); p->_all_durations = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_groups); p->_groups = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_4name_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_all_durations(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_13all_durations_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_duration_average(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_16duration_average_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_suspicious(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_10suspicious_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_groups(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_6groups_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_states(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_6states_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_active(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_6active_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_active_states(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_13active_states_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_nbytes_in_memory(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_16nbytes_in_memory_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_nbytes_total(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_12nbytes_total_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_duration(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_8duration_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_10TaskPrefix_types(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_10TaskPrefix_5types_1__get__(o); } static PyMethodDef __pyx_methods_11distributed_9scheduler_TaskPrefix[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_10TaskPrefix_7__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_10TaskPrefix_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11distributed_9scheduler_TaskPrefix[] = { {(char *)"name", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_name, 0, (char *)0, 0}, {(char *)"all_durations", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_all_durations, 0, (char *)0, 0}, {(char *)"duration_average", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_duration_average, 0, (char *)0, 0}, {(char *)"suspicious", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_suspicious, 0, (char *)0, 0}, {(char *)"groups", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_groups, 0, (char *)0, 0}, {(char *)"states", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_states, 0, (char *)0, 0}, {(char *)"active", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_active, 0, (char *)0, 0}, {(char *)"active_states", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_active_states, 0, (char *)0, 0}, {(char *)"nbytes_in_memory", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_nbytes_in_memory, 0, (char *)0, 0}, {(char *)"nbytes_total", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_nbytes_total, 0, (char *)0, 0}, {(char *)"duration", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_duration, 0, (char *)0, 0}, {(char *)"types", __pyx_getprop_11distributed_9scheduler_10TaskPrefix_types, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_TaskPrefix = { __pyx_pw_11distributed_9scheduler_10TaskPrefix_5__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_TaskPrefix = { __pyx_pw_11distributed_9scheduler_10TaskPrefix_5__len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11distributed_9scheduler_TaskPrefix = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.TaskPrefix", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler_TaskPrefix), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler_TaskPrefix, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11distributed_9scheduler_10TaskPrefix_3__repr__, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_TaskPrefix, /*tp_as_sequence*/ &__pyx_tp_as_mapping_TaskPrefix, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "Collection tracking all tasks within a group\n\n Keys often have a structure like ``(\"x-123\", 0)``\n A group takes the first section, like ``\"x\"``\n\n .. attribute:: name: str\n\n The name of a group of tasks.\n For a task like ``(\"x-123\", 0)`` this is the text ``\"x\"``\n\n .. attribute:: states: Dict[str, int]\n\n The number of tasks in each state,\n like ``{\"memory\": 10, \"processing\": 3, \"released\": 4, ...}``\n\n .. attribute:: duration_average: float\n\n An exponentially weighted moving average duration of all tasks with this prefix\n\n .. attribute:: suspicious: int\n\n Numbers of times a task was marked as suspicious with this prefix\n\n\n See Also\n --------\n TaskGroup\n ", /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler_TaskPrefix, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler_TaskPrefix, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11distributed_9scheduler_TaskPrefix, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11distributed_9scheduler_TaskPrefix, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11distributed_9scheduler_10TaskPrefix_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler_TaskPrefix, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11distributed_9scheduler_TaskGroup __pyx_vtable_11distributed_9scheduler_TaskGroup; static PyObject *__pyx_tp_new_11distributed_9scheduler_TaskGroup(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *p; PyObject *o; o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)o); p->__pyx_vtab = __pyx_vtabptr_11distributed_9scheduler_TaskGroup; p->_name = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_prefix = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)Py_None); Py_INCREF(Py_None); p->_states = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_dependencies = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_types = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11distributed_9scheduler_TaskGroup(PyObject *o) { struct __pyx_obj_11distributed_9scheduler_TaskGroup *p = (struct __pyx_obj_11distributed_9scheduler_TaskGroup *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->_name); Py_CLEAR(p->_prefix); Py_CLEAR(p->_states); Py_CLEAR(p->_dependencies); Py_CLEAR(p->_types); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11distributed_9scheduler_TaskGroup(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler_TaskGroup *p = (struct __pyx_obj_11distributed_9scheduler_TaskGroup *)o; if (p->_prefix) { e = (*v)(((PyObject *)p->_prefix), a); if (e) return e; } if (p->_states) { e = (*v)(p->_states, a); if (e) return e; } if (p->_dependencies) { e = (*v)(p->_dependencies, a); if (e) return e; } if (p->_types) { e = (*v)(p->_types, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler_TaskGroup(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler_TaskGroup *p = (struct __pyx_obj_11distributed_9scheduler_TaskGroup *)o; tmp = ((PyObject*)p->_prefix); p->_prefix = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_states); p->_states = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_dependencies); p->_dependencies = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_types); p->_types = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskGroup_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskGroup_4name_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskGroup_prefix(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskGroup_6prefix_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskGroup_states(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskGroup_6states_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskGroup_dependencies(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskGroup_12dependencies_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskGroup_nbytes_total(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskGroup_12nbytes_total_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskGroup_nbytes_in_memory(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskGroup_16nbytes_in_memory_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskGroup_duration(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskGroup_8duration_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskGroup_types(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskGroup_5types_1__get__(o); } static PyMethodDef __pyx_methods_11distributed_9scheduler_TaskGroup[] = { {"add", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskGroup_3add, METH_O, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskGroup_9__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskGroup_11__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11distributed_9scheduler_TaskGroup[] = { {(char *)"name", __pyx_getprop_11distributed_9scheduler_9TaskGroup_name, 0, (char *)0, 0}, {(char *)"prefix", __pyx_getprop_11distributed_9scheduler_9TaskGroup_prefix, 0, (char *)0, 0}, {(char *)"states", __pyx_getprop_11distributed_9scheduler_9TaskGroup_states, 0, (char *)0, 0}, {(char *)"dependencies", __pyx_getprop_11distributed_9scheduler_9TaskGroup_dependencies, 0, (char *)0, 0}, {(char *)"nbytes_total", __pyx_getprop_11distributed_9scheduler_9TaskGroup_nbytes_total, 0, (char *)0, 0}, {(char *)"nbytes_in_memory", __pyx_getprop_11distributed_9scheduler_9TaskGroup_nbytes_in_memory, 0, (char *)0, 0}, {(char *)"duration", __pyx_getprop_11distributed_9scheduler_9TaskGroup_duration, 0, (char *)0, 0}, {(char *)"types", __pyx_getprop_11distributed_9scheduler_9TaskGroup_types, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_TaskGroup = { __pyx_pw_11distributed_9scheduler_9TaskGroup_7__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_TaskGroup = { __pyx_pw_11distributed_9scheduler_9TaskGroup_7__len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11distributed_9scheduler_TaskGroup = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.TaskGroup", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler_TaskGroup), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler_TaskGroup, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11distributed_9scheduler_9TaskGroup_5__repr__, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_TaskGroup, /*tp_as_sequence*/ &__pyx_tp_as_mapping_TaskGroup, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "Collection tracking all tasks within a group\n\n Keys often have a structure like ``(\"x-123\", 0)``\n A group takes the first section, like ``\"x-123\"``\n\n .. attribute:: name: str\n\n The name of a group of tasks.\n For a task like ``(\"x-123\", 0)`` this is the text ``\"x-123\"``\n\n .. attribute:: states: Dict[str, int]\n\n The number of tasks in each state,\n like ``{\"memory\": 10, \"processing\": 3, \"released\": 4, ...}``\n\n .. attribute:: dependencies: Set[TaskGroup]\n\n The other TaskGroups on which this one depends\n\n .. attribute:: nbytes_total: int\n\n The total number of bytes that this task group has produced\n\n .. attribute:: nbytes_in_memory: int\n\n The number of bytes currently stored by this TaskGroup\n\n .. attribute:: duration: float\n\n The total amount of time spent on all tasks in this TaskGroup\n\n .. attribute:: types: Set[str]\n\n The result types of this TaskGroup\n\n See also\n --------\n TaskPrefix\n ", /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler_TaskGroup, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler_TaskGroup, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11distributed_9scheduler_TaskGroup, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11distributed_9scheduler_TaskGroup, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11distributed_9scheduler_9TaskGroup_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler_TaskGroup, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11distributed_9scheduler_TaskState __pyx_vtable_11distributed_9scheduler_TaskState; static PyObject *__pyx_tp_new_11distributed_9scheduler_TaskState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11distributed_9scheduler_TaskState *p; PyObject *o; o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11distributed_9scheduler_TaskState *)o); p->__pyx_vtab = __pyx_vtabptr_11distributed_9scheduler_TaskState; p->_key = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_prefix = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)Py_None); Py_INCREF(Py_None); p->_run_spec = Py_None; Py_INCREF(Py_None); p->_priority = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_state = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_dependencies = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_dependents = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_waiting_on = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_waiters = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_who_wants = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_who_has = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_processing_on = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); Py_INCREF(Py_None); p->_type = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_exception = Py_None; Py_INCREF(Py_None); p->_traceback = Py_None; Py_INCREF(Py_None); p->_exception_blame = Py_None; Py_INCREF(Py_None); p->_host_restrictions = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_worker_restrictions = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_resource_restrictions = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_metadata = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_annotations = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_group = ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)Py_None); Py_INCREF(Py_None); p->_group_key = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11distributed_9scheduler_TaskState(PyObject *o) { struct __pyx_obj_11distributed_9scheduler_TaskState *p = (struct __pyx_obj_11distributed_9scheduler_TaskState *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->_key); Py_CLEAR(p->_prefix); Py_CLEAR(p->_run_spec); Py_CLEAR(p->_priority); Py_CLEAR(p->_state); Py_CLEAR(p->_dependencies); Py_CLEAR(p->_dependents); Py_CLEAR(p->_waiting_on); Py_CLEAR(p->_waiters); Py_CLEAR(p->_who_wants); Py_CLEAR(p->_who_has); Py_CLEAR(p->_processing_on); Py_CLEAR(p->_type); Py_CLEAR(p->_exception); Py_CLEAR(p->_traceback); Py_CLEAR(p->_exception_blame); Py_CLEAR(p->_host_restrictions); Py_CLEAR(p->_worker_restrictions); Py_CLEAR(p->_resource_restrictions); Py_CLEAR(p->_metadata); Py_CLEAR(p->_annotations); Py_CLEAR(p->_group); Py_CLEAR(p->_group_key); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11distributed_9scheduler_TaskState(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler_TaskState *p = (struct __pyx_obj_11distributed_9scheduler_TaskState *)o; if (p->_prefix) { e = (*v)(((PyObject *)p->_prefix), a); if (e) return e; } if (p->_run_spec) { e = (*v)(p->_run_spec, a); if (e) return e; } if (p->_priority) { e = (*v)(p->_priority, a); if (e) return e; } if (p->_dependencies) { e = (*v)(p->_dependencies, a); if (e) return e; } if (p->_dependents) { e = (*v)(p->_dependents, a); if (e) return e; } if (p->_waiting_on) { e = (*v)(p->_waiting_on, a); if (e) return e; } if (p->_waiters) { e = (*v)(p->_waiters, a); if (e) return e; } if (p->_who_wants) { e = (*v)(p->_who_wants, a); if (e) return e; } if (p->_who_has) { e = (*v)(p->_who_has, a); if (e) return e; } if (p->_processing_on) { e = (*v)(((PyObject *)p->_processing_on), a); if (e) return e; } if (p->_exception) { e = (*v)(p->_exception, a); if (e) return e; } if (p->_traceback) { e = (*v)(p->_traceback, a); if (e) return e; } if (p->_exception_blame) { e = (*v)(p->_exception_blame, a); if (e) return e; } if (p->_host_restrictions) { e = (*v)(p->_host_restrictions, a); if (e) return e; } if (p->_worker_restrictions) { e = (*v)(p->_worker_restrictions, a); if (e) return e; } if (p->_resource_restrictions) { e = (*v)(p->_resource_restrictions, a); if (e) return e; } if (p->_metadata) { e = (*v)(p->_metadata, a); if (e) return e; } if (p->_annotations) { e = (*v)(p->_annotations, a); if (e) return e; } if (p->_group) { e = (*v)(((PyObject *)p->_group), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler_TaskState(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler_TaskState *p = (struct __pyx_obj_11distributed_9scheduler_TaskState *)o; tmp = ((PyObject*)p->_prefix); p->_prefix = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_run_spec); p->_run_spec = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_priority); p->_priority = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_dependencies); p->_dependencies = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_dependents); p->_dependents = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_waiting_on); p->_waiting_on = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_waiters); p->_waiters = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_who_wants); p->_who_wants = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_who_has); p->_who_has = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_processing_on); p->_processing_on = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_exception); p->_exception = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_traceback); p->_traceback = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_exception_blame); p->_exception_blame = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_host_restrictions); p->_host_restrictions = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_worker_restrictions); p->_worker_restrictions = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_resource_restrictions); p->_resource_restrictions = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_metadata); p->_metadata = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_annotations); p->_annotations = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_group); p->_group = ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_richcompare_11distributed_9scheduler_TaskState(PyObject *o1, PyObject *o2, int op) { switch (op) { case Py_EQ: { return __pyx_pw_11distributed_9scheduler_9TaskState_5__eq__(o1, o2); } case Py_NE: { PyObject *ret; ret = __pyx_pw_11distributed_9scheduler_9TaskState_5__eq__(o1, o2); if (likely(ret && ret != Py_NotImplemented)) { int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret); if (unlikely(b < 0)) return NULL; ret = (b) ? Py_False : Py_True; Py_INCREF(ret); } return ret; } default: { return __Pyx_NewRef(Py_NotImplemented); } } } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_key(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_3key_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_prefix(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_6prefix_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_run_spec(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_8run_spec_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_priority(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_8priority_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_state(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_5state_1__get__(o); } static int __pyx_setprop_11distributed_9scheduler_9TaskState_state(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11distributed_9scheduler_9TaskState_5state_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_dependencies(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_12dependencies_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_dependents(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_10dependents_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_has_lost_dependencies(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_21has_lost_dependencies_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_waiting_on(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_10waiting_on_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_waiters(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_7waiters_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_who_wants(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_9who_wants_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_who_has(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_7who_has_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_processing_on(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_13processing_on_1__get__(o); } static int __pyx_setprop_11distributed_9scheduler_9TaskState_processing_on(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11distributed_9scheduler_9TaskState_13processing_on_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_retries(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_7retries_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_nbytes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_6nbytes_1__get__(o); } static int __pyx_setprop_11distributed_9scheduler_9TaskState_nbytes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11distributed_9scheduler_9TaskState_6nbytes_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_4type_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_exception(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_9exception_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_traceback(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_9traceback_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_exception_blame(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_15exception_blame_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_suspicious(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_10suspicious_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_host_restrictions(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_17host_restrictions_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_worker_restrictions(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_19worker_restrictions_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_resource_restrictions(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_21resource_restrictions_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_loose_restrictions(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_18loose_restrictions_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_metadata(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_8metadata_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_annotations(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_11annotations_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_actor(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_5actor_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_group(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_5group_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_group_key(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_9group_key_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_9TaskState_prefix_key(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_9TaskState_10prefix_key_1__get__(o); } static PyMethodDef __pyx_methods_11distributed_9scheduler_TaskState[] = { {"add_dependency", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskState_7add_dependency, METH_O, __pyx_doc_11distributed_9scheduler_9TaskState_6add_dependency}, {"get_nbytes", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskState_9get_nbytes, METH_NOARGS, 0}, {"set_nbytes", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskState_11set_nbytes, METH_O, 0}, {"validate", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskState_15validate, METH_NOARGS, 0}, {"get_nbytes_deps", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskState_17get_nbytes_deps, METH_NOARGS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskState_19__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_9TaskState_21__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11distributed_9scheduler_TaskState[] = { {(char *)"key", __pyx_getprop_11distributed_9scheduler_9TaskState_key, 0, (char *)0, 0}, {(char *)"prefix", __pyx_getprop_11distributed_9scheduler_9TaskState_prefix, 0, (char *)0, 0}, {(char *)"run_spec", __pyx_getprop_11distributed_9scheduler_9TaskState_run_spec, 0, (char *)0, 0}, {(char *)"priority", __pyx_getprop_11distributed_9scheduler_9TaskState_priority, 0, (char *)0, 0}, {(char *)"state", __pyx_getprop_11distributed_9scheduler_9TaskState_state, __pyx_setprop_11distributed_9scheduler_9TaskState_state, (char *)0, 0}, {(char *)"dependencies", __pyx_getprop_11distributed_9scheduler_9TaskState_dependencies, 0, (char *)0, 0}, {(char *)"dependents", __pyx_getprop_11distributed_9scheduler_9TaskState_dependents, 0, (char *)0, 0}, {(char *)"has_lost_dependencies", __pyx_getprop_11distributed_9scheduler_9TaskState_has_lost_dependencies, 0, (char *)0, 0}, {(char *)"waiting_on", __pyx_getprop_11distributed_9scheduler_9TaskState_waiting_on, 0, (char *)0, 0}, {(char *)"waiters", __pyx_getprop_11distributed_9scheduler_9TaskState_waiters, 0, (char *)0, 0}, {(char *)"who_wants", __pyx_getprop_11distributed_9scheduler_9TaskState_who_wants, 0, (char *)0, 0}, {(char *)"who_has", __pyx_getprop_11distributed_9scheduler_9TaskState_who_has, 0, (char *)0, 0}, {(char *)"processing_on", __pyx_getprop_11distributed_9scheduler_9TaskState_processing_on, __pyx_setprop_11distributed_9scheduler_9TaskState_processing_on, (char *)0, 0}, {(char *)"retries", __pyx_getprop_11distributed_9scheduler_9TaskState_retries, 0, (char *)0, 0}, {(char *)"nbytes", __pyx_getprop_11distributed_9scheduler_9TaskState_nbytes, __pyx_setprop_11distributed_9scheduler_9TaskState_nbytes, (char *)0, 0}, {(char *)"type", __pyx_getprop_11distributed_9scheduler_9TaskState_type, 0, (char *)0, 0}, {(char *)"exception", __pyx_getprop_11distributed_9scheduler_9TaskState_exception, 0, (char *)0, 0}, {(char *)"traceback", __pyx_getprop_11distributed_9scheduler_9TaskState_traceback, 0, (char *)0, 0}, {(char *)"exception_blame", __pyx_getprop_11distributed_9scheduler_9TaskState_exception_blame, 0, (char *)0, 0}, {(char *)"suspicious", __pyx_getprop_11distributed_9scheduler_9TaskState_suspicious, 0, (char *)0, 0}, {(char *)"host_restrictions", __pyx_getprop_11distributed_9scheduler_9TaskState_host_restrictions, 0, (char *)0, 0}, {(char *)"worker_restrictions", __pyx_getprop_11distributed_9scheduler_9TaskState_worker_restrictions, 0, (char *)0, 0}, {(char *)"resource_restrictions", __pyx_getprop_11distributed_9scheduler_9TaskState_resource_restrictions, 0, (char *)0, 0}, {(char *)"loose_restrictions", __pyx_getprop_11distributed_9scheduler_9TaskState_loose_restrictions, 0, (char *)0, 0}, {(char *)"metadata", __pyx_getprop_11distributed_9scheduler_9TaskState_metadata, 0, (char *)0, 0}, {(char *)"annotations", __pyx_getprop_11distributed_9scheduler_9TaskState_annotations, 0, (char *)0, 0}, {(char *)"actor", __pyx_getprop_11distributed_9scheduler_9TaskState_actor, 0, (char *)0, 0}, {(char *)"group", __pyx_getprop_11distributed_9scheduler_9TaskState_group, 0, (char *)0, 0}, {(char *)"group_key", __pyx_getprop_11distributed_9scheduler_9TaskState_group_key, 0, (char *)0, 0}, {(char *)"prefix_key", __pyx_getprop_11distributed_9scheduler_9TaskState_prefix_key, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11distributed_9scheduler_TaskState = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.TaskState", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler_TaskState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler_TaskState, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11distributed_9scheduler_9TaskState_13__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ __pyx_pw_11distributed_9scheduler_9TaskState_3__hash__, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "\n A simple object holding information about a task.\n\n .. attribute:: key: str\n\n The key is the unique identifier of a task, generally formed\n from the name of the function, followed by a hash of the function\n and arguments, like ``'inc-ab31c010444977004d656610d2d421ec'``.\n\n .. attribute:: prefix: TaskPrefix\n\n The broad class of tasks to which this task belongs like \"inc\" or\n \"read_csv\"\n\n .. attribute:: run_spec: object\n\n A specification of how to run the task. The type and meaning of this\n value is opaque to the scheduler, as it is only interpreted by the\n worker to which the task is sent for executing.\n\n As a special case, this attribute may also be ``None``, in which case\n the task is \"pure data\" (such as, for example, a piece of data loaded\n in the scheduler using :meth:`Client.scatter`). A \"pure data\" task\n cannot be computed again if its value is lost.\n\n .. attribute:: priority: tuple\n\n The priority provides each task with a relative ranking which is used\n to break ties when many tasks are being considered for execution.\n\n This ranking is generally a 2-item tuple. The first (and dominant)\n item corresponds to when it was submitted. Generally, earlier tasks\n take precedence. The second item is determined by the client, and is\n a way to prioritize tasks within a large graph that may be important,\n such as if they are on the critical path, or good to run in order to\n release many dependencies. This is explained further in\n :doc:`Scheduling Policy `.\n\n .. attribute:: state: str\n\n This task's current state. Valid states include ``released``,\n ``waiting``, ``no-worker``, ``processing``, ``memory``, ``erred``\n and ``forgotten``. If it is ``forgotten``, the task isn't stored\n in the ``tasks`` dictionary anymore and will proba""bly disappear\n soon from memory.\n\n .. attribute:: dependencies: {TaskState}\n\n The set of tasks this task depends on for proper execution. Only\n tasks still alive are listed in this set. If, for whatever reason,\n this task also depends on a forgotten task, the\n :attr:`has_lost_dependencies` flag is set.\n\n A task can only be executed once all its dependencies have already\n been successfully executed and have their result stored on at least\n one worker. This is tracked by progressively draining the\n :attr:`waiting_on` set.\n\n .. attribute:: dependents: {TaskState}\n\n The set of tasks which depend on this task. Only tasks still alive\n are listed in this set.\n\n This is the reverse mapping of :attr:`dependencies`.\n\n .. attribute:: has_lost_dependencies: bool\n\n Whether any of the dependencies of this task has been forgotten.\n For memory consumption reasons, forgotten tasks are not kept in\n memory even though they may have dependent tasks. When a task is\n forgotten, therefore, each of its dependents has their\n :attr:`has_lost_dependencies` attribute set to ``True``.\n\n If :attr:`has_lost_dependencies` is true, this task cannot go\n into the \"processing\" state anymore.\n\n .. attribute:: waiting_on: {TaskState}\n\n The set of tasks this task is waiting on *before* it can be executed.\n This is always a subset of :attr:`dependencies`. Each time one of the\n dependencies has finished processing, it is removed from the\n :attr:`waiting_on` set.\n\n Once :attr:`waiting_on` becomes empty, this task can move from the\n \"waiting\" state to the \"processing\" state (unless one of the\n dependencies errored out, in which case this task is instead\n marked \"erred\").\n\n .. attribute:: waiters: {TaskState}\n\n The set of tasks which need this task to remain alive. Thi""s is always\n a subset of :attr:`dependents`. Each time one of the dependents\n has finished processing, it is removed from the :attr:`waiters`\n set.\n\n Once both :attr:`waiters` and :attr:`who_wants` become empty, this\n task can be released (if it has a non-empty :attr:`run_spec`) or\n forgotten (otherwise) by the scheduler, and by any workers\n in :attr:`who_has`.\n\n .. note:: Counter-intuitively, :attr:`waiting_on` and\n :attr:`waiters` are not reverse mappings of each other.\n\n .. attribute:: who_wants: {ClientState}\n\n The set of clients who want this task's result to remain alive.\n This is the reverse mapping of :attr:`ClientState.wants_what`.\n\n When a client submits a graph to the scheduler it also specifies\n which output tasks it desires, such that their results are not released\n from memory.\n\n Once a task has finished executing (i.e. moves into the \"memory\"\n or \"erred\" state), the clients in :attr:`who_wants` are notified.\n\n Once both :attr:`waiters` and :attr:`who_wants` become empty, this\n task can be released (if it has a non-empty :attr:`run_spec`) or\n forgotten (otherwise) by the scheduler, and by any workers\n in :attr:`who_has`.\n\n .. attribute:: who_has: {WorkerState}\n\n The set of workers who have this task's result in memory.\n It is non-empty iff the task is in the \"memory\" state. There can be\n more than one worker in this set if, for example, :meth:`Client.scatter`\n or :meth:`Client.replicate` was used.\n\n This is the reverse mapping of :attr:`WorkerState.has_what`.\n\n .. attribute:: processing_on: WorkerState (or None)\n\n If this task is in the \"processing\" state, which worker is currently\n processing it. Otherwise this is ``None``.\n\n This attribute is kept in sync with :attr:`WorkerState.processing`.\n\n .. attribute:: retrie""s: int\n\n The number of times this task can automatically be retried in case\n of failure. If a task fails executing (the worker returns with\n an error), its :attr:`retries` attribute is checked. If it is\n equal to 0, the task is marked \"erred\". If it is greater than 0,\n the :attr:`retries` attribute is decremented and execution is\n attempted again.\n\n .. attribute:: nbytes: int (or None)\n\n The number of bytes, as determined by ``sizeof``, of the result\n of a finished task. This number is used for diagnostics and to\n help prioritize work.\n\n .. attribute:: type: str\n\n The type of the object as a string. Only present for tasks that have\n been computed.\n\n .. attribute:: exception: object\n\n If this task failed executing, the exception object is stored here.\n Otherwise this is ``None``.\n\n .. attribute:: traceback: object\n\n If this task failed executing, the traceback object is stored here.\n Otherwise this is ``None``.\n\n .. attribute:: exception_blame: TaskState (or None)\n\n If this task or one of its dependencies failed executing, the\n failed task is stored here (possibly itself). Otherwise this\n is ``None``.\n\n .. attribute:: suspicious: int\n\n The number of times this task has been involved in a worker death.\n\n Some tasks may cause workers to die (such as calling ``os._exit(0)``).\n When a worker dies, all of the tasks on that worker are reassigned\n to others. This combination of behaviors can cause a bad task to\n catastrophically destroy all workers on the cluster, one after\n another. Whenever a worker dies, we mark each task currently\n processing on that worker (as recorded by\n :attr:`WorkerState.processing`) as suspicious.\n\n If a task is involved in three deaths (or some other fixed constant)\n then we mark the task as ``erred``.""\n\n .. attribute:: host_restrictions: {hostnames}\n\n A set of hostnames where this task can be run (or ``None`` if empty).\n Usually this is empty unless the task has been specifically restricted\n to only run on certain hosts. A hostname may correspond to one or\n several connected workers.\n\n .. attribute:: worker_restrictions: {worker addresses}\n\n A set of complete worker addresses where this can be run (or ``None``\n if empty). Usually this is empty unless the task has been specifically\n restricted to only run on certain workers.\n\n Note this is tracking worker addresses, not worker states, since\n the specific workers may not be connected at this time.\n\n .. attribute:: resource_restrictions: {resource: quantity}\n\n Resources required by this task, such as ``{'gpu': 1}`` or\n ``{'memory': 1e9}`` (or ``None`` if empty). These are user-defined\n names and are matched against the contents of each\n :attr:`WorkerState.resources` dictionary.\n\n .. attribute:: loose_restrictions: bool\n\n If ``False``, each of :attr:`host_restrictions`,\n :attr:`worker_restrictions` and :attr:`resource_restrictions` is\n a hard constraint: if no worker is available satisfying those\n restrictions, the task cannot go into the \"processing\" state and\n will instead go into the \"no-worker\" state.\n\n If ``True``, the above restrictions are mere preferences: if no worker\n is available satisfying those restrictions, the task can still go\n into the \"processing\" state and be sent for execution to another\n connected worker.\n\n .. attribute:: metadata: dict\n\n Metadata related to task.\n\n .. attribute:: actor: bool\n\n Whether or not this task is an Actor.\n\n .. attribute:: group: TaskGroup\n\n The group of tasks to which this one belongs.\n\n .. attribute:: annotations: dict\n\n Task anno""tations\n ", /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler_TaskState, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler_TaskState, /*tp_clear*/ __pyx_tp_richcompare_11distributed_9scheduler_TaskState, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11distributed_9scheduler_TaskState, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11distributed_9scheduler_TaskState, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11distributed_9scheduler_9TaskState_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler_TaskState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11distributed_9scheduler_SchedulerState __pyx_vtable_11distributed_9scheduler_SchedulerState; static PyObject *__pyx_tp_new_11distributed_9scheduler_SchedulerState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)o); p->__pyx_vtab = __pyx_vtabptr_11distributed_9scheduler_SchedulerState; p->_aliases = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_clients = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_extensions = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_host_info = Py_None; Py_INCREF(Py_None); p->_idle = Py_None; Py_INCREF(Py_None); p->_idle_dv = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_resources = Py_None; Py_INCREF(Py_None); p->_saturated = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_tasks = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_task_groups = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_task_prefixes = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_task_metadata = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_unknown_durations = Py_None; Py_INCREF(Py_None); p->_unrunnable = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_workers = Py_None; Py_INCREF(Py_None); p->_workers_dv = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11distributed_9scheduler_SchedulerState(PyObject *o) { struct __pyx_obj_11distributed_9scheduler_SchedulerState *p = (struct __pyx_obj_11distributed_9scheduler_SchedulerState *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->_aliases); Py_CLEAR(p->_clients); Py_CLEAR(p->_extensions); Py_CLEAR(p->_host_info); Py_CLEAR(p->_idle); Py_CLEAR(p->_idle_dv); Py_CLEAR(p->_resources); Py_CLEAR(p->_saturated); Py_CLEAR(p->_tasks); Py_CLEAR(p->_task_groups); Py_CLEAR(p->_task_prefixes); Py_CLEAR(p->_task_metadata); Py_CLEAR(p->_unknown_durations); Py_CLEAR(p->_unrunnable); Py_CLEAR(p->_workers); Py_CLEAR(p->_workers_dv); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11distributed_9scheduler_SchedulerState(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler_SchedulerState *p = (struct __pyx_obj_11distributed_9scheduler_SchedulerState *)o; if (p->_aliases) { e = (*v)(p->_aliases, a); if (e) return e; } if (p->_clients) { e = (*v)(p->_clients, a); if (e) return e; } if (p->_extensions) { e = (*v)(p->_extensions, a); if (e) return e; } if (p->_host_info) { e = (*v)(p->_host_info, a); if (e) return e; } if (p->_idle) { e = (*v)(p->_idle, a); if (e) return e; } if (p->_idle_dv) { e = (*v)(p->_idle_dv, a); if (e) return e; } if (p->_resources) { e = (*v)(p->_resources, a); if (e) return e; } if (p->_saturated) { e = (*v)(p->_saturated, a); if (e) return e; } if (p->_tasks) { e = (*v)(p->_tasks, a); if (e) return e; } if (p->_task_groups) { e = (*v)(p->_task_groups, a); if (e) return e; } if (p->_task_prefixes) { e = (*v)(p->_task_prefixes, a); if (e) return e; } if (p->_task_metadata) { e = (*v)(p->_task_metadata, a); if (e) return e; } if (p->_unknown_durations) { e = (*v)(p->_unknown_durations, a); if (e) return e; } if (p->_unrunnable) { e = (*v)(p->_unrunnable, a); if (e) return e; } if (p->_workers) { e = (*v)(p->_workers, a); if (e) return e; } if (p->_workers_dv) { e = (*v)(p->_workers_dv, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler_SchedulerState(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler_SchedulerState *p = (struct __pyx_obj_11distributed_9scheduler_SchedulerState *)o; tmp = ((PyObject*)p->_aliases); p->_aliases = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_clients); p->_clients = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_extensions); p->_extensions = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_host_info); p->_host_info = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_idle); p->_idle = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_idle_dv); p->_idle_dv = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_resources); p->_resources = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_saturated); p->_saturated = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_tasks); p->_tasks = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_task_groups); p->_task_groups = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_task_prefixes); p->_task_prefixes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_task_metadata); p->_task_metadata = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_unknown_durations); p->_unknown_durations = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_unrunnable); p->_unrunnable = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_workers); p->_workers = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_workers_dv); p->_workers_dv = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_aliases(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_7aliases_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_bandwidth(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_9bandwidth_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_clients(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_7clients_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_extensions(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_10extensions_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_host_info(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_9host_info_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_idle(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_4idle_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_n_tasks(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_7n_tasks_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_resources(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_9resources_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_saturated(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_9saturated_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_tasks(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_5tasks_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_task_groups(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_11task_groups_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_task_prefixes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_13task_prefixes_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_task_metadata(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_13task_metadata_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_total_nthreads(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_14total_nthreads_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_total_occupancy(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_15total_occupancy_1__get__(o); } static int __pyx_setprop_11distributed_9scheduler_14SchedulerState_total_occupancy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_15total_occupancy_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_unknown_durations(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_17unknown_durations_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_unrunnable(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_10unrunnable_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_validate(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_8validate_1__get__(o); } static int __pyx_setprop_11distributed_9scheduler_14SchedulerState_validate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_8validate_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState_workers(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_7workers_1__get__(o); } static PyObject *__pyx_getprop_11distributed_9scheduler_14SchedulerState___pdict__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11distributed_9scheduler_14SchedulerState_9__pdict___1__get__(o); } static PyMethodDef __pyx_methods_11distributed_9scheduler_SchedulerState[] = { {"transition_released_waiting", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_3transition_released_waiting, METH_O, 0}, {"transition_no_worker_waiting", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_5transition_no_worker_waiting, METH_O, 0}, {"decide_worker", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_7decide_worker, METH_O, __pyx_doc_11distributed_9scheduler_14SchedulerState_6decide_worker}, {"set_duration_estimate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_9set_duration_estimate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_14SchedulerState_8set_duration_estimate}, {"transition_waiting_processing", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_11transition_waiting_processing, METH_O, 0}, {"transition_waiting_memory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_13transition_waiting_memory, METH_VARARGS|METH_KEYWORDS, 0}, {"transition_processing_memory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_15transition_processing_memory, METH_VARARGS|METH_KEYWORDS, 0}, {"transition_memory_released", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_17transition_memory_released, METH_VARARGS|METH_KEYWORDS, 0}, {"transition_released_erred", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_19transition_released_erred, METH_O, 0}, {"transition_erred_released", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_21transition_erred_released, METH_O, 0}, {"transition_waiting_released", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_23transition_waiting_released, METH_O, 0}, {"transition_processing_released", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_25transition_processing_released, METH_O, 0}, {"transition_processing_erred", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_27transition_processing_erred, METH_VARARGS|METH_KEYWORDS, 0}, {"transition_no_worker_released", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_29transition_no_worker_released, METH_O, 0}, {"remove_key", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_31remove_key, METH_O, 0}, {"transition_memory_forgotten", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_33transition_memory_forgotten, METH_O, 0}, {"transition_released_forgotten", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_35transition_released_forgotten, METH_O, 0}, {"check_idle_saturated", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_37check_idle_saturated, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_14SchedulerState_36check_idle_saturated}, {"get_comm_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_39get_comm_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_14SchedulerState_38get_comm_cost}, {"get_task_duration", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_41get_task_duration, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_14SchedulerState_40get_task_duration}, {"valid_workers", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_43valid_workers, METH_O, __pyx_doc_11distributed_9scheduler_14SchedulerState_42valid_workers}, {"consume_resources", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_45consume_resources, METH_VARARGS|METH_KEYWORDS, 0}, {"release_resources", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_47release_resources, METH_VARARGS|METH_KEYWORDS, 0}, {"coerce_hostname", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_49coerce_hostname, METH_O, __pyx_doc_11distributed_9scheduler_14SchedulerState_48coerce_hostname}, {"worker_objective", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11distributed_9scheduler_14SchedulerState_51worker_objective, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11distributed_9scheduler_14SchedulerState_50worker_objective}, {"__reduce_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_53__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_11distributed_9scheduler_14SchedulerState_55__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11distributed_9scheduler_SchedulerState[] = { {(char *)"aliases", __pyx_getprop_11distributed_9scheduler_14SchedulerState_aliases, 0, (char *)0, 0}, {(char *)"bandwidth", __pyx_getprop_11distributed_9scheduler_14SchedulerState_bandwidth, 0, (char *)0, 0}, {(char *)"clients", __pyx_getprop_11distributed_9scheduler_14SchedulerState_clients, 0, (char *)0, 0}, {(char *)"extensions", __pyx_getprop_11distributed_9scheduler_14SchedulerState_extensions, 0, (char *)0, 0}, {(char *)"host_info", __pyx_getprop_11distributed_9scheduler_14SchedulerState_host_info, 0, (char *)0, 0}, {(char *)"idle", __pyx_getprop_11distributed_9scheduler_14SchedulerState_idle, 0, (char *)0, 0}, {(char *)"n_tasks", __pyx_getprop_11distributed_9scheduler_14SchedulerState_n_tasks, 0, (char *)0, 0}, {(char *)"resources", __pyx_getprop_11distributed_9scheduler_14SchedulerState_resources, 0, (char *)0, 0}, {(char *)"saturated", __pyx_getprop_11distributed_9scheduler_14SchedulerState_saturated, 0, (char *)0, 0}, {(char *)"tasks", __pyx_getprop_11distributed_9scheduler_14SchedulerState_tasks, 0, (char *)0, 0}, {(char *)"task_groups", __pyx_getprop_11distributed_9scheduler_14SchedulerState_task_groups, 0, (char *)0, 0}, {(char *)"task_prefixes", __pyx_getprop_11distributed_9scheduler_14SchedulerState_task_prefixes, 0, (char *)0, 0}, {(char *)"task_metadata", __pyx_getprop_11distributed_9scheduler_14SchedulerState_task_metadata, 0, (char *)0, 0}, {(char *)"total_nthreads", __pyx_getprop_11distributed_9scheduler_14SchedulerState_total_nthreads, 0, (char *)0, 0}, {(char *)"total_occupancy", __pyx_getprop_11distributed_9scheduler_14SchedulerState_total_occupancy, __pyx_setprop_11distributed_9scheduler_14SchedulerState_total_occupancy, (char *)0, 0}, {(char *)"unknown_durations", __pyx_getprop_11distributed_9scheduler_14SchedulerState_unknown_durations, 0, (char *)0, 0}, {(char *)"unrunnable", __pyx_getprop_11distributed_9scheduler_14SchedulerState_unrunnable, 0, (char *)0, 0}, {(char *)"validate", __pyx_getprop_11distributed_9scheduler_14SchedulerState_validate, __pyx_setprop_11distributed_9scheduler_14SchedulerState_validate, (char *)0, 0}, {(char *)"workers", __pyx_getprop_11distributed_9scheduler_14SchedulerState_workers, 0, (char *)0, 0}, {(char *)"__pdict__", __pyx_getprop_11distributed_9scheduler_14SchedulerState___pdict__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11distributed_9scheduler_SchedulerState = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.SchedulerState", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler_SchedulerState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler_SchedulerState, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "Underlying task state of dynamic scheduler\n\n Tracks the current state of workers, data, and computations.\n\n Handles transitions between different task states. Notifies the\n Scheduler of changes by messaging passing through Queues, which the\n Scheduler listens to responds accordingly.\n\n All events are handled quickly, in linear time with respect to their\n input (which is often of constant size) and generally within a\n millisecond. Additionally when Cythonized, this can be faster still.\n To accomplish this the scheduler tracks a lot of state. Every\n operation maintains the consistency of this state.\n\n Users typically do not interact with ``Transitions`` directly. Instead\n users interact with the ``Client``, which in turn engages the\n ``Scheduler`` affecting different transitions here under-the-hood. In\n the background ``Worker``s also engage with the ``Scheduler``\n affecting these state transitions as well.\n\n **State**\n\n The ``Transitions`` object contains the following state variables.\n Each variable is listed along with what it stores and a brief\n description.\n\n * **tasks:** ``{task key: TaskState}``\n Tasks currently known to the scheduler\n * **unrunnable:** ``{TaskState}``\n Tasks in the \"no-worker\" state\n\n * **workers:** ``{worker key: WorkerState}``\n Workers currently connected to the scheduler\n * **idle:** ``{WorkerState}``:\n Set of workers that are not fully utilized\n * **saturated:** ``{WorkerState}``:\n Set of workers that are not over-utilized\n\n * **clients:** ``{client key: ClientState}``\n Clients currently connected to the scheduler\n\n * **task_duration:** ``{key-prefix: time}``\n Time we expect certain functions to take, e.g. ``{'sum': 0.25}``\n ", /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler_SchedulerState, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler_SchedulerState, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11distributed_9scheduler_SchedulerState, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11distributed_9scheduler_SchedulerState, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11distributed_9scheduler_14SchedulerState_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler_SchedulerState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct____repr__[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct____repr__ = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct____repr__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct____repr__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct____repr__[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct____repr__]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct____repr__(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct____repr__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct____repr__[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct____repr__++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct____repr__(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *)o; if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct____repr__(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__ *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = ((struct __pyx_obj_11distributed_9scheduler_TaskPrefix *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct____repr__ = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct____repr__", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct____repr__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct____repr__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct____repr__, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct____repr__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct____repr__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_1_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_1_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_1_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_1_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_1_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_v); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_1_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_1_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_1_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_1_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_1_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_2___repr__[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_2___repr__ = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_2___repr__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_2___repr__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_2___repr__[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_2___repr__]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_2___repr__(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_2___repr__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_2___repr__[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_2___repr__++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_2___repr__(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *)o; if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_2___repr__(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__ *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = ((struct __pyx_obj_11distributed_9scheduler_TaskGroup *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_2___repr__ = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_2___repr__", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_2___repr__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_2___repr__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_2___repr__, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_2___repr__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_2___repr__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_3_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_3_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_3_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_3_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_3_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_v); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_3_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_3_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_3_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_3_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_4___iter__[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_4___iter__ = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_4___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_4___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_4___iter__[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_4___iter__]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_4___iter__(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_accessor); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_4___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_4___iter__[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_4___iter__++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_4___iter__(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__ *)o; if (p->__pyx_v_accessor) { e = (*v)(p->__pyx_v_accessor, a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_4___iter__ = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_4___iter__", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_4___iter__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_4___iter__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_4___iter__, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_4___iter__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_5___len__[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_5___len__ = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_5___len__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_5___len__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_5___len__[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_5___len__]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_5___len__(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_accessor); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_5___len__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_5___len__[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_5___len__++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_5___len__(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *)o; if (p->__pyx_v_accessor) { e = (*v)(p->__pyx_v_accessor, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_5___len__(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__ *)o; tmp = ((PyObject*)p->__pyx_v_accessor); p->__pyx_v_accessor = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_5___len__ = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_5___len__", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_5___len__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_5___len__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_5___len__, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_5___len__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_5___len__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_6_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_6_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_6_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_6_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_6_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_6_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_6_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_7___iter__[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_7___iter__ = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_7___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_7___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_7___iter__[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_7___iter__]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_7___iter__(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_7___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_7___iter__[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_7___iter__++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_7___iter__(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_7___iter__(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__ *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_7___iter__ = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_7___iter__", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_7___iter__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_7___iter__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_7___iter__, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_7___iter__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_7___iter__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_8_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_8_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_8_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_8_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_8_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_8_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_8_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_8_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_8_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_8_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_8_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_8_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_9_start[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_9_start = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_9_start(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_9_start > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_9_start[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_9_start]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_9_start(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_addr); Py_CLEAR(p->__pyx_v_c); Py_CLEAR(p->__pyx_v_del_scheduler_file); Py_CLEAR(p->__pyx_v_f); Py_CLEAR(p->__pyx_v_fn); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_listen_ip); Py_CLEAR(p->__pyx_v_listener); Py_CLEAR(p->__pyx_9genexpr32__pyx_v_plugin); Py_CLEAR(p->__pyx_v_preload); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_9_start < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_9_start[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_9_start++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_9_start(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start *)o; if (p->__pyx_v_addr) { e = (*v)(p->__pyx_v_addr, a); if (e) return e; } if (p->__pyx_v_c) { e = (*v)(p->__pyx_v_c, a); if (e) return e; } if (p->__pyx_v_del_scheduler_file) { e = (*v)(p->__pyx_v_del_scheduler_file, a); if (e) return e; } if (p->__pyx_v_f) { e = (*v)(p->__pyx_v_f, a); if (e) return e; } if (p->__pyx_v_fn) { e = (*v)(p->__pyx_v_fn, a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_listen_ip) { e = (*v)(p->__pyx_v_listen_ip, a); if (e) return e; } if (p->__pyx_v_listener) { e = (*v)(p->__pyx_v_listener, a); if (e) return e; } if (p->__pyx_9genexpr32__pyx_v_plugin) { e = (*v)(p->__pyx_9genexpr32__pyx_v_plugin, a); if (e) return e; } if (p->__pyx_v_preload) { e = (*v)(p->__pyx_v_preload, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_9_start = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_9_start", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_9_start), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_9_start, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_9_start, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_9_start, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_10_close[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_10_close = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_10_close(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_10_close > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_10_close[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_10_close]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_10_close(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_close_workers); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_ext); Py_CLEAR(p->__pyx_v_fast); Py_CLEAR(p->__pyx_v_future); Py_CLEAR(p->__pyx_v_futures); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_pc); Py_CLEAR(p->__pyx_9genexpr33__pyx_v_plugin); Py_CLEAR(p->__pyx_v_preload); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_w); Py_CLEAR(p->__pyx_v_worker); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_10_close < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_10_close[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_10_close++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_10_close(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close *)o; if (p->__pyx_v_close_workers) { e = (*v)(p->__pyx_v_close_workers, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_ext) { e = (*v)(p->__pyx_v_ext, a); if (e) return e; } if (p->__pyx_v_fast) { e = (*v)(p->__pyx_v_fast, a); if (e) return e; } if (p->__pyx_v_future) { e = (*v)(p->__pyx_v_future, a); if (e) return e; } if (p->__pyx_v_futures) { e = (*v)(p->__pyx_v_futures, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_pc) { e = (*v)(p->__pyx_v_pc, a); if (e) return e; } if (p->__pyx_9genexpr33__pyx_v_plugin) { e = (*v)(p->__pyx_9genexpr33__pyx_v_plugin, a); if (e) return e; } if (p->__pyx_v_preload) { e = (*v)(p->__pyx_v_preload, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_w) { e = (*v)(p->__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_worker) { e = (*v)(p->__pyx_v_worker, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_10_close = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_10_close", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_10_close), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_10_close, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_10_close, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_10_close, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_11_close_worker[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_11_close_worker = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_11_close_worker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_11_close_worker > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_11_close_worker[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_11_close_worker]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_11_close_worker(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_address); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_nanny_addr); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_safe); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_worker); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_11_close_worker < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_11_close_worker[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_11_close_worker++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_11_close_worker(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker *)o; if (p->__pyx_v_address) { e = (*v)(p->__pyx_v_address, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_safe) { e = (*v)(p->__pyx_v_safe, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_worker) { e = (*v)(p->__pyx_v_worker, a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_11_close_worker = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_11_close_worker", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_11_close_worker), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_11_close_worker, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_11_close_worker, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_11_close_worker, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_12_add_worker[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_12_add_worker = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_12_add_worker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_12_add_worker > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_12_add_worker[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_12_add_worker]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_12_add_worker(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_address); Py_CLEAR(p->__pyx_9genexpr36__pyx_v_c); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_9genexpr36__pyx_v_cs); Py_CLEAR(p->__pyx_v_cs); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_v_extra); Py_CLEAR(p->__pyx_v_host); Py_CLEAR(p->__pyx_v_host_info); Py_CLEAR(p->__pyx_v_key); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_local_directory); Py_CLEAR(p->__pyx_v_memory_limit); Py_CLEAR(p->__pyx_v_metrics); Py_CLEAR(p->__pyx_v_msg); Py_CLEAR(p->__pyx_v_name); Py_CLEAR(p->__pyx_v_nanny); Py_CLEAR(p->__pyx_v_nbytes); Py_CLEAR(p->__pyx_v_now); Py_CLEAR(p->__pyx_v_nthreads); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_pid); Py_CLEAR(p->__pyx_v_plugin); Py_CLEAR(p->__pyx_v_recommendations); Py_CLEAR(p->__pyx_v_resolve_address); Py_CLEAR(p->__pyx_v_resources); Py_CLEAR(p->__pyx_v_response); Py_CLEAR(p->__pyx_v_result); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_services); Py_CLEAR(p->__pyx_v_tasks); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_v_types); Py_CLEAR(p->__pyx_v_valid); Py_CLEAR(p->__pyx_v_version_warning); Py_CLEAR(p->__pyx_v_versions); Py_CLEAR(p->__pyx_9genexpr35__pyx_v_w); Py_CLEAR(p->__pyx_9genexpr35__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_8); Py_CLEAR(p->__pyx_t_9); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_12_add_worker < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_12_add_worker[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_12_add_worker++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_12_add_worker(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker *)o; if (p->__pyx_v_address) { e = (*v)(p->__pyx_v_address, a); if (e) return e; } if (p->__pyx_9genexpr36__pyx_v_c) { e = (*v)(p->__pyx_9genexpr36__pyx_v_c, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_9genexpr36__pyx_v_cs) { e = (*v)(((PyObject *)p->__pyx_9genexpr36__pyx_v_cs), a); if (e) return e; } if (p->__pyx_v_cs) { e = (*v)(((PyObject *)p->__pyx_v_cs), a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_v_extra) { e = (*v)(p->__pyx_v_extra, a); if (e) return e; } if (p->__pyx_v_host) { e = (*v)(p->__pyx_v_host, a); if (e) return e; } if (p->__pyx_v_host_info) { e = (*v)(p->__pyx_v_host_info, a); if (e) return e; } if (p->__pyx_v_key) { e = (*v)(p->__pyx_v_key, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_local_directory) { e = (*v)(p->__pyx_v_local_directory, a); if (e) return e; } if (p->__pyx_v_memory_limit) { e = (*v)(p->__pyx_v_memory_limit, a); if (e) return e; } if (p->__pyx_v_metrics) { e = (*v)(p->__pyx_v_metrics, a); if (e) return e; } if (p->__pyx_v_msg) { e = (*v)(p->__pyx_v_msg, a); if (e) return e; } if (p->__pyx_v_name) { e = (*v)(p->__pyx_v_name, a); if (e) return e; } if (p->__pyx_v_nanny) { e = (*v)(p->__pyx_v_nanny, a); if (e) return e; } if (p->__pyx_v_nbytes) { e = (*v)(p->__pyx_v_nbytes, a); if (e) return e; } if (p->__pyx_v_now) { e = (*v)(p->__pyx_v_now, a); if (e) return e; } if (p->__pyx_v_nthreads) { e = (*v)(p->__pyx_v_nthreads, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_pid) { e = (*v)(p->__pyx_v_pid, a); if (e) return e; } if (p->__pyx_v_plugin) { e = (*v)(p->__pyx_v_plugin, a); if (e) return e; } if (p->__pyx_v_recommendations) { e = (*v)(p->__pyx_v_recommendations, a); if (e) return e; } if (p->__pyx_v_resolve_address) { e = (*v)(p->__pyx_v_resolve_address, a); if (e) return e; } if (p->__pyx_v_resources) { e = (*v)(p->__pyx_v_resources, a); if (e) return e; } if (p->__pyx_v_response) { e = (*v)(p->__pyx_v_response, a); if (e) return e; } if (p->__pyx_v_result) { e = (*v)(p->__pyx_v_result, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_services) { e = (*v)(p->__pyx_v_services, a); if (e) return e; } if (p->__pyx_v_tasks) { e = (*v)(p->__pyx_v_tasks, a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_types) { e = (*v)(p->__pyx_v_types, a); if (e) return e; } if (p->__pyx_v_valid) { e = (*v)(p->__pyx_v_valid, a); if (e) return e; } if (p->__pyx_v_version_warning) { e = (*v)(p->__pyx_v_version_warning, a); if (e) return e; } if (p->__pyx_v_versions) { e = (*v)(p->__pyx_v_versions, a); if (e) return e; } if (p->__pyx_9genexpr35__pyx_v_w) { e = (*v)(p->__pyx_9genexpr35__pyx_v_w, a); if (e) return e; } if (p->__pyx_9genexpr35__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr35__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } if (p->__pyx_t_8) { e = (*v)(p->__pyx_t_8, a); if (e) return e; } if (p->__pyx_t_9) { e = (*v)(p->__pyx_t_9, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_12_add_worker = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_12_add_worker", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_12_add_worker), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_12_add_worker, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_12_add_worker, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_12_add_worker, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_13_update_graph[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_13_update_graph = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_13_update_graph(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_13_update_graph > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_13_update_graph[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_13_update_graph]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_13_update_graph(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_annotations); Py_CLEAR(p->__pyx_v_child_deps); Py_CLEAR(p->__pyx_v_deps); Py_CLEAR(p->__pyx_v_done); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_tasks); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_13_update_graph < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_13_update_graph[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_13_update_graph++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_13_update_graph(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *)o; if (p->__pyx_v_annotations) { e = (*v)(p->__pyx_v_annotations, a); if (e) return e; } if (p->__pyx_v_child_deps) { e = (*v)(p->__pyx_v_child_deps, a); if (e) return e; } if (p->__pyx_v_deps) { e = (*v)(p->__pyx_v_deps, a); if (e) return e; } if (p->__pyx_v_done) { e = (*v)(p->__pyx_v_done, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_tasks) { e = (*v)(p->__pyx_v_tasks, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_13_update_graph(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph *)o; tmp = ((PyObject*)p->__pyx_v_annotations); p->__pyx_v_annotations = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_child_deps); p->__pyx_v_child_deps = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_deps); p->__pyx_v_deps = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_done); p->__pyx_v_done = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_parent); p->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_tasks); p->__pyx_v_tasks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_13_update_graph = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_13_update_graph", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_13_update_graph), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_13_update_graph, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_13_update_graph, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_13_update_graph, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_13_update_graph, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_14_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_14_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_14_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_14_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_14_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_dep); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_14_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_dep) { e = (*v)(p->__pyx_v_dep, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_14_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_14_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_14_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_14_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_15_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_15_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_15_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_15_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_15_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_15_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_d); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_15_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_15_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_d) { e = (*v)(p->__pyx_v_d, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_15_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_15_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_15_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_15_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_15_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_15_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_16_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_16_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_16_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_16_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_16_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_16_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_16_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_16_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_16_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_16_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_16_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_16_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_16_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_16_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_16_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_16_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_16_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_17_remove_worker[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_17_remove_worker = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_17_remove_worker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_17_remove_worker > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_17_remove_worker[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_17_remove_worker]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_17_remove_worker(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_address); Py_CLEAR(p->__pyx_v_cleanup_delay); Py_CLEAR(p->__pyx_v_close); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_v_host); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_plugin); Py_CLEAR(p->__pyx_v_r); Py_CLEAR(p->__pyx_v_recommendations); Py_CLEAR(p->__pyx_v_remove_worker_from_events); Py_CLEAR(p->__pyx_v_result); Py_CLEAR(p->__pyx_v_safe); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_v_w); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); Py_CLEAR(p->__pyx_t_7); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_17_remove_worker < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_17_remove_worker[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_17_remove_worker++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_17_remove_worker(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker *)o; if (p->__pyx_v_address) { e = (*v)(p->__pyx_v_address, a); if (e) return e; } if (p->__pyx_v_cleanup_delay) { e = (*v)(p->__pyx_v_cleanup_delay, a); if (e) return e; } if (p->__pyx_v_close) { e = (*v)(p->__pyx_v_close, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_v_host) { e = (*v)(p->__pyx_v_host, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_plugin) { e = (*v)(p->__pyx_v_plugin, a); if (e) return e; } if (p->__pyx_v_r) { e = (*v)(p->__pyx_v_r, a); if (e) return e; } if (p->__pyx_v_recommendations) { e = (*v)(p->__pyx_v_recommendations, a); if (e) return e; } if (p->__pyx_v_remove_worker_from_events) { e = (*v)(p->__pyx_v_remove_worker_from_events, a); if (e) return e; } if (p->__pyx_v_result) { e = (*v)(p->__pyx_v_result, a); if (e) return e; } if (p->__pyx_v_safe) { e = (*v)(p->__pyx_v_safe, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_w) { e = (*v)(p->__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_17_remove_worker = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_17_remove_worker", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_17_remove_worker), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_17_remove_worker, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_17_remove_worker, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_17_remove_worker, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_18_cancel_key[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_18_cancel_key = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_18_cancel_key(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_18_cancel_key > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_18_cancel_key[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_18_cancel_key]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_18_cancel_key(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_client); Py_CLEAR(p->__pyx_v_key); Py_CLEAR(p->__pyx_v_retries); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_18_cancel_key < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_18_cancel_key[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_18_cancel_key++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_18_cancel_key(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *)o; if (p->__pyx_v_client) { e = (*v)(p->__pyx_v_client, a); if (e) return e; } if (p->__pyx_v_key) { e = (*v)(p->__pyx_v_key, a); if (e) return e; } if (p->__pyx_v_retries) { e = (*v)(p->__pyx_v_retries, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_18_cancel_key(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key *)o; tmp = ((PyObject*)p->__pyx_v_client); p->__pyx_v_client = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_key); p->__pyx_v_key = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_retries); p->__pyx_v_retries = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_18_cancel_key = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_18_cancel_key", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_18_cancel_key), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_18_cancel_key, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_18_cancel_key, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_18_cancel_key, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_18_cancel_key, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_19_validate_state[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_19_validate_state = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_19_validate_state(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_19_validate_state > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_19_validate_state[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_19_validate_state]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_19_validate_state(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_9genexpr47__pyx_v_ws); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_19_validate_state < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_19_validate_state[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_19_validate_state++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_19_validate_state(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *)o; if (p->__pyx_9genexpr47__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr47__pyx_v_ws), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_19_validate_state(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state *)o; tmp = ((PyObject*)p->__pyx_9genexpr47__pyx_v_ws); p->__pyx_9genexpr47__pyx_v_ws = ((struct __pyx_obj_11distributed_9scheduler_WorkerState *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_19_validate_state = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_19_validate_state", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_19_validate_state), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_19_validate_state, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_19_validate_state, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_19_validate_state, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_19_validate_state, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_20_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_20_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_20_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_20_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_20_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_20_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_20_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_20_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(p->__pyx_v_ts, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_20_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_20_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_20_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_20_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_20_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_21_add_client[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_21_add_client = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_21_add_client(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_21_add_client > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_21_add_client[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_21_add_client]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_21_add_client(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_bcomm); Py_CLEAR(p->__pyx_v_client); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_v_msg); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_plugin); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_version_warning); Py_CLEAR(p->__pyx_v_versions); Py_CLEAR(p->__pyx_9genexpr51__pyx_v_w); Py_CLEAR(p->__pyx_9genexpr51__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_8); Py_CLEAR(p->__pyx_t_9); Py_CLEAR(p->__pyx_t_10); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_21_add_client < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_21_add_client[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_21_add_client++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_21_add_client(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client *)o; if (p->__pyx_v_bcomm) { e = (*v)(p->__pyx_v_bcomm, a); if (e) return e; } if (p->__pyx_v_client) { e = (*v)(p->__pyx_v_client, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_v_msg) { e = (*v)(p->__pyx_v_msg, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_plugin) { e = (*v)(p->__pyx_v_plugin, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_version_warning) { e = (*v)(p->__pyx_v_version_warning, a); if (e) return e; } if (p->__pyx_v_versions) { e = (*v)(p->__pyx_v_versions, a); if (e) return e; } if (p->__pyx_9genexpr51__pyx_v_w) { e = (*v)(p->__pyx_9genexpr51__pyx_v_w, a); if (e) return e; } if (p->__pyx_9genexpr51__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr51__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } if (p->__pyx_t_8) { e = (*v)(p->__pyx_t_8, a); if (e) return e; } if (p->__pyx_t_9) { e = (*v)(p->__pyx_t_9, a); if (e) return e; } if (p->__pyx_t_10) { e = (*v)(p->__pyx_t_10, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_21_add_client = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_21_add_client", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_21_add_client), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_21_add_client, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_21_add_client, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_21_add_client, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_22_remove_client[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_22_remove_client = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_22_remove_client(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_22_remove_client > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_22_remove_client[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_22_remove_client]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_22_remove_client(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_client); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_22_remove_client < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_22_remove_client[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_22_remove_client++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_22_remove_client(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *)o; if (p->__pyx_v_client) { e = (*v)(p->__pyx_v_client, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_22_remove_client(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client *)o; tmp = ((PyObject*)p->__pyx_v_client); p->__pyx_v_client = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_parent); p->__pyx_v_parent = ((struct __pyx_obj_11distributed_9scheduler_SchedulerState *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_22_remove_client = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_22_remove_client", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_22_remove_client), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_22_remove_client, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_22_remove_client, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_22_remove_client, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_22_remove_client, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_23_handle_worker[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_23_handle_worker = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_23_handle_worker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_23_handle_worker > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_23_handle_worker[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_23_handle_worker]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_23_handle_worker(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_worker); Py_CLEAR(p->__pyx_v_worker_comm); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_8); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_23_handle_worker < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_23_handle_worker[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_23_handle_worker++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_23_handle_worker(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_worker) { e = (*v)(p->__pyx_v_worker, a); if (e) return e; } if (p->__pyx_v_worker_comm) { e = (*v)(p->__pyx_v_worker_comm, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } if (p->__pyx_t_8) { e = (*v)(p->__pyx_t_8, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_23_handle_worker = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_23_handle_worker", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_23_handle_worker), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_23_handle_worker, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_23_handle_worker, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_23_handle_worker, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_24_add_plugin[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_24_add_plugin = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_24_add_plugin(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_24_add_plugin > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_24_add_plugin[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_24_add_plugin]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_24_add_plugin(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_plugin); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_24_add_plugin < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_24_add_plugin[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_24_add_plugin++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_24_add_plugin(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *)o; if (p->__pyx_v_plugin) { e = (*v)(p->__pyx_v_plugin, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_24_add_plugin(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin *)o; tmp = ((PyObject*)p->__pyx_v_plugin); p->__pyx_v_plugin = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_24_add_plugin = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_24_add_plugin", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_24_add_plugin), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_24_add_plugin, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_24_add_plugin, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_24_add_plugin, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_24_add_plugin, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_25_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_25_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_25_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_25_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_25_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_25_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_p); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_25_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_25_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_25_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_p) { e = (*v)(p->__pyx_v_p, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_25_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_25_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_25_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_25_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_25_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_25_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_26_scatter[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_26_scatter = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_26_scatter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_26_scatter > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_26_scatter[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_26_scatter]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_26_scatter(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_broadcast); Py_CLEAR(p->__pyx_v_client); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_data); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_n); Py_CLEAR(p->__pyx_v_nbytes); Py_CLEAR(p->__pyx_v_nthreads); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_start); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_9genexpr55__pyx_v_w); Py_CLEAR(p->__pyx_9genexpr56__pyx_v_w); Py_CLEAR(p->__pyx_9genexpr57__pyx_v_w); Py_CLEAR(p->__pyx_v_who_has); Py_CLEAR(p->__pyx_v_workers); Py_CLEAR(p->__pyx_9genexpr55__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_26_scatter < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_26_scatter[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_26_scatter++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_26_scatter(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter *)o; if (p->__pyx_v_broadcast) { e = (*v)(p->__pyx_v_broadcast, a); if (e) return e; } if (p->__pyx_v_client) { e = (*v)(p->__pyx_v_client, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_data) { e = (*v)(p->__pyx_v_data, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_n) { e = (*v)(p->__pyx_v_n, a); if (e) return e; } if (p->__pyx_v_nbytes) { e = (*v)(p->__pyx_v_nbytes, a); if (e) return e; } if (p->__pyx_v_nthreads) { e = (*v)(p->__pyx_v_nthreads, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_start) { e = (*v)(p->__pyx_v_start, a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_9genexpr55__pyx_v_w) { e = (*v)(p->__pyx_9genexpr55__pyx_v_w, a); if (e) return e; } if (p->__pyx_9genexpr56__pyx_v_w) { e = (*v)(p->__pyx_9genexpr56__pyx_v_w, a); if (e) return e; } if (p->__pyx_9genexpr57__pyx_v_w) { e = (*v)(p->__pyx_9genexpr57__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_who_has) { e = (*v)(p->__pyx_v_who_has, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } if (p->__pyx_9genexpr55__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr55__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_26_scatter = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_26_scatter", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_26_scatter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_26_scatter, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_26_scatter, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_26_scatter, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_27_gather[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_27_gather = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_27_gather(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_27_gather > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_27_gather[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_27_gather]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_27_gather(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_data); Py_CLEAR(p->__pyx_9genexpr59__pyx_v_key); Py_CLEAR(p->__pyx_v_key); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_missing_keys); Py_CLEAR(p->__pyx_v_missing_states); Py_CLEAR(p->__pyx_v_missing_workers); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_result); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_serializers); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_v_who_has); Py_CLEAR(p->__pyx_9genexpr60__pyx_v_worker); Py_CLEAR(p->__pyx_v_worker); Py_CLEAR(p->__pyx_v_workers); Py_CLEAR(p->__pyx_9genexpr58__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_27_gather < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_27_gather[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_27_gather++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_27_gather(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_data) { e = (*v)(p->__pyx_v_data, a); if (e) return e; } if (p->__pyx_9genexpr59__pyx_v_key) { e = (*v)(p->__pyx_9genexpr59__pyx_v_key, a); if (e) return e; } if (p->__pyx_v_key) { e = (*v)(p->__pyx_v_key, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_missing_keys) { e = (*v)(p->__pyx_v_missing_keys, a); if (e) return e; } if (p->__pyx_v_missing_states) { e = (*v)(p->__pyx_v_missing_states, a); if (e) return e; } if (p->__pyx_v_missing_workers) { e = (*v)(p->__pyx_v_missing_workers, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_result) { e = (*v)(p->__pyx_v_result, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_serializers) { e = (*v)(p->__pyx_v_serializers, a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_who_has) { e = (*v)(p->__pyx_v_who_has, a); if (e) return e; } if (p->__pyx_9genexpr60__pyx_v_worker) { e = (*v)(p->__pyx_9genexpr60__pyx_v_worker, a); if (e) return e; } if (p->__pyx_v_worker) { e = (*v)(p->__pyx_v_worker, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } if (p->__pyx_9genexpr58__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr58__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_27_gather = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_27_gather", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_27_gather), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_27_gather, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_27_gather, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_27_gather, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_28_restart[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_28_restart = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_28_restart(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_28_restart > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_28_restart[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_28_restart]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_28_restart(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_9genexpr62__pyx_v_addr); Py_CLEAR(p->__pyx_v_addr); Py_CLEAR(p->__pyx_v_c); Py_CLEAR(p->__pyx_v_client); Py_CLEAR(p->__pyx_v_cs); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_v_nannies); Py_CLEAR(p->__pyx_9genexpr64__pyx_v_nanny); Py_CLEAR(p->__pyx_9genexpr66__pyx_v_nanny); Py_CLEAR(p->__pyx_9genexpr67__pyx_v_nanny); Py_CLEAR(p->__pyx_9genexpr63__pyx_v_nanny_address); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_plugin); Py_CLEAR(p->__pyx_v_resps); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_start); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_9genexpr61__pyx_v_ts); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_9genexpr62__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_6); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_8); Py_CLEAR(p->__pyx_t_11); Py_CLEAR(p->__pyx_t_12); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_28_restart < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_28_restart[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_28_restart++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_28_restart(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart *)o; if (p->__pyx_9genexpr62__pyx_v_addr) { e = (*v)(p->__pyx_9genexpr62__pyx_v_addr, a); if (e) return e; } if (p->__pyx_v_addr) { e = (*v)(p->__pyx_v_addr, a); if (e) return e; } if (p->__pyx_v_c) { e = (*v)(p->__pyx_v_c, a); if (e) return e; } if (p->__pyx_v_client) { e = (*v)(p->__pyx_v_client, a); if (e) return e; } if (p->__pyx_v_cs) { e = (*v)(((PyObject *)p->__pyx_v_cs), a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_v_genexpr) { e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; } if (p->__pyx_v_nannies) { e = (*v)(p->__pyx_v_nannies, a); if (e) return e; } if (p->__pyx_9genexpr64__pyx_v_nanny) { e = (*v)(p->__pyx_9genexpr64__pyx_v_nanny, a); if (e) return e; } if (p->__pyx_9genexpr66__pyx_v_nanny) { e = (*v)(p->__pyx_9genexpr66__pyx_v_nanny, a); if (e) return e; } if (p->__pyx_9genexpr67__pyx_v_nanny) { e = (*v)(p->__pyx_9genexpr67__pyx_v_nanny, a); if (e) return e; } if (p->__pyx_9genexpr63__pyx_v_nanny_address) { e = (*v)(p->__pyx_9genexpr63__pyx_v_nanny_address, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_plugin) { e = (*v)(p->__pyx_v_plugin, a); if (e) return e; } if (p->__pyx_v_resps) { e = (*v)(p->__pyx_v_resps, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_start) { e = (*v)(p->__pyx_v_start, a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_9genexpr61__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_9genexpr61__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_9genexpr62__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr62__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } if (p->__pyx_t_8) { e = (*v)(p->__pyx_t_8, a); if (e) return e; } if (p->__pyx_t_11) { e = (*v)(p->__pyx_t_11, a); if (e) return e; } if (p->__pyx_t_12) { e = (*v)(p->__pyx_t_12, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_28_restart = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_28_restart", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_28_restart), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_28_restart, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_28_restart, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_28_restart, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_29_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_29_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_29_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_29_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_29_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_29_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_resp); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_29_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_29_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_29_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_resp) { e = (*v)(p->__pyx_v_resp, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_29_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_29_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_29_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_29_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_29_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_29_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_30_broadcast[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_30_broadcast = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_30_broadcast(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_30_broadcast > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_30_broadcast[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_30_broadcast]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_30_broadcast(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_9genexpr69__pyx_v_address); Py_CLEAR(p->__pyx_v_addresses); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_host); Py_CLEAR(p->__pyx_v_hosts); Py_CLEAR(p->__pyx_v_msg); Py_CLEAR(p->__pyx_v_nanny); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_results); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_send_message); Py_CLEAR(p->__pyx_v_serializers); Py_CLEAR(p->__pyx_9genexpr68__pyx_v_w); Py_CLEAR(p->__pyx_v_workers); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_30_broadcast < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_30_broadcast[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_30_broadcast++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_30_broadcast(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast *)o; if (p->__pyx_9genexpr69__pyx_v_address) { e = (*v)(p->__pyx_9genexpr69__pyx_v_address, a); if (e) return e; } if (p->__pyx_v_addresses) { e = (*v)(p->__pyx_v_addresses, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_host) { e = (*v)(p->__pyx_v_host, a); if (e) return e; } if (p->__pyx_v_hosts) { e = (*v)(p->__pyx_v_hosts, a); if (e) return e; } if (p->__pyx_v_msg) { e = (*v)(p->__pyx_v_msg, a); if (e) return e; } if (p->__pyx_v_nanny) { e = (*v)(p->__pyx_v_nanny, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_results) { e = (*v)(p->__pyx_v_results, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_send_message) { e = (*v)(p->__pyx_v_send_message, a); if (e) return e; } if (p->__pyx_v_serializers) { e = (*v)(p->__pyx_v_serializers, a); if (e) return e; } if (p->__pyx_9genexpr68__pyx_v_w) { e = (*v)(p->__pyx_9genexpr68__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_30_broadcast = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_30_broadcast", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_30_broadcast), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_30_broadcast, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_30_broadcast, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_30_broadcast, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_31_send_message[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_31_send_message = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_31_send_message(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_31_send_message > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_31_send_message[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_31_send_message]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_31_send_message(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_addr); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_resp); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_31_send_message < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_31_send_message[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_31_send_message++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_31_send_message(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_addr) { e = (*v)(p->__pyx_v_addr, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_resp) { e = (*v)(p->__pyx_v_resp, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_31_send_message = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_31_send_message", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_31_send_message), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_31_send_message, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_31_send_message, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_31_send_message, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_32_proxy[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_32_proxy = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_32_proxy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_32_proxy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_32_proxy[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_32_proxy]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_32_proxy(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_d); Py_CLEAR(p->__pyx_v_msg); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_serializers); Py_CLEAR(p->__pyx_v_worker); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_32_proxy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_32_proxy[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_32_proxy++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_32_proxy(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_d) { e = (*v)(p->__pyx_v_d, a); if (e) return e; } if (p->__pyx_v_msg) { e = (*v)(p->__pyx_v_msg, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_serializers) { e = (*v)(p->__pyx_v_serializers, a); if (e) return e; } if (p->__pyx_v_worker) { e = (*v)(p->__pyx_v_worker, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_32_proxy = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_32_proxy", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_32_proxy), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_32_proxy, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_32_proxy, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_32_proxy, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_9genexpr70__pyx_v_key); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_tasks); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_v_worker_address); Py_CLEAR(p->__pyx_v_ws); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data *)o; if (p->__pyx_9genexpr70__pyx_v_key) { e = (*v)(p->__pyx_9genexpr70__pyx_v_key, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_tasks) { e = (*v)(p->__pyx_v_tasks, a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_worker_address) { e = (*v)(p->__pyx_v_worker_address, a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_33__delete_worker_data", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_34_rebalance[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_34_rebalance = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_34_rebalance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_34_rebalance > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_34_rebalance[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_34_rebalance]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_34_rebalance(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_avg); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_9genexpr71__pyx_v_k); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_missing_data); Py_CLEAR(p->__pyx_v_msgs); Py_CLEAR(p->__pyx_v_nb); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_r); Py_CLEAR(p->__pyx_v_recipient); Py_CLEAR(p->__pyx_v_recipients); Py_CLEAR(p->__pyx_v_result); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_sender); Py_CLEAR(p->__pyx_v_sender_keys); Py_CLEAR(p->__pyx_v_sorted_workers); Py_CLEAR(p->__pyx_v_tasks); Py_CLEAR(p->__pyx_v_tasks_by_worker); Py_CLEAR(p->__pyx_v_to_recipients); Py_CLEAR(p->__pyx_v_to_senders); Py_CLEAR(p->__pyx_9genexpr72__pyx_v_ts); Py_CLEAR(p->__pyx_9genexpr74__pyx_v_ts); Py_CLEAR(p->__pyx_9genexpr75__pyx_v_ts); Py_CLEAR(p->__pyx_9genexpr79__pyx_v_ts); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_9genexpr77__pyx_v_v); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_v_vv); Py_CLEAR(p->__pyx_9genexpr73__pyx_v_w); Py_CLEAR(p->__pyx_v_worker_bytes); Py_CLEAR(p->__pyx_v_workers); Py_CLEAR(p->__pyx_v_workers_by_task); Py_CLEAR(p->__pyx_9genexpr76__pyx_v_ws); Py_CLEAR(p->__pyx_9genexpr77__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_8); Py_CLEAR(p->__pyx_t_9); Py_CLEAR(p->__pyx_t_10); Py_CLEAR(p->__pyx_t_11); Py_CLEAR(p->__pyx_t_12); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_34_rebalance < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_34_rebalance[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_34_rebalance++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_34_rebalance(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance *)o; if (p->__pyx_v_avg) { e = (*v)(p->__pyx_v_avg, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_genexpr) { e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; } if (p->__pyx_9genexpr71__pyx_v_k) { e = (*v)(p->__pyx_9genexpr71__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_missing_data) { e = (*v)(p->__pyx_v_missing_data, a); if (e) return e; } if (p->__pyx_v_msgs) { e = (*v)(p->__pyx_v_msgs, a); if (e) return e; } if (p->__pyx_v_nb) { e = (*v)(p->__pyx_v_nb, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_r) { e = (*v)(p->__pyx_v_r, a); if (e) return e; } if (p->__pyx_v_recipient) { e = (*v)(p->__pyx_v_recipient, a); if (e) return e; } if (p->__pyx_v_recipients) { e = (*v)(p->__pyx_v_recipients, a); if (e) return e; } if (p->__pyx_v_result) { e = (*v)(p->__pyx_v_result, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_sender) { e = (*v)(p->__pyx_v_sender, a); if (e) return e; } if (p->__pyx_v_sender_keys) { e = (*v)(p->__pyx_v_sender_keys, a); if (e) return e; } if (p->__pyx_v_sorted_workers) { e = (*v)(p->__pyx_v_sorted_workers, a); if (e) return e; } if (p->__pyx_v_tasks) { e = (*v)(p->__pyx_v_tasks, a); if (e) return e; } if (p->__pyx_v_tasks_by_worker) { e = (*v)(p->__pyx_v_tasks_by_worker, a); if (e) return e; } if (p->__pyx_v_to_recipients) { e = (*v)(p->__pyx_v_to_recipients, a); if (e) return e; } if (p->__pyx_v_to_senders) { e = (*v)(p->__pyx_v_to_senders, a); if (e) return e; } if (p->__pyx_9genexpr72__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_9genexpr72__pyx_v_ts), a); if (e) return e; } if (p->__pyx_9genexpr74__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_9genexpr74__pyx_v_ts), a); if (e) return e; } if (p->__pyx_9genexpr75__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_9genexpr75__pyx_v_ts), a); if (e) return e; } if (p->__pyx_9genexpr79__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_9genexpr79__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_9genexpr77__pyx_v_v) { e = (*v)(p->__pyx_9genexpr77__pyx_v_v, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_v_vv) { e = (*v)(p->__pyx_v_vv, a); if (e) return e; } if (p->__pyx_9genexpr73__pyx_v_w) { e = (*v)(p->__pyx_9genexpr73__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_worker_bytes) { e = (*v)(p->__pyx_v_worker_bytes, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } if (p->__pyx_v_workers_by_task) { e = (*v)(p->__pyx_v_workers_by_task, a); if (e) return e; } if (p->__pyx_9genexpr76__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr76__pyx_v_ws), a); if (e) return e; } if (p->__pyx_9genexpr77__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr77__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } if (p->__pyx_t_8) { e = (*v)(p->__pyx_t_8, a); if (e) return e; } if (p->__pyx_t_9) { e = (*v)(p->__pyx_t_9, a); if (e) return e; } if (p->__pyx_t_10) { e = (*v)(p->__pyx_t_10, a); if (e) return e; } if (p->__pyx_t_11) { e = (*v)(p->__pyx_t_11, a); if (e) return e; } if (p->__pyx_t_12) { e = (*v)(p->__pyx_t_12, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_34_rebalance = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_34_rebalance", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_34_rebalance), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_34_rebalance, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_34_rebalance, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_34_rebalance, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_35_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_35_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_35_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_35_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_35_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_35_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_35_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_35_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_35_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_35_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_35_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(p->__pyx_v_ts, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_35_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_35_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_35_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_35_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_35_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_35_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_36_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_36_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_36_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_36_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_36_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_36_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_36_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_r); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_36_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_36_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_36_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_36_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_r) { e = (*v)(p->__pyx_v_r, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_36_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_36_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_36_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_36_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_36_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_36_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_37_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_37_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_37_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_37_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_37_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_37_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_37_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_r); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_37_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_37_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_37_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_37_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_r) { e = (*v)(p->__pyx_v_r, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_37_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_37_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_37_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_37_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_37_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_37_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_38_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_38_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_38_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_38_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_38_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_38_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_38_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_r); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_38_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_38_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_38_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_38_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_r) { e = (*v)(p->__pyx_v_r, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_38_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_38_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_38_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_38_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_38_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_38_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_39_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_39_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_39_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_39_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_39_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_39_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_39_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_r); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_39_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_39_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_39_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_39_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_r) { e = (*v)(p->__pyx_v_r, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_39_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_39_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_39_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_39_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_39_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_39_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_40_replicate[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_40_replicate = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_40_replicate(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_40_replicate > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_40_replicate[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_40_replicate]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_40_replicate(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_branching_factor); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_count); Py_CLEAR(p->__pyx_v_del_candidates); Py_CLEAR(p->__pyx_v_del_worker_tasks); Py_CLEAR(p->__pyx_v_delete); Py_CLEAR(p->__pyx_v_gathers); Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_9genexpr85__pyx_v_k); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_lock); Py_CLEAR(p->__pyx_v_missing_data); Py_CLEAR(p->__pyx_v_n); Py_CLEAR(p->__pyx_v_n_missing); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_results); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_9genexpr88__pyx_v_t); Py_CLEAR(p->__pyx_9genexpr87__pyx_v_tasks); Py_CLEAR(p->__pyx_v_tasks); Py_CLEAR(p->__pyx_9genexpr86__pyx_v_ts); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_9genexpr84__pyx_v_w); Py_CLEAR(p->__pyx_v_w); Py_CLEAR(p->__pyx_v_workers); Py_CLEAR(p->__pyx_9genexpr87__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_9genexpr89__pyx_v_wws); Py_CLEAR(p->__pyx_v_wws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_8); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_40_replicate < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_40_replicate[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_40_replicate++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_40_replicate(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate *)o; if (p->__pyx_v_branching_factor) { e = (*v)(p->__pyx_v_branching_factor, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_count) { e = (*v)(p->__pyx_v_count, a); if (e) return e; } if (p->__pyx_v_del_candidates) { e = (*v)(p->__pyx_v_del_candidates, a); if (e) return e; } if (p->__pyx_v_del_worker_tasks) { e = (*v)(p->__pyx_v_del_worker_tasks, a); if (e) return e; } if (p->__pyx_v_delete) { e = (*v)(p->__pyx_v_delete, a); if (e) return e; } if (p->__pyx_v_gathers) { e = (*v)(p->__pyx_v_gathers, a); if (e) return e; } if (p->__pyx_v_genexpr) { e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; } if (p->__pyx_9genexpr85__pyx_v_k) { e = (*v)(p->__pyx_9genexpr85__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_lock) { e = (*v)(p->__pyx_v_lock, a); if (e) return e; } if (p->__pyx_v_missing_data) { e = (*v)(p->__pyx_v_missing_data, a); if (e) return e; } if (p->__pyx_v_n) { e = (*v)(p->__pyx_v_n, a); if (e) return e; } if (p->__pyx_v_n_missing) { e = (*v)(p->__pyx_v_n_missing, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_results) { e = (*v)(p->__pyx_v_results, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_9genexpr88__pyx_v_t) { e = (*v)(p->__pyx_9genexpr88__pyx_v_t, a); if (e) return e; } if (p->__pyx_9genexpr87__pyx_v_tasks) { e = (*v)(p->__pyx_9genexpr87__pyx_v_tasks, a); if (e) return e; } if (p->__pyx_v_tasks) { e = (*v)(p->__pyx_v_tasks, a); if (e) return e; } if (p->__pyx_9genexpr86__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_9genexpr86__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_9genexpr84__pyx_v_w) { e = (*v)(p->__pyx_9genexpr84__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_w) { e = (*v)(p->__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } if (p->__pyx_9genexpr87__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr87__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_9genexpr89__pyx_v_wws) { e = (*v)(((PyObject *)p->__pyx_9genexpr89__pyx_v_wws), a); if (e) return e; } if (p->__pyx_v_wws) { e = (*v)(((PyObject *)p->__pyx_v_wws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } if (p->__pyx_t_8) { e = (*v)(p->__pyx_t_8, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_40_replicate = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_40_replicate", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_40_replicate), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_40_replicate, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_40_replicate, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_40_replicate, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_41_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_41_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_41_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_41_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_41_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_41_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_41_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_w); Py_CLEAR(p->__pyx_v_who_has); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_41_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_41_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_41_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_41_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_w) { e = (*v)(p->__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_who_has) { e = (*v)(p->__pyx_v_who_has, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_41_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_41_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_41_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_41_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_41_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_41_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_group_bytes); Py_CLEAR(p->__pyx_v_groups); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *)o; if (p->__pyx_v_group_bytes) { e = (*v)(p->__pyx_v_group_bytes, a); if (e) return e; } if (p->__pyx_v_groups) { e = (*v)(p->__pyx_v_groups, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close(PyObject *o) { PyObject* tmp; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close *)o; tmp = ((PyObject*)p->__pyx_v_group_bytes); p->__pyx_v_group_bytes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_groups); p->__pyx_v_groups = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_42_workers_to_close", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close, /*tp_traverse*/ __pyx_tp_clear_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_43_retire_workers[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_43_retire_workers = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_43_retire_workers(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_43_retire_workers > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_43_retire_workers[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_43_retire_workers]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_43_retire_workers(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_close_workers); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_kwargs); Py_CLEAR(p->__pyx_v_lock); Py_CLEAR(p->__pyx_v_names); Py_CLEAR(p->__pyx_v_other_workers); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_remove); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_10genexpr102__pyx_v_ts); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_10genexpr100__pyx_v_w); Py_CLEAR(p->__pyx_10genexpr101__pyx_v_w); Py_CLEAR(p->__pyx_10genexpr105__pyx_v_w); Py_CLEAR(p->__pyx_10genexpr106__pyx_v_w); Py_CLEAR(p->__pyx_v_worker_keys); Py_CLEAR(p->__pyx_v_workers); Py_CLEAR(p->__pyx_10genexpr103__pyx_v_ws); Py_CLEAR(p->__pyx_10genexpr104__pyx_v_ws); Py_CLEAR(p->__pyx_9genexpr99__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_8); Py_CLEAR(p->__pyx_t_9); Py_CLEAR(p->__pyx_t_10); Py_CLEAR(p->__pyx_t_11); Py_CLEAR(p->__pyx_t_12); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_43_retire_workers < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_43_retire_workers[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_43_retire_workers++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_43_retire_workers(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers *)o; if (p->__pyx_v_close_workers) { e = (*v)(p->__pyx_v_close_workers, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_kwargs) { e = (*v)(p->__pyx_v_kwargs, a); if (e) return e; } if (p->__pyx_v_lock) { e = (*v)(p->__pyx_v_lock, a); if (e) return e; } if (p->__pyx_v_names) { e = (*v)(p->__pyx_v_names, a); if (e) return e; } if (p->__pyx_v_other_workers) { e = (*v)(p->__pyx_v_other_workers, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_remove) { e = (*v)(p->__pyx_v_remove, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_10genexpr102__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_10genexpr102__pyx_v_ts), a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_10genexpr100__pyx_v_w) { e = (*v)(p->__pyx_10genexpr100__pyx_v_w, a); if (e) return e; } if (p->__pyx_10genexpr101__pyx_v_w) { e = (*v)(p->__pyx_10genexpr101__pyx_v_w, a); if (e) return e; } if (p->__pyx_10genexpr105__pyx_v_w) { e = (*v)(p->__pyx_10genexpr105__pyx_v_w, a); if (e) return e; } if (p->__pyx_10genexpr106__pyx_v_w) { e = (*v)(p->__pyx_10genexpr106__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_worker_keys) { e = (*v)(p->__pyx_v_worker_keys, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } if (p->__pyx_10genexpr103__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_10genexpr103__pyx_v_ws), a); if (e) return e; } if (p->__pyx_10genexpr104__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_10genexpr104__pyx_v_ws), a); if (e) return e; } if (p->__pyx_9genexpr99__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_9genexpr99__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } if (p->__pyx_t_8) { e = (*v)(p->__pyx_t_8, a); if (e) return e; } if (p->__pyx_t_9) { e = (*v)(p->__pyx_t_9, a); if (e) return e; } if (p->__pyx_t_10) { e = (*v)(p->__pyx_t_10, a); if (e) return e; } if (p->__pyx_t_11) { e = (*v)(p->__pyx_t_11, a); if (e) return e; } if (p->__pyx_t_12) { e = (*v)(p->__pyx_t_12, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_43_retire_workers = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_43_retire_workers", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_43_retire_workers), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_43_retire_workers, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_43_retire_workers, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_43_retire_workers, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_44_feed[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_44_feed = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_44_feed(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_44_feed > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_44_feed[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_44_feed]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_44_feed(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_function); Py_CLEAR(p->__pyx_v_interval); Py_CLEAR(p->__pyx_v_kwargs); Py_CLEAR(p->__pyx_v_response); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_setup); Py_CLEAR(p->__pyx_v_state); Py_CLEAR(p->__pyx_v_teardown); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_44_feed < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_44_feed[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_44_feed++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_44_feed(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_function) { e = (*v)(p->__pyx_v_function, a); if (e) return e; } if (p->__pyx_v_interval) { e = (*v)(p->__pyx_v_interval, a); if (e) return e; } if (p->__pyx_v_kwargs) { e = (*v)(p->__pyx_v_kwargs, a); if (e) return e; } if (p->__pyx_v_response) { e = (*v)(p->__pyx_v_response, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_setup) { e = (*v)(p->__pyx_v_setup, a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(p->__pyx_v_state, a); if (e) return e; } if (p->__pyx_v_teardown) { e = (*v)(p->__pyx_v_teardown, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_44_feed = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_44_feed", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_44_feed), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_44_feed, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_44_feed, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_44_feed, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_10genexpr123__pyx_v_dts); Py_CLEAR(p->__pyx_v_dts); Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_v_key); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_processing); Py_CLEAR(p->__pyx_10genexpr126__pyx_v_r); Py_CLEAR(p->__pyx_v_response); Py_CLEAR(p->__pyx_v_results); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_stack); Py_CLEAR(p->__pyx_v_ts); Py_CLEAR(p->__pyx_10genexpr124__pyx_v_w); Py_CLEAR(p->__pyx_10genexpr126__pyx_v_w); Py_CLEAR(p->__pyx_v_workers); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_10genexpr123__pyx_v_dts) { e = (*v)(((PyObject *)p->__pyx_10genexpr123__pyx_v_dts), a); if (e) return e; } if (p->__pyx_v_dts) { e = (*v)(((PyObject *)p->__pyx_v_dts), a); if (e) return e; } if (p->__pyx_v_genexpr) { e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; } if (p->__pyx_v_key) { e = (*v)(p->__pyx_v_key, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_processing) { e = (*v)(p->__pyx_v_processing, a); if (e) return e; } if (p->__pyx_10genexpr126__pyx_v_r) { e = (*v)(p->__pyx_10genexpr126__pyx_v_r, a); if (e) return e; } if (p->__pyx_v_response) { e = (*v)(p->__pyx_v_response, a); if (e) return e; } if (p->__pyx_v_results) { e = (*v)(p->__pyx_v_results, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_stack) { e = (*v)(p->__pyx_v_stack, a); if (e) return e; } if (p->__pyx_v_ts) { e = (*v)(((PyObject *)p->__pyx_v_ts), a); if (e) return e; } if (p->__pyx_10genexpr124__pyx_v_w) { e = (*v)(p->__pyx_10genexpr124__pyx_v_w, a); if (e) return e; } if (p->__pyx_10genexpr126__pyx_v_w) { e = (*v)(p->__pyx_10genexpr126__pyx_v_w, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_45_get_call_stack", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_46_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_46_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_46_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_46_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_46_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_46_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_46_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_v_w); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_46_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_46_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_46_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_46_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_v_w) { e = (*v)(p->__pyx_v_w, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_46_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_46_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_46_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_46_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_46_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_46_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_name); Py_CLEAR(p->__pyx_v_plugin); Py_CLEAR(p->__pyx_v_responses); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_name) { e = (*v)(p->__pyx_v_name, a); if (e) return e; } if (p->__pyx_v_plugin) { e = (*v)(p->__pyx_v_plugin, a); if (e) return e; } if (p->__pyx_v_responses) { e = (*v)(p->__pyx_v_responses, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_47_register_worker_plugin", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_48_get_profile[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_48_get_profile = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_48_get_profile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_48_get_profile > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_48_get_profile[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_48_get_profile]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_48_get_profile(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_v_key); Py_CLEAR(p->__pyx_v_merge_workers); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_10genexpr136__pyx_v_r); Py_CLEAR(p->__pyx_v_response); Py_CLEAR(p->__pyx_v_results); Py_CLEAR(p->__pyx_v_scheduler); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_server); Py_CLEAR(p->__pyx_v_start); Py_CLEAR(p->__pyx_v_stop); Py_CLEAR(p->__pyx_v_workers); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_48_get_profile < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_48_get_profile[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_48_get_profile++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_48_get_profile(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_genexpr) { e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; } if (p->__pyx_v_key) { e = (*v)(p->__pyx_v_key, a); if (e) return e; } if (p->__pyx_v_merge_workers) { e = (*v)(p->__pyx_v_merge_workers, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_10genexpr136__pyx_v_r) { e = (*v)(p->__pyx_10genexpr136__pyx_v_r, a); if (e) return e; } if (p->__pyx_v_response) { e = (*v)(p->__pyx_v_response, a); if (e) return e; } if (p->__pyx_v_results) { e = (*v)(p->__pyx_v_results, a); if (e) return e; } if (p->__pyx_v_scheduler) { e = (*v)(p->__pyx_v_scheduler, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_server) { e = (*v)(p->__pyx_v_server, a); if (e) return e; } if (p->__pyx_v_start) { e = (*v)(p->__pyx_v_start, a); if (e) return e; } if (p->__pyx_v_stop) { e = (*v)(p->__pyx_v_stop, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_48_get_profile = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_48_get_profile", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_48_get_profile), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_48_get_profile, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_48_get_profile, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_48_get_profile, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_49_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_49_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_49_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_49_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_49_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_49_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_49_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_w); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_49_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_49_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_49_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_49_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_w) { e = (*v)(p->__pyx_v_w, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_49_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_49_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_49_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_49_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_49_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_49_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_counts); Py_CLEAR(p->__pyx_v_d); Py_CLEAR(p->__pyx_v_dt); Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_10genexpr140__pyx_v_group); Py_CLEAR(p->__pyx_v_groups1); Py_CLEAR(p->__pyx_v_groups2); Py_CLEAR(p->__pyx_10genexpr141__pyx_v_k); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_keys); Py_CLEAR(p->__pyx_v_last); Py_CLEAR(p->__pyx_v_merge_workers); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_profile_cycle_interval); Py_CLEAR(p->__pyx_10genexpr138__pyx_v_r); Py_CLEAR(p->__pyx_v_results); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_start); Py_CLEAR(p->__pyx_v_stop); Py_CLEAR(p->__pyx_v_t); Py_CLEAR(p->__pyx_10genexpr140__pyx_v_time); Py_CLEAR(p->__pyx_v_tt); Py_CLEAR(p->__pyx_10genexpr139__pyx_v_v); Py_CLEAR(p->__pyx_10genexpr142__pyx_v_v); Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_v_workers); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_counts) { e = (*v)(p->__pyx_v_counts, a); if (e) return e; } if (p->__pyx_v_d) { e = (*v)(p->__pyx_v_d, a); if (e) return e; } if (p->__pyx_v_dt) { e = (*v)(p->__pyx_v_dt, a); if (e) return e; } if (p->__pyx_v_genexpr) { e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; } if (p->__pyx_10genexpr140__pyx_v_group) { e = (*v)(p->__pyx_10genexpr140__pyx_v_group, a); if (e) return e; } if (p->__pyx_v_groups1) { e = (*v)(p->__pyx_v_groups1, a); if (e) return e; } if (p->__pyx_v_groups2) { e = (*v)(p->__pyx_v_groups2, a); if (e) return e; } if (p->__pyx_10genexpr141__pyx_v_k) { e = (*v)(p->__pyx_10genexpr141__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_keys) { e = (*v)(p->__pyx_v_keys, a); if (e) return e; } if (p->__pyx_v_last) { e = (*v)(p->__pyx_v_last, a); if (e) return e; } if (p->__pyx_v_merge_workers) { e = (*v)(p->__pyx_v_merge_workers, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_profile_cycle_interval) { e = (*v)(p->__pyx_v_profile_cycle_interval, a); if (e) return e; } if (p->__pyx_10genexpr138__pyx_v_r) { e = (*v)(p->__pyx_10genexpr138__pyx_v_r, a); if (e) return e; } if (p->__pyx_v_results) { e = (*v)(p->__pyx_v_results, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_start) { e = (*v)(p->__pyx_v_start, a); if (e) return e; } if (p->__pyx_v_stop) { e = (*v)(p->__pyx_v_stop, a); if (e) return e; } if (p->__pyx_v_t) { e = (*v)(p->__pyx_v_t, a); if (e) return e; } if (p->__pyx_10genexpr140__pyx_v_time) { e = (*v)(p->__pyx_10genexpr140__pyx_v_time, a); if (e) return e; } if (p->__pyx_v_tt) { e = (*v)(p->__pyx_v_tt, a); if (e) return e; } if (p->__pyx_10genexpr139__pyx_v_v) { e = (*v)(p->__pyx_10genexpr139__pyx_v_v, a); if (e) return e; } if (p->__pyx_10genexpr142__pyx_v_v) { e = (*v)(p->__pyx_10genexpr142__pyx_v_v, a); if (e) return e; } if (p->__pyx_v_v) { e = (*v)(p->__pyx_v_v, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_50_get_profile_metadata", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_51_genexpr[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_51_genexpr = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_51_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_51_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_51_genexpr[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_51_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_51_genexpr(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_w); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_51_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_51_genexpr[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_51_genexpr++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_51_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_w) { e = (*v)(p->__pyx_v_w, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_51_genexpr = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_51_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_51_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_51_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_51_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_51_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_52_performance_report[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_52_performance_report = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_52_performance_report(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_52_performance_report > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_52_performance_report[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_52_performance_report]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_52_performance_report(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_BandwidthTypes); Py_CLEAR(p->__pyx_v_BandwidthWorkers); Py_CLEAR(p->__pyx_v_Div); Py_CLEAR(p->__pyx_v_Panel); Py_CLEAR(p->__pyx_v_Tabs); Py_CLEAR(p->__pyx_v_bandwidth_types); Py_CLEAR(p->__pyx_v_bandwidth_workers); Py_CLEAR(p->__pyx_v_code); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_compute); Py_CLEAR(p->__pyx_v_d); Py_CLEAR(p->__pyx_v_data); Py_CLEAR(p->__pyx_v_distributed); Py_CLEAR(p->__pyx_v_f); Py_CLEAR(p->__pyx_v_fn); Py_CLEAR(p->__pyx_v_get_env); Py_CLEAR(p->__pyx_v_html); Py_CLEAR(p->__pyx_v_k); Py_CLEAR(p->__pyx_v_output_file); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_profile); Py_CLEAR(p->__pyx_v_profile_to_figure); Py_CLEAR(p->__pyx_v_rectangles); Py_CLEAR(p->__pyx_v_rects); Py_CLEAR(p->__pyx_v_save); Py_CLEAR(p->__pyx_v_scheduler); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_source); Py_CLEAR(p->__pyx_v_start); Py_CLEAR(p->__pyx_v_stop); Py_CLEAR(p->__pyx_v_tabs); Py_CLEAR(p->__pyx_v_task_stream); Py_CLEAR(p->__pyx_v_task_stream_figure); Py_CLEAR(p->__pyx_v_tasks_timings); Py_CLEAR(p->__pyx_v_template); Py_CLEAR(p->__pyx_v_template_directory); Py_CLEAR(p->__pyx_v_template_environment); Py_CLEAR(p->__pyx_v_timespent); Py_CLEAR(p->__pyx_v_workers); Py_CLEAR(p->__pyx_10genexpr143__pyx_v_ws); Py_CLEAR(p->__pyx_10genexpr144__pyx_v_ws); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_v_x); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_52_performance_report < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_52_performance_report[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_52_performance_report++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_52_performance_report(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report *)o; if (p->__pyx_v_BandwidthTypes) { e = (*v)(p->__pyx_v_BandwidthTypes, a); if (e) return e; } if (p->__pyx_v_BandwidthWorkers) { e = (*v)(p->__pyx_v_BandwidthWorkers, a); if (e) return e; } if (p->__pyx_v_Div) { e = (*v)(p->__pyx_v_Div, a); if (e) return e; } if (p->__pyx_v_Panel) { e = (*v)(p->__pyx_v_Panel, a); if (e) return e; } if (p->__pyx_v_Tabs) { e = (*v)(p->__pyx_v_Tabs, a); if (e) return e; } if (p->__pyx_v_bandwidth_types) { e = (*v)(p->__pyx_v_bandwidth_types, a); if (e) return e; } if (p->__pyx_v_bandwidth_workers) { e = (*v)(p->__pyx_v_bandwidth_workers, a); if (e) return e; } if (p->__pyx_v_code) { e = (*v)(p->__pyx_v_code, a); if (e) return e; } if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_compute) { e = (*v)(p->__pyx_v_compute, a); if (e) return e; } if (p->__pyx_v_d) { e = (*v)(p->__pyx_v_d, a); if (e) return e; } if (p->__pyx_v_data) { e = (*v)(p->__pyx_v_data, a); if (e) return e; } if (p->__pyx_v_distributed) { e = (*v)(p->__pyx_v_distributed, a); if (e) return e; } if (p->__pyx_v_f) { e = (*v)(p->__pyx_v_f, a); if (e) return e; } if (p->__pyx_v_fn) { e = (*v)(p->__pyx_v_fn, a); if (e) return e; } if (p->__pyx_v_get_env) { e = (*v)(p->__pyx_v_get_env, a); if (e) return e; } if (p->__pyx_v_html) { e = (*v)(p->__pyx_v_html, a); if (e) return e; } if (p->__pyx_v_k) { e = (*v)(p->__pyx_v_k, a); if (e) return e; } if (p->__pyx_v_output_file) { e = (*v)(p->__pyx_v_output_file, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_profile) { e = (*v)(p->__pyx_v_profile, a); if (e) return e; } if (p->__pyx_v_profile_to_figure) { e = (*v)(p->__pyx_v_profile_to_figure, a); if (e) return e; } if (p->__pyx_v_rectangles) { e = (*v)(p->__pyx_v_rectangles, a); if (e) return e; } if (p->__pyx_v_rects) { e = (*v)(p->__pyx_v_rects, a); if (e) return e; } if (p->__pyx_v_save) { e = (*v)(p->__pyx_v_save, a); if (e) return e; } if (p->__pyx_v_scheduler) { e = (*v)(p->__pyx_v_scheduler, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_source) { e = (*v)(p->__pyx_v_source, a); if (e) return e; } if (p->__pyx_v_start) { e = (*v)(p->__pyx_v_start, a); if (e) return e; } if (p->__pyx_v_stop) { e = (*v)(p->__pyx_v_stop, a); if (e) return e; } if (p->__pyx_v_tabs) { e = (*v)(p->__pyx_v_tabs, a); if (e) return e; } if (p->__pyx_v_task_stream) { e = (*v)(p->__pyx_v_task_stream, a); if (e) return e; } if (p->__pyx_v_task_stream_figure) { e = (*v)(p->__pyx_v_task_stream_figure, a); if (e) return e; } if (p->__pyx_v_template) { e = (*v)(p->__pyx_v_template, a); if (e) return e; } if (p->__pyx_v_template_directory) { e = (*v)(p->__pyx_v_template_directory, a); if (e) return e; } if (p->__pyx_v_template_environment) { e = (*v)(p->__pyx_v_template_environment, a); if (e) return e; } if (p->__pyx_v_timespent) { e = (*v)(p->__pyx_v_timespent, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } if (p->__pyx_10genexpr143__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_10genexpr143__pyx_v_ws), a); if (e) return e; } if (p->__pyx_10genexpr144__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_10genexpr144__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_v_x) { e = (*v)(p->__pyx_v_x, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_52_performance_report = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_52_performance_report", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_52_performance_report), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_52_performance_report, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_52_performance_report, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_52_performance_report, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_comm); Py_CLEAR(p->__pyx_v_n); Py_CLEAR(p->__pyx_v_nanny); Py_CLEAR(p->__pyx_v_results); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_workers); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs *)o; if (p->__pyx_v_comm) { e = (*v)(p->__pyx_v_comm, a); if (e) return e; } if (p->__pyx_v_n) { e = (*v)(p->__pyx_v_n, a); if (e) return e; } if (p->__pyx_v_nanny) { e = (*v)(p->__pyx_v_nanny, a); if (e) return e; } if (p->__pyx_v_results) { e = (*v)(p->__pyx_v_results, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_workers) { e = (*v)(p->__pyx_v_workers, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_53_get_worker_logs", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl[8]; static int __pyx_freecount_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl = 0; static PyObject *__pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl)))) { o = (PyObject*)__pyx_freelist_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl[--__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl]; memset(o, 0, sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl(PyObject *o) { struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_now); Py_CLEAR(p->__pyx_v_parent); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_ws); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl)))) { __pyx_freelist_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl[__pyx_freecount_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl++] = ((struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *p = (struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl *)o; if (p->__pyx_v_now) { e = (*v)(p->__pyx_v_now, a); if (e) return e; } if (p->__pyx_v_parent) { e = (*v)(((PyObject *)p->__pyx_v_parent), a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_ws) { e = (*v)(((PyObject *)p->__pyx_v_ws), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl = { PyVarObject_HEAD_INIT(0, 0) "distributed.scheduler.__pyx_scope_struct_54_check_worker_ttl", /*tp_name*/ sizeof(struct __pyx_obj_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_scheduler(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_scheduler}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "scheduler", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_0_0_0_0, __pyx_k_0_0_0_0, sizeof(__pyx_k_0_0_0_0), 0, 1, 0, 0}, {&__pyx_kp_u_11s_at_25s, __pyx_k_11s_at_25s, sizeof(__pyx_k_11s_at_25s), 0, 1, 0, 0}, {&__pyx_kp_u_1s, __pyx_k_1s, sizeof(__pyx_k_1s), 0, 1, 0, 0}, {&__pyx_kp_u_2ms, __pyx_k_2ms, sizeof(__pyx_k_2ms), 0, 1, 0, 0}, {&__pyx_kp_u_500ms, __pyx_k_500ms, sizeof(__pyx_k_500ms), 0, 1, 0, 0}, {&__pyx_kp_u_5ms, __pyx_k_5ms, sizeof(__pyx_k_5ms), 0, 1, 0, 0}, {&__pyx_kp_u_60s, __pyx_k_60s, sizeof(__pyx_k_60s), 0, 1, 0, 0}, {&__pyx_n_u_ALL_TASK_STATES, __pyx_k_ALL_TASK_STATES, sizeof(__pyx_k_ALL_TASK_STATES), 0, 1, 0, 1}, {&__pyx_kp_s_A_mapping_interface_mimicking_t, __pyx_k_A_mapping_interface_mimicking_t, sizeof(__pyx_k_A_mapping_interface_mimicking_t), 0, 0, 1, 0}, {&__pyx_n_s_All, __pyx_k_All, sizeof(__pyx_k_All), 0, 0, 1, 1}, {&__pyx_kp_s_An_plugin_to_share_worker_statu, __pyx_k_An_plugin_to_share_worker_statu, sizeof(__pyx_k_An_plugin_to_share_worker_statu), 0, 0, 1, 0}, {&__pyx_kp_u_Attempting_to_reschedule_task_wh, __pyx_k_Attempting_to_reschedule_task_wh, sizeof(__pyx_k_Attempting_to_reschedule_task_wh), 0, 1, 0, 0}, {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_n_s_BandwidthTypes, __pyx_k_BandwidthTypes, sizeof(__pyx_k_BandwidthTypes), 0, 0, 1, 1}, {&__pyx_n_s_BandwidthWorkers, __pyx_k_BandwidthWorkers, sizeof(__pyx_k_BandwidthWorkers), 0, 0, 1, 1}, {&__pyx_kp_u_Bandwidth_Types, __pyx_k_Bandwidth_Types, sizeof(__pyx_k_Bandwidth_Types), 0, 1, 0, 0}, {&__pyx_kp_u_Bandwidth_Workers, __pyx_k_Bandwidth_Workers, sizeof(__pyx_k_Bandwidth_Workers), 0, 1, 0, 0}, {&__pyx_n_s_BatchedSend, __pyx_k_BatchedSend, sizeof(__pyx_k_BatchedSend), 0, 0, 1, 1}, {&__pyx_kp_u_Can_not_use_replicate_to_delete, __pyx_k_Can_not_use_replicate_to_delete, sizeof(__pyx_k_Can_not_use_replicate_to_delete), 0, 1, 0, 0}, {&__pyx_kp_u_Clear_task_state, __pyx_k_Clear_task_state, sizeof(__pyx_k_Clear_task_state), 0, 1, 0, 0}, {&__pyx_n_s_ClientState, __pyx_k_ClientState, sizeof(__pyx_k_ClientState), 0, 0, 1, 1}, {&__pyx_kp_u_Client_s, __pyx_k_Client_s, sizeof(__pyx_k_Client_s), 0, 1, 0, 0}, {&__pyx_kp_u_Client_s_releases_keys_s, __pyx_k_Client_s_releases_keys_s, sizeof(__pyx_k_Client_s_releases_keys_s), 0, 1, 0, 0}, {&__pyx_kp_u_Client_s_requests_to_cancel_d_ke, __pyx_k_Client_s_requests_to_cancel_d_ke, sizeof(__pyx_k_Client_s_requests_to_cancel_d_ke), 0, 1, 0, 0}, {&__pyx_kp_u_Client_s_requests_to_retry_d_key, __pyx_k_Client_s_requests_to_retry_d_key, sizeof(__pyx_k_Client_s_requests_to_retry_d_key), 0, 1, 0, 0}, {&__pyx_kp_u_Close_client_connection_s, __pyx_k_Close_client_connection_s, sizeof(__pyx_k_Close_client_connection_s), 0, 1, 0, 0}, {&__pyx_kp_u_Closing_worker_s, __pyx_k_Closing_worker_s, sizeof(__pyx_k_Closing_worker_s), 0, 1, 0, 0}, {&__pyx_n_s_CollectTaskMetaDataPlugin, __pyx_k_CollectTaskMetaDataPlugin, sizeof(__pyx_k_CollectTaskMetaDataPlugin), 0, 0, 1, 1}, {&__pyx_n_s_CollectTaskMetaDataPlugin___init, __pyx_k_CollectTaskMetaDataPlugin___init, sizeof(__pyx_k_CollectTaskMetaDataPlugin___init), 0, 0, 1, 1}, {&__pyx_n_s_CollectTaskMetaDataPlugin_transi, __pyx_k_CollectTaskMetaDataPlugin_transi, sizeof(__pyx_k_CollectTaskMetaDataPlugin_transi), 0, 0, 1, 1}, {&__pyx_n_s_CollectTaskMetaDataPlugin_update, __pyx_k_CollectTaskMetaDataPlugin_update, sizeof(__pyx_k_CollectTaskMetaDataPlugin_update), 0, 0, 1, 1}, {&__pyx_n_s_CommClosedError, __pyx_k_CommClosedError, sizeof(__pyx_k_CommClosedError), 0, 0, 1, 1}, {&__pyx_kp_u_Communication_failed_during_repl, __pyx_k_Communication_failed_during_repl, sizeof(__pyx_k_Communication_failed_during_repl), 0, 1, 0, 0}, {&__pyx_kp_u_Couldn_t_gather_keys_s_state_s_w, __pyx_k_Couldn_t_gather_keys_s_state_s_w, sizeof(__pyx_k_Couldn_t_gather_keys_s_state_s_w), 0, 1, 0, 0}, {&__pyx_n_s_DEFAULT_EXTENSIONS, __pyx_k_DEFAULT_EXTENSIONS, sizeof(__pyx_k_DEFAULT_EXTENSIONS), 0, 0, 1, 1}, {&__pyx_kp_u_Dask_Performance_Report, __pyx_k_Dask_Performance_Report, sizeof(__pyx_k_Dask_Performance_Report), 0, 1, 0, 0}, {&__pyx_n_s_Div, __pyx_k_Div, sizeof(__pyx_k_Div), 0, 0, 1, 1}, {&__pyx_kp_s_Dynamic_distributed_task_schedul, __pyx_k_Dynamic_distributed_task_schedul, sizeof(__pyx_k_Dynamic_distributed_task_schedul), 0, 0, 1, 0}, {&__pyx_n_s_EnvironmentError, __pyx_k_EnvironmentError, sizeof(__pyx_k_EnvironmentError), 0, 0, 1, 1}, {&__pyx_kp_u_Error_in_reevaluate_occupancy, __pyx_k_Error_in_reevaluate_occupancy, sizeof(__pyx_k_Error_in_reevaluate_occupancy), 0, 1, 0, 0}, {&__pyx_kp_u_Error_transitioning_r_from_r_to, __pyx_k_Error_transitioning_r_from_r_to, sizeof(__pyx_k_Error_transitioning_r_from_r_to), 0, 1, 0, 0}, {&__pyx_n_s_EventExtension, __pyx_k_EventExtension, sizeof(__pyx_k_EventExtension), 0, 0, 1, 1}, {&__pyx_kp_u_Exception_while_restarting_This, __pyx_k_Exception_while_restarting_This, sizeof(__pyx_k_Exception_while_restarting_This), 0, 1, 0, 0}, {&__pyx_kp_u_Expected_to_find_exactly_one_Col, __pyx_k_Expected_to_find_exactly_one_Col, sizeof(__pyx_k_Expected_to_find_exactly_one_Col), 0, 1, 0, 0}, {&__pyx_kp_u_Find_workers_that_we_can_close, __pyx_k_Find_workers_that_we_can_close, sizeof(__pyx_k_Find_workers_that_we_can_close), 0, 1, 0, 0}, {&__pyx_kp_u_Finished_handling_client_s, __pyx_k_Finished_handling_client_s, sizeof(__pyx_k_Finished_handling_client_s), 0, 1, 0, 0}, {&__pyx_n_s_IOLoop, __pyx_k_IOLoop, sizeof(__pyx_k_IOLoop), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Impossible_transition_from_r_to, __pyx_k_Impossible_transition_from_r_to, sizeof(__pyx_k_Impossible_transition_from_r_to), 0, 1, 0, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x38, __pyx_k_Incompatible_checksums_s_vs_0x38, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x38), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x3d, __pyx_k_Incompatible_checksums_s_vs_0x3d, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x3d), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x69, __pyx_k_Incompatible_checksums_s_vs_0x69, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x69), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x81, __pyx_k_Incompatible_checksums_s_vs_0x81, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x81), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x9b, __pyx_k_Incompatible_checksums_s_vs_0x9b, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x9b), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0xeb, __pyx_k_Incompatible_checksums_s_vs_0xeb, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xeb), 0, 0, 1, 0}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_kp_u_Key_lost_s, __pyx_k_Key_lost_s, sizeof(__pyx_k_Key_lost_s), 0, 1, 0, 0}, {&__pyx_n_s_KilledWorker, __pyx_k_KilledWorker, sizeof(__pyx_k_KilledWorker), 0, 0, 1, 1}, {&__pyx_n_s_KilledWorker___init, __pyx_k_KilledWorker___init, sizeof(__pyx_k_KilledWorker___init), 0, 0, 1, 1}, {&__pyx_n_s_LOG_PDB, __pyx_k_LOG_PDB, sizeof(__pyx_k_LOG_PDB), 0, 0, 1, 1}, {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1}, {&__pyx_n_s_LockExtension, __pyx_k_LockExtension, sizeof(__pyx_k_LockExtension), 0, 0, 1, 1}, {&__pyx_kp_u_Lost_all_workers, __pyx_k_Lost_all_workers, sizeof(__pyx_k_Lost_all_workers), 0, 1, 0, 0}, {&__pyx_n_s_Mapping, __pyx_k_Mapping, sizeof(__pyx_k_Mapping), 0, 0, 1, 1}, {&__pyx_kp_u_Moving_d_keys_to_other_workers, __pyx_k_Moving_d_keys_to_other_workers, sizeof(__pyx_k_Moving_d_keys_to_other_workers), 0, 1, 0, 0}, {&__pyx_kp_u_Nannies_didn_t_report_back_resta, __pyx_k_Nannies_didn_t_report_back_resta, sizeof(__pyx_k_Nannies_didn_t_report_back_resta), 0, 1, 0, 0}, {&__pyx_kp_u_No_workers_found, __pyx_k_No_workers_found, sizeof(__pyx_k_No_workers_found), 0, 1, 0, 0}, {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0}, {&__pyx_kp_u_Not_all_workers_responded_positi, __pyx_k_Not_all_workers_responded_positi, sizeof(__pyx_k_Not_all_workers_responded_positi), 0, 1, 0, 0}, {&__pyx_n_s_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 0, 1, 1}, {&__pyx_n_u_OK, __pyx_k_OK, sizeof(__pyx_k_OK), 0, 1, 0, 1}, {&__pyx_n_s_OptionalStateLegacyMapping, __pyx_k_OptionalStateLegacyMapping, sizeof(__pyx_k_OptionalStateLegacyMapping), 0, 0, 1, 1}, {&__pyx_n_s_OptionalStateLegacyMapping___ge, __pyx_k_OptionalStateLegacyMapping___ge, sizeof(__pyx_k_OptionalStateLegacyMapping___ge), 0, 0, 1, 1}, {&__pyx_n_s_OptionalStateLegacyMapping___it, __pyx_k_OptionalStateLegacyMapping___it, sizeof(__pyx_k_OptionalStateLegacyMapping___it), 0, 0, 1, 1}, {&__pyx_n_s_OptionalStateLegacyMapping___le, __pyx_k_OptionalStateLegacyMapping___le, sizeof(__pyx_k_OptionalStateLegacyMapping___le), 0, 0, 1, 1}, {&__pyx_n_s_OptionalStateLegacyMapping___le_2, __pyx_k_OptionalStateLegacyMapping___le_2, sizeof(__pyx_k_OptionalStateLegacyMapping___le_2), 0, 0, 1, 1}, {&__pyx_n_s_Panel, __pyx_k_Panel, sizeof(__pyx_k_Panel), 0, 0, 1, 1}, {&__pyx_n_s_PeriodicCallback, __pyx_k_PeriodicCallback, sizeof(__pyx_k_PeriodicCallback), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_u_Plugin_failed_with_exception, __pyx_k_Plugin_failed_with_exception, sizeof(__pyx_k_Plugin_failed_with_exception), 0, 1, 0, 0}, {&__pyx_n_s_Process, __pyx_k_Process, sizeof(__pyx_k_Process), 0, 0, 1, 1}, {&__pyx_n_s_PubSubSchedulerExtension, __pyx_k_PubSubSchedulerExtension, sizeof(__pyx_k_PubSubSchedulerExtension), 0, 0, 1, 1}, {&__pyx_n_s_PublishExtension, __pyx_k_PublishExtension, sizeof(__pyx_k_PublishExtension), 0, 0, 1, 1}, {&__pyx_n_s_Py_hash_t, __pyx_k_Py_hash_t, sizeof(__pyx_k_Py_hash_t), 0, 0, 1, 1}, {&__pyx_n_s_Py_ssize_t, __pyx_k_Py_ssize_t, sizeof(__pyx_k_Py_ssize_t), 0, 0, 1, 1}, {&__pyx_n_u_Py_ssize_t, __pyx_k_Py_ssize_t, sizeof(__pyx_k_Py_ssize_t), 0, 1, 0, 1}, {&__pyx_n_s_QueueExtension, __pyx_k_QueueExtension, sizeof(__pyx_k_QueueExtension), 0, 0, 1, 1}, {&__pyx_kp_u_Receive_client_connection_s, __pyx_k_Receive_client_connection_s, sizeof(__pyx_k_Receive_client_connection_s), 0, 1, 0, 0}, {&__pyx_kp_u_Received_already_computed_task_w, __pyx_k_Received_already_computed_task_w, sizeof(__pyx_k_Received_already_computed_task_w), 0, 1, 0, 0}, {&__pyx_kp_u_Received_long_running_signal_fro, __pyx_k_Received_long_running_signal_fro, sizeof(__pyx_k_Received_long_running_signal_fro), 0, 1, 0, 0}, {&__pyx_kp_u_Register_worker_s, __pyx_k_Register_worker_s, sizeof(__pyx_k_Register_worker_s), 0, 1, 0, 0}, {&__pyx_kp_u_Remove_client_s, __pyx_k_Remove_client_s, sizeof(__pyx_k_Remove_client_s), 0, 1, 0, 0}, {&__pyx_kp_u_Remove_worker_s, __pyx_k_Remove_worker_s, sizeof(__pyx_k_Remove_worker_s), 0, 1, 0, 0}, {&__pyx_kp_u_Removed_worker_s, __pyx_k_Removed_worker_s, sizeof(__pyx_k_Removed_worker_s), 0, 1, 0, 0}, {&__pyx_n_s_ReplayExceptionScheduler, __pyx_k_ReplayExceptionScheduler, sizeof(__pyx_k_ReplayExceptionScheduler), 0, 0, 1, 1}, {&__pyx_kp_u_Retire_worker_names_s, __pyx_k_Retire_worker_names_s, sizeof(__pyx_k_Retire_worker_names_s), 0, 1, 0, 0}, {&__pyx_kp_u_Retire_workers_s, __pyx_k_Retire_workers_s, sizeof(__pyx_k_Retire_workers_s), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler, __pyx_k_Scheduler, sizeof(__pyx_k_Scheduler), 0, 0, 1, 1}, {&__pyx_n_s_SchedulerPlugin, __pyx_k_SchedulerPlugin, sizeof(__pyx_k_SchedulerPlugin), 0, 0, 1, 1}, {&__pyx_n_s_SchedulerState, __pyx_k_SchedulerState, sizeof(__pyx_k_SchedulerState), 0, 0, 1, 1}, {&__pyx_kp_u_Scheduler_2, __pyx_k_Scheduler_2, sizeof(__pyx_k_Scheduler_2), 0, 1, 0, 0}, {&__pyx_kp_u_Scheduler_Broadcast, __pyx_k_Scheduler_Broadcast, sizeof(__pyx_k_Scheduler_Broadcast), 0, 1, 0, 0}, {&__pyx_kp_u_Scheduler_Client, __pyx_k_Scheduler_Client, sizeof(__pyx_k_Scheduler_Client), 0, 1, 0, 0}, {&__pyx_kp_u_Scheduler_Profile_administrative, __pyx_k_Scheduler_Profile_administrative, sizeof(__pyx_k_Scheduler_Profile_administrative), 0, 1, 0, 0}, {&__pyx_n_s_Scheduler___init, __pyx_k_Scheduler___init, sizeof(__pyx_k_Scheduler___init), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler___init___locals_lambda, __pyx_k_Scheduler___init___locals_lambda, sizeof(__pyx_k_Scheduler___init___locals_lambda), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler___repr, __pyx_k_Scheduler___repr, sizeof(__pyx_k_Scheduler___repr), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler__delete_worker_data, __pyx_k_Scheduler__delete_worker_data, sizeof(__pyx_k_Scheduler__delete_worker_data), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler__transition, __pyx_k_Scheduler__transition, sizeof(__pyx_k_Scheduler__transition), 0, 0, 1, 1}, {&__pyx_kp_u_Scheduler__transition_line_5845, __pyx_k_Scheduler__transition_line_5845, sizeof(__pyx_k_Scheduler__transition_line_5845), 0, 1, 0, 0}, {&__pyx_n_s_Scheduler_adaptive_target, __pyx_k_Scheduler_adaptive_target, sizeof(__pyx_k_Scheduler_adaptive_target), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_add_client, __pyx_k_Scheduler_add_client, sizeof(__pyx_k_Scheduler_add_client), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_add_keys, __pyx_k_Scheduler_add_keys, sizeof(__pyx_k_Scheduler_add_keys), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_add_plugin, __pyx_k_Scheduler_add_plugin, sizeof(__pyx_k_Scheduler_add_plugin), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_add_plugin_locals_gene, __pyx_k_Scheduler_add_plugin_locals_gene, sizeof(__pyx_k_Scheduler_add_plugin_locals_gene), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_add_resources, __pyx_k_Scheduler_add_resources, sizeof(__pyx_k_Scheduler_add_resources), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_add_worker, __pyx_k_Scheduler_add_worker, sizeof(__pyx_k_Scheduler_add_worker), 0, 0, 1, 1}, {&__pyx_kp_u_Scheduler_at_25s, __pyx_k_Scheduler_at_25s, sizeof(__pyx_k_Scheduler_at_25s), 0, 1, 0, 0}, {&__pyx_n_s_Scheduler_broadcast, __pyx_k_Scheduler_broadcast, sizeof(__pyx_k_Scheduler_broadcast), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_broadcast_locals_send, __pyx_k_Scheduler_broadcast_locals_send, sizeof(__pyx_k_Scheduler_broadcast_locals_send), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_cancel_key, __pyx_k_Scheduler_cancel_key, sizeof(__pyx_k_Scheduler_cancel_key), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_cancel_key_locals_lamb, __pyx_k_Scheduler_cancel_key_locals_lamb, sizeof(__pyx_k_Scheduler_cancel_key_locals_lamb), 0, 0, 1, 1}, {&__pyx_kp_u_Scheduler_cancels_key_s_Force_s, __pyx_k_Scheduler_cancels_key_s_Force_s, sizeof(__pyx_k_Scheduler_cancels_key_s_Force_s), 0, 1, 0, 0}, {&__pyx_n_s_Scheduler_check_idle, __pyx_k_Scheduler_check_idle, sizeof(__pyx_k_Scheduler_check_idle), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_check_worker_ttl, __pyx_k_Scheduler_check_worker_ttl, sizeof(__pyx_k_Scheduler_check_worker_ttl), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_clear_task_state, __pyx_k_Scheduler_clear_task_state, sizeof(__pyx_k_Scheduler_clear_task_state), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_client_desires_keys, __pyx_k_Scheduler_client_desires_keys, sizeof(__pyx_k_Scheduler_client_desires_keys), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_client_heartbeat, __pyx_k_Scheduler_client_heartbeat, sizeof(__pyx_k_Scheduler_client_heartbeat), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_client_releases_keys, __pyx_k_Scheduler_client_releases_keys, sizeof(__pyx_k_Scheduler_client_releases_keys), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_client_send, __pyx_k_Scheduler_client_send, sizeof(__pyx_k_Scheduler_client_send), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_close, __pyx_k_Scheduler_close, sizeof(__pyx_k_Scheduler_close), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_close_worker, __pyx_k_Scheduler_close_worker, sizeof(__pyx_k_Scheduler_close_worker), 0, 0, 1, 1}, {&__pyx_kp_u_Scheduler_closing, __pyx_k_Scheduler_closing, sizeof(__pyx_k_Scheduler_closing), 0, 1, 0, 0}, {&__pyx_kp_u_Scheduler_closing_after_being_id, __pyx_k_Scheduler_closing_after_being_id, sizeof(__pyx_k_Scheduler_closing_after_being_id), 0, 1, 0, 0}, {&__pyx_kp_u_Scheduler_closing_all_comms, __pyx_k_Scheduler_closing_all_comms, sizeof(__pyx_k_Scheduler_closing_all_comms), 0, 1, 0, 0}, {&__pyx_n_s_Scheduler_coerce_address, __pyx_k_Scheduler_coerce_address, sizeof(__pyx_k_Scheduler_coerce_address), 0, 0, 1, 1}, {&__pyx_kp_u_Scheduler_connection_to_worker, __pyx_k_Scheduler_connection_to_worker, sizeof(__pyx_k_Scheduler_connection_to_worker), 0, 1, 0, 0}, {&__pyx_n_s_Scheduler_feed, __pyx_k_Scheduler_feed, sizeof(__pyx_k_Scheduler_feed), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_gather, __pyx_k_Scheduler_gather, sizeof(__pyx_k_Scheduler_gather), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_call_stack, __pyx_k_Scheduler_get_call_stack, sizeof(__pyx_k_Scheduler_get_call_stack), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_call_stack_locals, __pyx_k_Scheduler_get_call_stack_locals, sizeof(__pyx_k_Scheduler_get_call_stack_locals), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_events, __pyx_k_Scheduler_get_events, sizeof(__pyx_k_Scheduler_get_events), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_has_what, __pyx_k_Scheduler_get_has_what, sizeof(__pyx_k_Scheduler_get_has_what), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_metadata, __pyx_k_Scheduler_get_metadata, sizeof(__pyx_k_Scheduler_get_metadata), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_nbytes, __pyx_k_Scheduler_get_nbytes, sizeof(__pyx_k_Scheduler_get_nbytes), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_nbytes_locals_lamb, __pyx_k_Scheduler_get_nbytes_locals_lamb, sizeof(__pyx_k_Scheduler_get_nbytes_locals_lamb), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_ncores, __pyx_k_Scheduler_get_ncores, sizeof(__pyx_k_Scheduler_get_ncores), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_processing, __pyx_k_Scheduler_get_processing, sizeof(__pyx_k_Scheduler_get_processing), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_profile, __pyx_k_Scheduler_get_profile, sizeof(__pyx_k_Scheduler_get_profile), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_profile_locals_gen, __pyx_k_Scheduler_get_profile_locals_gen, sizeof(__pyx_k_Scheduler_get_profile_locals_gen), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_profile_metadata, __pyx_k_Scheduler_get_profile_metadata, sizeof(__pyx_k_Scheduler_get_profile_metadata), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_profile_metadata_l, __pyx_k_Scheduler_get_profile_metadata_l, sizeof(__pyx_k_Scheduler_get_profile_metadata_l), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_profile_metadata_l_2, __pyx_k_Scheduler_get_profile_metadata_l_2, sizeof(__pyx_k_Scheduler_get_profile_metadata_l_2), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_task_status, __pyx_k_Scheduler_get_task_status, sizeof(__pyx_k_Scheduler_get_task_status), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_task_stream, __pyx_k_Scheduler_get_task_stream, sizeof(__pyx_k_Scheduler_get_task_stream), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_who_has, __pyx_k_Scheduler_get_who_has, sizeof(__pyx_k_Scheduler_get_who_has), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_worker_logs, __pyx_k_Scheduler_get_worker_logs, sizeof(__pyx_k_Scheduler_get_worker_logs), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_get_worker_service_add, __pyx_k_Scheduler_get_worker_service_add, sizeof(__pyx_k_Scheduler_get_worker_service_add), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_handle_long_running, __pyx_k_Scheduler_handle_long_running, sizeof(__pyx_k_Scheduler_handle_long_running), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_handle_missing_data, __pyx_k_Scheduler_handle_missing_data, sizeof(__pyx_k_Scheduler_handle_missing_data), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_handle_release_data, __pyx_k_Scheduler_handle_release_data, sizeof(__pyx_k_Scheduler_handle_release_data), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_handle_task_erred, __pyx_k_Scheduler_handle_task_erred, sizeof(__pyx_k_Scheduler_handle_task_erred), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_handle_task_finished, __pyx_k_Scheduler_handle_task_finished, sizeof(__pyx_k_Scheduler_handle_task_finished), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_handle_uncaught_error, __pyx_k_Scheduler_handle_uncaught_error, sizeof(__pyx_k_Scheduler_handle_uncaught_error), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_handle_worker, __pyx_k_Scheduler_handle_worker, sizeof(__pyx_k_Scheduler_handle_worker), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_heartbeat_worker, __pyx_k_Scheduler_heartbeat_worker, sizeof(__pyx_k_Scheduler_heartbeat_worker), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_identity, __pyx_k_Scheduler_identity, sizeof(__pyx_k_Scheduler_identity), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_log_event, __pyx_k_Scheduler_log_event, sizeof(__pyx_k_Scheduler_log_event), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_log_worker_event, __pyx_k_Scheduler_log_worker_event, sizeof(__pyx_k_Scheduler_log_worker_event), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_new_task, __pyx_k_Scheduler_new_task, sizeof(__pyx_k_Scheduler_new_task), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_performance_report, __pyx_k_Scheduler_performance_report, sizeof(__pyx_k_Scheduler_performance_report), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_performance_report_loc, __pyx_k_Scheduler_performance_report_loc, sizeof(__pyx_k_Scheduler_performance_report_loc), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_proxy, __pyx_k_Scheduler_proxy, sizeof(__pyx_k_Scheduler_proxy), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_rebalance, __pyx_k_Scheduler_rebalance, sizeof(__pyx_k_Scheduler_rebalance), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_rebalance_locals_genex, __pyx_k_Scheduler_rebalance_locals_genex, sizeof(__pyx_k_Scheduler_rebalance_locals_genex), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_rebalance_locals_lambd, __pyx_k_Scheduler_rebalance_locals_lambd, sizeof(__pyx_k_Scheduler_rebalance_locals_lambd), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_reevaluate_occupancy, __pyx_k_Scheduler_reevaluate_occupancy, sizeof(__pyx_k_Scheduler_reevaluate_occupancy), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_register_worker_plugin, __pyx_k_Scheduler_register_worker_plugin, sizeof(__pyx_k_Scheduler_register_worker_plugin), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_release_worker_data, __pyx_k_Scheduler_release_worker_data, sizeof(__pyx_k_Scheduler_release_worker_data), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_remove_client, __pyx_k_Scheduler_remove_client, sizeof(__pyx_k_Scheduler_remove_client), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_remove_client_locals_r, __pyx_k_Scheduler_remove_client_locals_r, sizeof(__pyx_k_Scheduler_remove_client_locals_r), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_remove_plugin, __pyx_k_Scheduler_remove_plugin, sizeof(__pyx_k_Scheduler_remove_plugin), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_remove_resources, __pyx_k_Scheduler_remove_resources, sizeof(__pyx_k_Scheduler_remove_resources), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_remove_worker, __pyx_k_Scheduler_remove_worker, sizeof(__pyx_k_Scheduler_remove_worker), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_remove_worker_locals_r, __pyx_k_Scheduler_remove_worker_locals_r, sizeof(__pyx_k_Scheduler_remove_worker_locals_r), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_replicate, __pyx_k_Scheduler_replicate, sizeof(__pyx_k_Scheduler_replicate), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_replicate_locals_genex, __pyx_k_Scheduler_replicate_locals_genex, sizeof(__pyx_k_Scheduler_replicate_locals_genex), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_report, __pyx_k_Scheduler_report, sizeof(__pyx_k_Scheduler_report), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_report_on_key, __pyx_k_Scheduler_report_on_key, sizeof(__pyx_k_Scheduler_report_on_key), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_reschedule, __pyx_k_Scheduler_reschedule, sizeof(__pyx_k_Scheduler_reschedule), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_restart, __pyx_k_Scheduler_restart, sizeof(__pyx_k_Scheduler_restart), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_restart_locals_genexpr, __pyx_k_Scheduler_restart_locals_genexpr, sizeof(__pyx_k_Scheduler_restart_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_retire_workers, __pyx_k_Scheduler_retire_workers, sizeof(__pyx_k_Scheduler_retire_workers), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_run_function, __pyx_k_Scheduler_run_function, sizeof(__pyx_k_Scheduler_run_function), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_scatter, __pyx_k_Scheduler_scatter, sizeof(__pyx_k_Scheduler_scatter), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_send_all, __pyx_k_Scheduler_send_all, sizeof(__pyx_k_Scheduler_send_all), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_send_task_to_worker, __pyx_k_Scheduler_send_task_to_worker, sizeof(__pyx_k_Scheduler_send_task_to_worker), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_set_metadata, __pyx_k_Scheduler_set_metadata, sizeof(__pyx_k_Scheduler_set_metadata), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_start, __pyx_k_Scheduler_start, sizeof(__pyx_k_Scheduler_start), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_start_ipython, __pyx_k_Scheduler_start_ipython, sizeof(__pyx_k_Scheduler_start_ipython), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_start_locals_del_sched, __pyx_k_Scheduler_start_locals_del_sched, sizeof(__pyx_k_Scheduler_start_locals_del_sched), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_start_task_metadata, __pyx_k_Scheduler_start_task_metadata, sizeof(__pyx_k_Scheduler_start_task_metadata), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_stimulus_cancel, __pyx_k_Scheduler_stimulus_cancel, sizeof(__pyx_k_Scheduler_stimulus_cancel), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_stimulus_missing_data, __pyx_k_Scheduler_stimulus_missing_data, sizeof(__pyx_k_Scheduler_stimulus_missing_data), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_stimulus_retry, __pyx_k_Scheduler_stimulus_retry, sizeof(__pyx_k_Scheduler_stimulus_retry), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_stimulus_task_erred, __pyx_k_Scheduler_stimulus_task_erred, sizeof(__pyx_k_Scheduler_stimulus_task_erred), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_stimulus_task_finished, __pyx_k_Scheduler_stimulus_task_finished, sizeof(__pyx_k_Scheduler_stimulus_task_finished), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_stop_task_metadata, __pyx_k_Scheduler_stop_task_metadata, sizeof(__pyx_k_Scheduler_stop_task_metadata), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_story, __pyx_k_Scheduler_story, sizeof(__pyx_k_Scheduler_story), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_subscribe_worker_statu, __pyx_k_Scheduler_subscribe_worker_statu, sizeof(__pyx_k_Scheduler_subscribe_worker_statu), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_transition, __pyx_k_Scheduler_transition, sizeof(__pyx_k_Scheduler_transition), 0, 0, 1, 1}, {&__pyx_kp_u_Scheduler_transition_line_5989, __pyx_k_Scheduler_transition_line_5989, sizeof(__pyx_k_Scheduler_transition_line_5989), 0, 1, 0, 0}, {&__pyx_n_s_Scheduler_transitions, __pyx_k_Scheduler_transitions, sizeof(__pyx_k_Scheduler_transitions), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_update_data, __pyx_k_Scheduler_update_data, sizeof(__pyx_k_Scheduler_update_data), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_update_graph, __pyx_k_Scheduler_update_graph, sizeof(__pyx_k_Scheduler_update_graph), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_update_graph_hlg, __pyx_k_Scheduler_update_graph_hlg, sizeof(__pyx_k_Scheduler_update_graph_hlg), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_update_graph_locals_ge, __pyx_k_Scheduler_update_graph_locals_ge, sizeof(__pyx_k_Scheduler_update_graph_locals_ge), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_erred, __pyx_k_Scheduler_validate_erred, sizeof(__pyx_k_Scheduler_validate_erred), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_key, __pyx_k_Scheduler_validate_key, sizeof(__pyx_k_Scheduler_validate_key), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_memory, __pyx_k_Scheduler_validate_memory, sizeof(__pyx_k_Scheduler_validate_memory), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_no_worker, __pyx_k_Scheduler_validate_no_worker, sizeof(__pyx_k_Scheduler_validate_no_worker), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_processing, __pyx_k_Scheduler_validate_processing, sizeof(__pyx_k_Scheduler_validate_processing), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_released, __pyx_k_Scheduler_validate_released, sizeof(__pyx_k_Scheduler_validate_released), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_state, __pyx_k_Scheduler_validate_state, sizeof(__pyx_k_Scheduler_validate_state), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_state_locals, __pyx_k_Scheduler_validate_state_locals, sizeof(__pyx_k_Scheduler_validate_state_locals), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_validate_waiting, __pyx_k_Scheduler_validate_waiting, sizeof(__pyx_k_Scheduler_validate_waiting), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_worker_send, __pyx_k_Scheduler_worker_send, sizeof(__pyx_k_Scheduler_worker_send), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_workers_list, __pyx_k_Scheduler_workers_list, sizeof(__pyx_k_Scheduler_workers_list), 0, 0, 1, 1}, {&__pyx_n_s_Scheduler_workers_to_close, __pyx_k_Scheduler_workers_to_close, sizeof(__pyx_k_Scheduler_workers_to_close), 0, 0, 1, 1}, {&__pyx_kp_u_Scheduler_workers_to_close_line, __pyx_k_Scheduler_workers_to_close_line, sizeof(__pyx_k_Scheduler_workers_to_close_line), 0, 1, 0, 0}, {&__pyx_n_s_Scheduler_workers_to_close_local, __pyx_k_Scheduler_workers_to_close_local, sizeof(__pyx_k_Scheduler_workers_to_close_local), 0, 0, 1, 1}, {&__pyx_n_s_Security, __pyx_k_Security, sizeof(__pyx_k_Security), 0, 0, 1, 1}, {&__pyx_n_s_SemaphoreExtension, __pyx_k_SemaphoreExtension, sizeof(__pyx_k_SemaphoreExtension), 0, 0, 1, 1}, {&__pyx_kp_u_Send_kill_signal_to_nannies_s, __pyx_k_Send_kill_signal_to_nannies_s, sizeof(__pyx_k_Send_kill_signal_to_nannies_s), 0, 1, 0, 0}, {&__pyx_kp_u_Send_lost_future_signal_to_clien, __pyx_k_Send_lost_future_signal_to_clien, sizeof(__pyx_k_Send_lost_future_signal_to_clien), 0, 1, 0, 0}, {&__pyx_n_s_ServerNode, __pyx_k_ServerNode, sizeof(__pyx_k_ServerNode), 0, 0, 1, 1}, {&__pyx_n_s_Set, __pyx_k_Set, sizeof(__pyx_k_Set), 0, 0, 1, 1}, {&__pyx_kp_s_Similar_to__StateLegacyMapping, __pyx_k_Similar_to__StateLegacyMapping, sizeof(__pyx_k_Similar_to__StateLegacyMapping), 0, 0, 1, 0}, {&__pyx_kp_s_Similar_to__StateLegacyMapping_2, __pyx_k_Similar_to__StateLegacyMapping_2, sizeof(__pyx_k_Similar_to__StateLegacyMapping_2), 0, 0, 1, 0}, {&__pyx_n_s_SortedDict, __pyx_k_SortedDict, sizeof(__pyx_k_SortedDict), 0, 0, 1, 1}, {&__pyx_kp_u_Starting_worker_compute_stream_s, __pyx_k_Starting_worker_compute_stream_s, sizeof(__pyx_k_Starting_worker_compute_stream_s), 0, 1, 0, 0}, {&__pyx_n_s_StateLegacyMapping, __pyx_k_StateLegacyMapping, sizeof(__pyx_k_StateLegacyMapping), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacyMapping___getitem, __pyx_k_StateLegacyMapping___getitem, sizeof(__pyx_k_StateLegacyMapping___getitem), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacyMapping___init, __pyx_k_StateLegacyMapping___init, sizeof(__pyx_k_StateLegacyMapping___init), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacyMapping___iter, __pyx_k_StateLegacyMapping___iter, sizeof(__pyx_k_StateLegacyMapping___iter), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacyMapping___len, __pyx_k_StateLegacyMapping___len, sizeof(__pyx_k_StateLegacyMapping___len), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacyMapping___repr, __pyx_k_StateLegacyMapping___repr, sizeof(__pyx_k_StateLegacyMapping___repr), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacySet, __pyx_k_StateLegacySet, sizeof(__pyx_k_StateLegacySet), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacySet___contains, __pyx_k_StateLegacySet___contains, sizeof(__pyx_k_StateLegacySet___contains), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacySet___init, __pyx_k_StateLegacySet___init, sizeof(__pyx_k_StateLegacySet___init), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacySet___iter, __pyx_k_StateLegacySet___iter, sizeof(__pyx_k_StateLegacySet___iter), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacySet___iter___locals, __pyx_k_StateLegacySet___iter___locals, sizeof(__pyx_k_StateLegacySet___iter___locals), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacySet___len, __pyx_k_StateLegacySet___len, sizeof(__pyx_k_StateLegacySet___len), 0, 0, 1, 1}, {&__pyx_n_s_StateLegacySet___repr, __pyx_k_StateLegacySet___repr, sizeof(__pyx_k_StateLegacySet___repr), 0, 0, 1, 1}, {&__pyx_n_s_Status, __pyx_k_Status, sizeof(__pyx_k_Status), 0, 0, 1, 1}, {&__pyx_kp_u_Stimulus_missing_data_s_s, __pyx_k_Stimulus_missing_data_s_s, sizeof(__pyx_k_Stimulus_missing_data_s_s), 0, 1, 0, 0}, {&__pyx_kp_u_Stimulus_task_erred_s_s, __pyx_k_Stimulus_task_erred_s_s, sizeof(__pyx_k_Stimulus_task_erred_s_s), 0, 1, 0, 0}, {&__pyx_kp_u_Stimulus_task_finished_s_s, __pyx_k_Stimulus_task_finished_s_s, sizeof(__pyx_k_Stimulus_task_finished_s_s), 0, 1, 0, 0}, {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, {&__pyx_kp_u_Suggest_closing_workers_s, __pyx_k_Suggest_closing_workers_s, sizeof(__pyx_k_Suggest_closing_workers_s), 0, 1, 0, 0}, {&__pyx_n_u_Summary, __pyx_k_Summary, sizeof(__pyx_k_Summary), 0, 1, 0, 1}, {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, {&__pyx_n_s_Tabs, __pyx_k_Tabs, sizeof(__pyx_k_Tabs), 0, 0, 1, 1}, {&__pyx_kp_u_Task, __pyx_k_Task, sizeof(__pyx_k_Task), 0, 1, 0, 0}, {&__pyx_n_s_TaskGroup, __pyx_k_TaskGroup, sizeof(__pyx_k_TaskGroup), 0, 0, 1, 1}, {&__pyx_n_s_TaskPrefix, __pyx_k_TaskPrefix, sizeof(__pyx_k_TaskPrefix), 0, 0, 1, 1}, {&__pyx_n_s_TaskState, __pyx_k_TaskState, sizeof(__pyx_k_TaskState), 0, 0, 1, 1}, {&__pyx_n_u_TaskState, __pyx_k_TaskState, sizeof(__pyx_k_TaskState), 0, 1, 0, 1}, {&__pyx_n_s_TaskStreamPlugin, __pyx_k_TaskStreamPlugin, sizeof(__pyx_k_TaskStreamPlugin), 0, 0, 1, 1}, {&__pyx_kp_u_Task_Stream, __pyx_k_Task_Stream, sizeof(__pyx_k_Task_Stream), 0, 1, 0, 0}, {&__pyx_kp_u_Task_s_marked_as_failed_because, __pyx_k_Task_s_marked_as_failed_because, sizeof(__pyx_k_Task_s_marked_as_failed_because), 0, 1, 0, 0}, {&__pyx_kp_u_This_Worker, __pyx_k_This_Worker, sizeof(__pyx_k_This_Worker), 0, 1, 0, 0}, {&__pyx_n_s_TimeoutError, __pyx_k_TimeoutError, sizeof(__pyx_k_TimeoutError), 0, 0, 1, 1}, {&__pyx_kp_u_Transition_a_key_from_its_curren, __pyx_k_Transition_a_key_from_its_curren, sizeof(__pyx_k_Transition_a_key_from_its_curren), 0, 1, 0, 0}, {&__pyx_kp_u_Transition_a_key_from_its_curren_2, __pyx_k_Transition_a_key_from_its_curren_2, sizeof(__pyx_k_Transition_a_key_from_its_curren_2), 0, 1, 0, 0}, {&__pyx_kp_u_Transitioned_r_s_s_actual_s_Cons, __pyx_k_Transitioned_r_s_s_actual_s_Cons, sizeof(__pyx_k_Transitioned_r_s_s_actual_s_Cons), 0, 1, 0, 0}, {&__pyx_kp_u_Tried_to_call_feed_route_with_cu, __pyx_k_Tried_to_call_feed_route_with_cu, sizeof(__pyx_k_Tried_to_call_feed_route_with_cu), 0, 1, 0, 0}, {&__pyx_kp_u_Tried_writing_to_closed_comm_s, __pyx_k_Tried_writing_to_closed_comm_s, sizeof(__pyx_k_Tried_writing_to_closed_comm_s), 0, 1, 0, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_u_Unexpected_worker_completed_task, __pyx_k_Unexpected_worker_completed_task, sizeof(__pyx_k_Unexpected_worker_completed_task), 0, 1, 0, 0}, {&__pyx_kp_u_Update_data_s, __pyx_k_Update_data_s, sizeof(__pyx_k_Update_data_s), 0, 1, 0, 0}, {&__pyx_kp_u_User_asked_for_computation_on_lo, __pyx_k_User_asked_for_computation_on_lo, sizeof(__pyx_k_User_asked_for_computation_on_lo), 0, 1, 0, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_VariableExtension, __pyx_k_VariableExtension, sizeof(__pyx_k_VariableExtension), 0, 0, 1, 1}, {&__pyx_n_s_WeakSet, __pyx_k_WeakSet, sizeof(__pyx_k_WeakSet), 0, 0, 1, 1}, {&__pyx_n_s_WorkStealing, __pyx_k_WorkStealing, sizeof(__pyx_k_WorkStealing), 0, 0, 1, 1}, {&__pyx_kp_u_Worker, __pyx_k_Worker, sizeof(__pyx_k_Worker), 0, 1, 0, 0}, {&__pyx_n_s_WorkerState, __pyx_k_WorkerState, sizeof(__pyx_k_WorkerState), 0, 0, 1, 1}, {&__pyx_kp_u_WorkerState_ncores_has_moved_to, __pyx_k_WorkerState_ncores_has_moved_to, sizeof(__pyx_k_WorkerState_ncores_has_moved_to), 0, 1, 0, 0}, {&__pyx_n_s_WorkerStatusPlugin, __pyx_k_WorkerStatusPlugin, sizeof(__pyx_k_WorkerStatusPlugin), 0, 0, 1, 1}, {&__pyx_n_s_WorkerStatusPlugin___init, __pyx_k_WorkerStatusPlugin___init, sizeof(__pyx_k_WorkerStatusPlugin___init), 0, 0, 1, 1}, {&__pyx_n_s_WorkerStatusPlugin_add_worker, __pyx_k_WorkerStatusPlugin_add_worker, sizeof(__pyx_k_WorkerStatusPlugin_add_worker), 0, 0, 1, 1}, {&__pyx_n_s_WorkerStatusPlugin_remove_worker, __pyx_k_WorkerStatusPlugin_remove_worker, sizeof(__pyx_k_WorkerStatusPlugin_remove_worker), 0, 0, 1, 1}, {&__pyx_n_s_WorkerStatusPlugin_teardown, __pyx_k_WorkerStatusPlugin_teardown, sizeof(__pyx_k_WorkerStatusPlugin_teardown), 0, 0, 1, 1}, {&__pyx_n_u_Worker_2, __pyx_k_Worker_2, sizeof(__pyx_k_Worker_2), 0, 1, 0, 1}, {&__pyx_kp_u_Worker_Profile_administrative, __pyx_k_Worker_Profile_administrative, sizeof(__pyx_k_Worker_Profile_administrative), 0, 1, 0, 0}, {&__pyx_kp_u_Worker_Profile_compute, __pyx_k_Worker_Profile_compute, sizeof(__pyx_k_Worker_Profile_compute), 0, 1, 0, 0}, {&__pyx_kp_u_Worker_already_exists_s, __pyx_k_Worker_already_exists_s, sizeof(__pyx_k_Worker_already_exists_s), 0, 1, 0, 0}, {&__pyx_kp_u_Worker_failed_to_heartbeat_withi, __pyx_k_Worker_failed_to_heartbeat_withi, sizeof(__pyx_k_Worker_failed_to_heartbeat_withi), 0, 1, 0, 0}, {&__pyx_kp_u_Worker_holding_Actor_was_lost, __pyx_k_Worker_holding_Actor_was_lost, sizeof(__pyx_k_Worker_holding_Actor_was_lost), 0, 1, 0, 0}, {&__pyx_kp_u_Worker_tried_to_connect_with_a_d, __pyx_k_Worker_tried_to_connect_with_a_d, sizeof(__pyx_k_Worker_tried_to_connect_with_a_d), 0, 1, 0, 0}, {&__pyx_kp_u_Workers_don_t_have_promised_key, __pyx_k_Workers_don_t_have_promised_key, sizeof(__pyx_k_Workers_don_t_have_promised_key), 0, 1, 0, 0}, {&__pyx_kp_u_Workers_not_the_same_in_all_coll, __pyx_k_Workers_not_the_same_in_all_coll, sizeof(__pyx_k_Workers_not_the_same_in_all_coll), 0, 1, 0, 0}, {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_kp_u__48, __pyx_k__48, sizeof(__pyx_k__48), 0, 1, 0, 0}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_n_s__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 0, 1, 1}, {&__pyx_kp_u__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 1, 0, 0}, {&__pyx_kp_u__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 1, 0, 0}, {&__pyx_kp_u__53, __pyx_k__53, sizeof(__pyx_k__53), 0, 1, 0, 0}, {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, {&__pyx_kp_u__60, __pyx_k__60, sizeof(__pyx_k__60), 0, 1, 0, 0}, {&__pyx_n_u__61, __pyx_k__61, sizeof(__pyx_k__61), 0, 1, 0, 1}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, {&__pyx_kp_u__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 1, 0, 0}, {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_a_cmsgs, __pyx_k_a_cmsgs, sizeof(__pyx_k_a_cmsgs), 0, 0, 1, 1}, {&__pyx_n_s_a_recs, __pyx_k_a_recs, sizeof(__pyx_k_a_recs), 0, 0, 1, 1}, {&__pyx_n_s_a_wmsgs, __pyx_k_a_wmsgs, sizeof(__pyx_k_a_wmsgs), 0, 0, 1, 1}, {&__pyx_n_s_abort, __pyx_k_abort, sizeof(__pyx_k_abort), 0, 0, 1, 1}, {&__pyx_n_s_abspath, __pyx_k_abspath, sizeof(__pyx_k_abspath), 0, 0, 1, 1}, {&__pyx_n_s_accessor, __pyx_k_accessor, sizeof(__pyx_k_accessor), 0, 0, 1, 1}, {&__pyx_n_s_accessor_2, __pyx_k_accessor_2, sizeof(__pyx_k_accessor_2), 0, 0, 1, 1}, {&__pyx_n_u_action, __pyx_k_action, sizeof(__pyx_k_action), 0, 1, 0, 1}, {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, {&__pyx_n_s_actor, __pyx_k_actor, sizeof(__pyx_k_actor), 0, 0, 1, 1}, {&__pyx_n_u_actor, __pyx_k_actor, sizeof(__pyx_k_actor), 0, 1, 0, 1}, {&__pyx_n_u_actor_2, __pyx_k_actor_2, sizeof(__pyx_k_actor_2), 0, 1, 0, 1}, {&__pyx_n_s_actors, __pyx_k_actors, sizeof(__pyx_k_actors), 0, 0, 1, 1}, {&__pyx_n_u_actors_2, __pyx_k_actors_2, sizeof(__pyx_k_actors_2), 0, 1, 0, 1}, {&__pyx_n_s_actual_total_occupancy, __pyx_k_actual_total_occupancy, sizeof(__pyx_k_actual_total_occupancy), 0, 0, 1, 1}, {&__pyx_n_s_adaptive_target, __pyx_k_adaptive_target, sizeof(__pyx_k_adaptive_target), 0, 0, 1, 1}, {&__pyx_n_u_adaptive_target, __pyx_k_adaptive_target, sizeof(__pyx_k_adaptive_target), 0, 1, 0, 1}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_u_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 1, 0, 1}, {&__pyx_n_s_add_callback, __pyx_k_add_callback, sizeof(__pyx_k_add_callback), 0, 0, 1, 1}, {&__pyx_n_s_add_client, __pyx_k_add_client, sizeof(__pyx_k_add_client), 0, 0, 1, 1}, {&__pyx_kp_u_add_client_2, __pyx_k_add_client_2, sizeof(__pyx_k_add_client_2), 0, 1, 0, 0}, {&__pyx_kp_u_add_keys, __pyx_k_add_keys, sizeof(__pyx_k_add_keys), 0, 1, 0, 0}, {&__pyx_n_s_add_keys_2, __pyx_k_add_keys_2, sizeof(__pyx_k_add_keys_2), 0, 0, 1, 1}, {&__pyx_n_u_add_keys_2, __pyx_k_add_keys_2, sizeof(__pyx_k_add_keys_2), 0, 1, 0, 1}, {&__pyx_n_s_add_plugin, __pyx_k_add_plugin, sizeof(__pyx_k_add_plugin), 0, 0, 1, 1}, {&__pyx_n_s_add_resources, __pyx_k_add_resources, sizeof(__pyx_k_add_resources), 0, 0, 1, 1}, {&__pyx_n_s_add_timeout, __pyx_k_add_timeout, sizeof(__pyx_k_add_timeout), 0, 0, 1, 1}, {&__pyx_n_s_add_worker, __pyx_k_add_worker, sizeof(__pyx_k_add_worker), 0, 0, 1, 1}, {&__pyx_kp_u_add_worker_2, __pyx_k_add_worker_2, sizeof(__pyx_k_add_worker_2), 0, 1, 0, 0}, {&__pyx_n_s_addr, __pyx_k_addr, sizeof(__pyx_k_addr), 0, 0, 1, 1}, {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, {&__pyx_n_u_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 1, 0, 1}, {&__pyx_n_u_address_2, __pyx_k_address_2, sizeof(__pyx_k_address_2), 0, 1, 0, 1}, {&__pyx_n_s_addresses, __pyx_k_addresses, sizeof(__pyx_k_addresses), 0, 0, 1, 1}, {&__pyx_n_u_addresses, __pyx_k_addresses, sizeof(__pyx_k_addresses), 0, 1, 0, 1}, {&__pyx_n_s_addresses_from_user_args, __pyx_k_addresses_from_user_args, sizeof(__pyx_k_addresses_from_user_args), 0, 0, 1, 1}, {&__pyx_kp_u_addresses_should_be_strings_or_t, __pyx_k_addresses_should_be_strings_or_t, sizeof(__pyx_k_addresses_should_be_strings_or_t), 0, 1, 0, 0}, {&__pyx_n_s_aenter, __pyx_k_aenter, sizeof(__pyx_k_aenter), 0, 0, 1, 1}, {&__pyx_n_s_aexit, __pyx_k_aexit, sizeof(__pyx_k_aexit), 0, 0, 1, 1}, {&__pyx_n_s_aliases, __pyx_k_aliases, sizeof(__pyx_k_aliases), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_u_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 1, 0, 1}, {&__pyx_n_s_all_forgotten, __pyx_k_all_forgotten, sizeof(__pyx_k_all_forgotten), 0, 0, 1, 1}, {&__pyx_n_s_allow_offload, __pyx_k_allow_offload, sizeof(__pyx_k_allow_offload), 0, 0, 1, 1}, {&__pyx_n_u_allow_other_workers, __pyx_k_allow_other_workers, sizeof(__pyx_k_allow_other_workers), 0, 1, 0, 1}, {&__pyx_n_s_allow_overlap, __pyx_k_allow_overlap, sizeof(__pyx_k_allow_overlap), 0, 0, 1, 1}, {&__pyx_n_s_allowed_failures, __pyx_k_allowed_failures, sizeof(__pyx_k_allowed_failures), 0, 0, 1, 1}, {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, {&__pyx_n_s_already_in_memory, __pyx_k_already_in_memory, sizeof(__pyx_k_already_in_memory), 0, 0, 1, 1}, {&__pyx_kp_u_already_removed, __pyx_k_already_removed, sizeof(__pyx_k_already_removed), 0, 1, 0, 0}, {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1}, {&__pyx_n_u_annotations_2, __pyx_k_annotations_2, sizeof(__pyx_k_annotations_2), 0, 1, 0, 1}, {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio, __pyx_k_asyncio, sizeof(__pyx_k_asyncio), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_tasks, __pyx_k_asyncio_tasks, sizeof(__pyx_k_asyncio_tasks), 0, 0, 1, 1}, {&__pyx_n_s_attrgetter, __pyx_k_attrgetter, sizeof(__pyx_k_attrgetter), 0, 0, 1, 1}, {&__pyx_n_s_attribute, __pyx_k_attribute, sizeof(__pyx_k_attribute), 0, 0, 1, 1}, {&__pyx_n_s_avg, __pyx_k_avg, sizeof(__pyx_k_avg), 0, 0, 1, 1}, {&__pyx_n_s_avg_duration, __pyx_k_avg_duration, sizeof(__pyx_k_avg_duration), 0, 0, 1, 1}, {&__pyx_n_s_await, __pyx_k_await, sizeof(__pyx_k_await), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_b_cmsgs, __pyx_k_b_cmsgs, sizeof(__pyx_k_b_cmsgs), 0, 0, 1, 1}, {&__pyx_n_s_b_recs, __pyx_k_b_recs, sizeof(__pyx_k_b_recs), 0, 0, 1, 1}, {&__pyx_n_s_b_wmsgs, __pyx_k_b_wmsgs, sizeof(__pyx_k_b_wmsgs), 0, 0, 1, 1}, {&__pyx_n_u_bandwidth, __pyx_k_bandwidth, sizeof(__pyx_k_bandwidth), 0, 1, 0, 1}, {&__pyx_n_u_bandwidth_2, __pyx_k_bandwidth_2, sizeof(__pyx_k_bandwidth_2), 0, 1, 0, 1}, {&__pyx_n_s_bandwidth_types, __pyx_k_bandwidth_types, sizeof(__pyx_k_bandwidth_types), 0, 0, 1, 1}, {&__pyx_n_s_bandwidth_workers, __pyx_k_bandwidth_workers, sizeof(__pyx_k_bandwidth_workers), 0, 0, 1, 1}, {&__pyx_n_s_batched, __pyx_k_batched, sizeof(__pyx_k_batched), 0, 0, 1, 1}, {&__pyx_n_s_bcomm, __pyx_k_bcomm, sizeof(__pyx_k_bcomm), 0, 0, 1, 1}, {&__pyx_n_s_bint, __pyx_k_bint, sizeof(__pyx_k_bint), 0, 0, 1, 1}, {&__pyx_n_s_bokeh_core_templates, __pyx_k_bokeh_core_templates, sizeof(__pyx_k_bokeh_core_templates), 0, 0, 1, 1}, {&__pyx_n_s_bokeh_models, __pyx_k_bokeh_models, sizeof(__pyx_k_bokeh_models), 0, 0, 1, 1}, {&__pyx_n_s_bokeh_plotting, __pyx_k_bokeh_plotting, sizeof(__pyx_k_bokeh_plotting), 0, 0, 1, 1}, {&__pyx_n_s_branching_factor, __pyx_k_branching_factor, sizeof(__pyx_k_branching_factor), 0, 0, 1, 1}, {&__pyx_kp_u_branching_factor_2, __pyx_k_branching_factor_2, sizeof(__pyx_k_branching_factor_2), 0, 1, 0, 0}, {&__pyx_n_s_broadcast, __pyx_k_broadcast, sizeof(__pyx_k_broadcast), 0, 0, 1, 1}, {&__pyx_n_u_broadcast, __pyx_k_broadcast, sizeof(__pyx_k_broadcast), 0, 1, 0, 1}, {&__pyx_kp_u_but_found, __pyx_k_but_found, sizeof(__pyx_k_but_found), 0, 1, 0, 0}, {&__pyx_n_s_bw, __pyx_k_bw, sizeof(__pyx_k_bw), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_c_double, __pyx_k_c_double, sizeof(__pyx_k_c_double), 0, 0, 1, 1}, {&__pyx_n_s_c_ssize_t, __pyx_k_c_ssize_t, sizeof(__pyx_k_c_ssize_t), 0, 0, 1, 1}, {&__pyx_n_s_call_later, __pyx_k_call_later, sizeof(__pyx_k_call_later), 0, 0, 1, 1}, {&__pyx_n_s_call_stack, __pyx_k_call_stack, sizeof(__pyx_k_call_stack), 0, 0, 1, 1}, {&__pyx_n_u_call_stack, __pyx_k_call_stack, sizeof(__pyx_k_call_stack), 0, 1, 0, 1}, {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, {&__pyx_n_u_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 1, 0, 1}, {&__pyx_n_s_cancel_key, __pyx_k_cancel_key, sizeof(__pyx_k_cancel_key), 0, 0, 1, 1}, {&__pyx_kp_u_cancelled_key, __pyx_k_cancelled_key, sizeof(__pyx_k_cancelled_key), 0, 1, 0, 0}, {&__pyx_n_s_cast, __pyx_k_cast, sizeof(__pyx_k_cast), 0, 0, 1, 1}, {&__pyx_n_s_cause, __pyx_k_cause, sizeof(__pyx_k_cause), 0, 0, 1, 1}, {&__pyx_n_s_ccall, __pyx_k_ccall, sizeof(__pyx_k_ccall), 0, 0, 1, 1}, {&__pyx_n_s_cclass, __pyx_k_cclass, sizeof(__pyx_k_cclass), 0, 0, 1, 1}, {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1}, {&__pyx_n_s_cfunc, __pyx_k_cfunc, sizeof(__pyx_k_cfunc), 0, 0, 1, 1}, {&__pyx_n_s_check_idle, __pyx_k_check_idle, sizeof(__pyx_k_check_idle), 0, 0, 1, 1}, {&__pyx_n_s_check_idle_saturated, __pyx_k_check_idle_saturated, sizeof(__pyx_k_check_idle_saturated), 0, 0, 1, 1}, {&__pyx_n_s_check_worker_ttl, __pyx_k_check_worker_ttl, sizeof(__pyx_k_check_worker_ttl), 0, 0, 1, 1}, {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1}, {&__pyx_n_s_child_deps, __pyx_k_child_deps, sizeof(__pyx_k_child_deps), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_clean_exception, __pyx_k_clean_exception, sizeof(__pyx_k_clean_exception), 0, 0, 1, 1}, {&__pyx_n_s_cleanup_delay, __pyx_k_cleanup_delay, sizeof(__pyx_k_cleanup_delay), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_clear_task_state, __pyx_k_clear_task_state, sizeof(__pyx_k_clear_task_state), 0, 0, 1, 1}, {&__pyx_n_s_client, __pyx_k_client, sizeof(__pyx_k_client), 0, 0, 1, 1}, {&__pyx_n_u_client, __pyx_k_client, sizeof(__pyx_k_client), 0, 1, 0, 1}, {&__pyx_n_s_client_comms, __pyx_k_client_comms, sizeof(__pyx_k_client_comms), 0, 0, 1, 1}, {&__pyx_kp_u_client_desires_keys, __pyx_k_client_desires_keys, sizeof(__pyx_k_client_desires_keys), 0, 1, 0, 0}, {&__pyx_n_s_client_desires_keys_2, __pyx_k_client_desires_keys_2, sizeof(__pyx_k_client_desires_keys_2), 0, 0, 1, 1}, {&__pyx_n_s_client_handlers, __pyx_k_client_handlers, sizeof(__pyx_k_client_handlers), 0, 0, 1, 1}, {&__pyx_n_s_client_heartbeat, __pyx_k_client_heartbeat, sizeof(__pyx_k_client_heartbeat), 0, 0, 1, 1}, {&__pyx_n_u_client_key, __pyx_k_client_key, sizeof(__pyx_k_client_key), 0, 1, 0, 1}, {&__pyx_n_s_client_keys, __pyx_k_client_keys, sizeof(__pyx_k_client_keys), 0, 0, 1, 1}, {&__pyx_n_s_client_msgs, __pyx_k_client_msgs, sizeof(__pyx_k_client_msgs), 0, 0, 1, 1}, {&__pyx_n_s_client_name, __pyx_k_client_name, sizeof(__pyx_k_client_name), 0, 0, 1, 1}, {&__pyx_kp_u_client_releases_keys, __pyx_k_client_releases_keys, sizeof(__pyx_k_client_releases_keys), 0, 1, 0, 0}, {&__pyx_n_s_client_releases_keys_2, __pyx_k_client_releases_keys_2, sizeof(__pyx_k_client_releases_keys_2), 0, 0, 1, 1}, {&__pyx_n_s_client_send, __pyx_k_client_send, sizeof(__pyx_k_client_send), 0, 0, 1, 1}, {&__pyx_n_s_clients, __pyx_k_clients, sizeof(__pyx_k_clients), 0, 0, 1, 1}, {&__pyx_n_u_clients, __pyx_k_clients, sizeof(__pyx_k_clients), 0, 1, 0, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_u_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 1, 0, 1}, {&__pyx_kp_u_close_client, __pyx_k_close_client, sizeof(__pyx_k_close_client), 0, 1, 0, 0}, {&__pyx_n_u_close_gracefully, __pyx_k_close_gracefully, sizeof(__pyx_k_close_gracefully), 0, 1, 0, 1}, {&__pyx_n_s_close_rpc, __pyx_k_close_rpc, sizeof(__pyx_k_close_rpc), 0, 0, 1, 1}, {&__pyx_kp_u_close_stream, __pyx_k_close_stream, sizeof(__pyx_k_close_stream), 0, 1, 0, 0}, {&__pyx_n_s_close_worker, __pyx_k_close_worker, sizeof(__pyx_k_close_worker), 0, 0, 1, 1}, {&__pyx_kp_u_close_worker_2, __pyx_k_close_worker_2, sizeof(__pyx_k_close_worker_2), 0, 1, 0, 0}, {&__pyx_n_s_close_workers, __pyx_k_close_workers, sizeof(__pyx_k_close_workers), 0, 0, 1, 1}, {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, {&__pyx_n_s_closing, __pyx_k_closing, sizeof(__pyx_k_closing), 0, 0, 1, 1}, {&__pyx_n_s_closing_gracefully, __pyx_k_closing_gracefully, sizeof(__pyx_k_closing_gracefully), 0, 0, 1, 1}, {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, {&__pyx_n_s_coerce_address, __pyx_k_coerce_address, sizeof(__pyx_k_coerce_address), 0, 0, 1, 1}, {&__pyx_n_s_coerce_hostname, __pyx_k_coerce_hostname, sizeof(__pyx_k_coerce_hostname), 0, 0, 1, 1}, {&__pyx_n_s_collect, __pyx_k_collect, sizeof(__pyx_k_collect), 0, 0, 1, 1}, {&__pyx_n_s_collection, __pyx_k_collection, sizeof(__pyx_k_collection), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1}, {&__pyx_n_s_comm_addressing, __pyx_k_comm_addressing, sizeof(__pyx_k_comm_addressing), 0, 0, 1, 1}, {&__pyx_n_s_compose, __pyx_k_compose, sizeof(__pyx_k_compose), 0, 0, 1, 1}, {&__pyx_n_u_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 1, 0, 1}, {&__pyx_n_s_compute, __pyx_k_compute, sizeof(__pyx_k_compute), 0, 0, 1, 1}, {&__pyx_n_u_compute, __pyx_k_compute, sizeof(__pyx_k_compute), 0, 1, 0, 1}, {&__pyx_n_s_compute_duration, __pyx_k_compute_duration, sizeof(__pyx_k_compute_duration), 0, 0, 1, 1}, {&__pyx_kp_u_compute_task, __pyx_k_compute_task, sizeof(__pyx_k_compute_task), 0, 1, 0, 0}, {&__pyx_n_s_concat, __pyx_k_concat, sizeof(__pyx_k_concat), 0, 0, 1, 1}, {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1}, {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1}, {&__pyx_n_s_connection_args, __pyx_k_connection_args, sizeof(__pyx_k_connection_args), 0, 0, 1, 1}, {&__pyx_n_s_connection_limit, __pyx_k_connection_limit, sizeof(__pyx_k_connection_limit), 0, 0, 1, 1}, {&__pyx_n_s_consume_resources, __pyx_k_consume_resources, sizeof(__pyx_k_consume_resources), 0, 0, 1, 1}, {&__pyx_n_s_contact_address, __pyx_k_contact_address, sizeof(__pyx_k_contact_address), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_contextlib, __pyx_k_contextlib, sizeof(__pyx_k_contextlib), 0, 0, 1, 1}, {&__pyx_n_s_core, __pyx_k_core, sizeof(__pyx_k_core), 0, 0, 1, 1}, {&__pyx_kp_u_cores, __pyx_k_cores, sizeof(__pyx_k_cores), 0, 1, 0, 0}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_u_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 1, 0, 1}, {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1}, {&__pyx_n_u_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 1, 0, 1}, {&__pyx_n_s_cpu, __pyx_k_cpu, sizeof(__pyx_k_cpu), 0, 0, 1, 1}, {&__pyx_n_s_cpu_percent, __pyx_k_cpu_percent, sizeof(__pyx_k_cpu_percent), 0, 0, 1, 1}, {&__pyx_n_s_critical, __pyx_k_critical, sizeof(__pyx_k_critical), 0, 0, 1, 1}, {&__pyx_n_s_cs, __pyx_k_cs, sizeof(__pyx_k_cs), 0, 0, 1, 1}, {&__pyx_n_s_cts, __pyx_k_cts, sizeof(__pyx_k_cts), 0, 0, 1, 1}, {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1}, {&__pyx_n_s_current, __pyx_k_current, sizeof(__pyx_k_current), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1}, {&__pyx_n_s_dashboard, __pyx_k_dashboard, sizeof(__pyx_k_dashboard), 0, 0, 1, 1}, {&__pyx_n_u_dashboard, __pyx_k_dashboard, sizeof(__pyx_k_dashboard), 0, 1, 0, 1}, {&__pyx_n_s_dashboard_address, __pyx_k_dashboard_address, sizeof(__pyx_k_dashboard_address), 0, 0, 1, 1}, {&__pyx_n_s_dashboard_components_scheduler, __pyx_k_dashboard_components_scheduler, sizeof(__pyx_k_dashboard_components_scheduler), 0, 0, 1, 1}, {&__pyx_n_s_dask, __pyx_k_dask, sizeof(__pyx_k_dask), 0, 0, 1, 1}, {&__pyx_kp_u_dask_scheduler, __pyx_k_dask_scheduler, sizeof(__pyx_k_dask_scheduler), 0, 1, 0, 0}, {&__pyx_kp_u_dask_scheduler_closed, __pyx_k_dask_scheduler_closed, sizeof(__pyx_k_dask_scheduler_closed), 0, 1, 0, 0}, {&__pyx_kp_u_dask_scheduler_closing, __pyx_k_dask_scheduler_closing, sizeof(__pyx_k_dask_scheduler_closing), 0, 1, 0, 0}, {&__pyx_kp_u_dask_scheduler_not_started, __pyx_k_dask_scheduler_not_started, sizeof(__pyx_k_dask_scheduler_not_started), 0, 1, 0, 0}, {&__pyx_n_s_dask_version, __pyx_k_dask_version, sizeof(__pyx_k_dask_version), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_u_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 1, 0, 1}, {&__pyx_n_s_datasets, __pyx_k_datasets, sizeof(__pyx_k_datasets), 0, 0, 1, 1}, {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, {&__pyx_n_s_decide_worker, __pyx_k_decide_worker, sizeof(__pyx_k_decide_worker), 0, 0, 1, 1}, {&__pyx_n_s_declare, __pyx_k_declare, sizeof(__pyx_k_declare), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_default_port, __pyx_k_default_port, sizeof(__pyx_k_default_port), 0, 0, 1, 1}, {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1}, {&__pyx_n_s_del_candidates, __pyx_k_del_candidates, sizeof(__pyx_k_del_candidates), 0, 0, 1, 1}, {&__pyx_n_s_del_scheduler_file, __pyx_k_del_scheduler_file, sizeof(__pyx_k_del_scheduler_file), 0, 0, 1, 1}, {&__pyx_n_s_del_worker_tasks, __pyx_k_del_worker_tasks, sizeof(__pyx_k_del_worker_tasks), 0, 0, 1, 1}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1}, {&__pyx_kp_u_delete_data, __pyx_k_delete_data, sizeof(__pyx_k_delete_data), 0, 1, 0, 0}, {&__pyx_n_s_delete_data_2, __pyx_k_delete_data_2, sizeof(__pyx_k_delete_data_2), 0, 0, 1, 1}, {&__pyx_n_s_delete_interval, __pyx_k_delete_interval, sizeof(__pyx_k_delete_interval), 0, 0, 1, 1}, {&__pyx_n_s_delete_worker_data, __pyx_k_delete_worker_data, sizeof(__pyx_k_delete_worker_data), 0, 0, 1, 1}, {&__pyx_n_s_dep, __pyx_k_dep, sizeof(__pyx_k_dep), 0, 0, 1, 1}, {&__pyx_kp_u_dep_missing, __pyx_k_dep_missing, sizeof(__pyx_k_dep_missing), 0, 1, 0, 0}, {&__pyx_n_s_dependencies, __pyx_k_dependencies, sizeof(__pyx_k_dependencies), 0, 0, 1, 1}, {&__pyx_n_u_dependencies, __pyx_k_dependencies, sizeof(__pyx_k_dependencies), 0, 1, 0, 1}, {&__pyx_n_u_dependencies_2, __pyx_k_dependencies_2, sizeof(__pyx_k_dependencies_2), 0, 1, 0, 1}, {&__pyx_n_s_dependents, __pyx_k_dependents, sizeof(__pyx_k_dependents), 0, 0, 1, 1}, {&__pyx_n_u_dependents, __pyx_k_dependents, sizeof(__pyx_k_dependents), 0, 1, 0, 1}, {&__pyx_n_u_dependents_2, __pyx_k_dependents_2, sizeof(__pyx_k_dependents_2), 0, 1, 0, 1}, {&__pyx_n_s_deps, __pyx_k_deps, sizeof(__pyx_k_deps), 0, 0, 1, 1}, {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, {&__pyx_n_s_deserialize, __pyx_k_deserialize, sizeof(__pyx_k_deserialize), 0, 0, 1, 1}, {&__pyx_n_s_diagnostics_plugin, __pyx_k_diagnostics_plugin, sizeof(__pyx_k_diagnostics_plugin), 0, 0, 1, 1}, {&__pyx_n_s_diagnostics_task_stream, __pyx_k_diagnostics_task_stream, sizeof(__pyx_k_diagnostics_task_stream), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_u_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 1, 0, 1}, {&__pyx_n_s_digests, __pyx_k_digests, sizeof(__pyx_k_digests), 0, 0, 1, 1}, {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1}, {&__pyx_n_s_disable_gc_diagnosis, __pyx_k_disable_gc_diagnosis, sizeof(__pyx_k_disable_gc_diagnosis), 0, 0, 1, 1}, {&__pyx_n_s_discard, __pyx_k_discard, sizeof(__pyx_k_discard), 0, 0, 1, 1}, {&__pyx_n_s_distributed, __pyx_k_distributed, sizeof(__pyx_k_distributed), 0, 0, 1, 1}, {&__pyx_kp_u_distributed_adaptive_target_dura, __pyx_k_distributed_adaptive_target_dura, sizeof(__pyx_k_distributed_adaptive_target_dura), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_admin_pdb_on_err, __pyx_k_distributed_admin_pdb_on_err, sizeof(__pyx_k_distributed_admin_pdb_on_err), 0, 1, 0, 0}, {&__pyx_n_s_distributed_dashboard_components, __pyx_k_distributed_dashboard_components, sizeof(__pyx_k_distributed_dashboard_components), 0, 0, 1, 1}, {&__pyx_n_s_distributed_dashboard_scheduler, __pyx_k_distributed_dashboard_scheduler, sizeof(__pyx_k_distributed_dashboard_scheduler), 0, 0, 1, 1}, {&__pyx_n_s_distributed_diagnostics_task_str, __pyx_k_distributed_diagnostics_task_str, sizeof(__pyx_k_distributed_diagnostics_task_str), 0, 0, 1, 1}, {&__pyx_kp_u_distributed_http_scheduler_missi, __pyx_k_distributed_http_scheduler_missi, sizeof(__pyx_k_distributed_http_scheduler_missi), 0, 1, 0, 0}, {&__pyx_n_s_distributed_scheduler, __pyx_k_distributed_scheduler, sizeof(__pyx_k_distributed_scheduler), 0, 0, 1, 1}, {&__pyx_kp_u_distributed_scheduler_allowed_fa, __pyx_k_distributed_scheduler_allowed_fa, sizeof(__pyx_k_distributed_scheduler_allowed_fa), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_bandwidth, __pyx_k_distributed_scheduler_bandwidth, sizeof(__pyx_k_distributed_scheduler_bandwidth), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_default_da, __pyx_k_distributed_scheduler_default_da, sizeof(__pyx_k_distributed_scheduler_default_da), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_default_ta, __pyx_k_distributed_scheduler_default_ta, sizeof(__pyx_k_distributed_scheduler_default_ta), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_events_cle, __pyx_k_distributed_scheduler_events_cle, sizeof(__pyx_k_distributed_scheduler_events_cle), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_http_route, __pyx_k_distributed_scheduler_http_route, sizeof(__pyx_k_distributed_scheduler_http_route), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_idle_timeo, __pyx_k_distributed_scheduler_idle_timeo, sizeof(__pyx_k_distributed_scheduler_idle_timeo), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_pickle, __pyx_k_distributed_scheduler_pickle, sizeof(__pyx_k_distributed_scheduler_pickle), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_preload, __pyx_k_distributed_scheduler_preload, sizeof(__pyx_k_distributed_scheduler_preload), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_preload_ar, __pyx_k_distributed_scheduler_preload_ar, sizeof(__pyx_k_distributed_scheduler_preload_ar), 0, 1, 0, 0}, {&__pyx_kp_s_distributed_scheduler_py, __pyx_k_distributed_scheduler_py, sizeof(__pyx_k_distributed_scheduler_py), 0, 0, 1, 0}, {&__pyx_kp_u_distributed_scheduler_transition, __pyx_k_distributed_scheduler_transition, sizeof(__pyx_k_distributed_scheduler_transition), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_unknown_ta, __pyx_k_distributed_scheduler_unknown_ta, sizeof(__pyx_k_distributed_scheduler_unknown_ta), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_validate, __pyx_k_distributed_scheduler_validate, sizeof(__pyx_k_distributed_scheduler_validate), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_work_steal, __pyx_k_distributed_scheduler_work_steal, sizeof(__pyx_k_distributed_scheduler_work_steal), 0, 1, 0, 0}, {&__pyx_kp_u_distributed_scheduler_worker_ttl, __pyx_k_distributed_scheduler_worker_ttl, sizeof(__pyx_k_distributed_scheduler_worker_ttl), 0, 1, 0, 0}, {&__pyx_n_s_distributed_version, __pyx_k_distributed_version, sizeof(__pyx_k_distributed_version), 0, 0, 1, 1}, {&__pyx_kp_u_distributed_worker_profile_cycle, __pyx_k_distributed_worker_profile_cycle, sizeof(__pyx_k_distributed_worker_profile_cycle), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1}, {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, {&__pyx_n_s_dsk, __pyx_k_dsk, sizeof(__pyx_k_dsk), 0, 0, 1, 1}, {&__pyx_n_s_dsk_keys, __pyx_k_dsk_keys, sizeof(__pyx_k_dsk_keys), 0, 0, 1, 1}, {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, {&__pyx_n_s_dts, __pyx_k_dts, sizeof(__pyx_k_dts), 0, 0, 1, 1}, {&__pyx_n_s_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 0, 1, 1}, {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1}, {&__pyx_n_s_duration, __pyx_k_duration, sizeof(__pyx_k_duration), 0, 0, 1, 1}, {&__pyx_n_u_duration, __pyx_k_duration, sizeof(__pyx_k_duration), 0, 1, 0, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_empty_context, __pyx_k_empty_context, sizeof(__pyx_k_empty_context), 0, 0, 1, 1}, {&__pyx_n_s_enable_gc_diagnosis, __pyx_k_enable_gc_diagnosis, sizeof(__pyx_k_enable_gc_diagnosis), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_ensure, __pyx_k_ensure, sizeof(__pyx_k_ensure), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_errant_worker, __pyx_k_errant_worker, sizeof(__pyx_k_errant_worker), 0, 0, 1, 1}, {&__pyx_n_u_erred, __pyx_k_erred, sizeof(__pyx_k_erred), 0, 1, 0, 1}, {&__pyx_n_s_erred_deps, __pyx_k_erred_deps, sizeof(__pyx_k_erred_deps), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_u_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 1, 0, 1}, {&__pyx_n_s_error_message, __pyx_k_error_message, sizeof(__pyx_k_error_message), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_event_counts, __pyx_k_event_counts, sizeof(__pyx_k_event_counts), 0, 0, 1, 1}, {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1}, {&__pyx_n_u_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 1, 0, 1}, {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, {&__pyx_n_u_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 1, 0, 1}, {&__pyx_n_u_exception_2, __pyx_k_exception_2, sizeof(__pyx_k_exception_2), 0, 1, 0, 1}, {&__pyx_n_s_exception_blame, __pyx_k_exception_blame, sizeof(__pyx_k_exception_blame), 0, 0, 1, 1}, {&__pyx_n_u_exception_blame, __pyx_k_exception_blame, sizeof(__pyx_k_exception_blame), 0, 1, 0, 1}, {&__pyx_n_u_exception_blame_2, __pyx_k_exception_blame_2, sizeof(__pyx_k_exception_blame_2), 0, 1, 0, 1}, {&__pyx_n_u_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 1, 0, 1}, {&__pyx_n_u_exceptions_blame, __pyx_k_exceptions_blame, sizeof(__pyx_k_exceptions_blame), 0, 1, 0, 1}, {&__pyx_n_s_exceptval, __pyx_k_exceptval, sizeof(__pyx_k_exceptval), 0, 0, 1, 1}, {&__pyx_n_s_exceptval_locals_wrapper, __pyx_k_exceptval_locals_wrapper, sizeof(__pyx_k_exceptval_locals_wrapper), 0, 0, 1, 1}, {&__pyx_n_s_executing, __pyx_k_executing, sizeof(__pyx_k_executing), 0, 0, 1, 1}, {&__pyx_n_u_executing_2, __pyx_k_executing_2, sizeof(__pyx_k_executing_2), 0, 1, 0, 1}, {&__pyx_n_s_executor_wait, __pyx_k_executor_wait, sizeof(__pyx_k_executor_wait), 0, 0, 1, 1}, {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_kp_u_expected_Status_or_str_got, __pyx_k_expected_Status_or_str_got, sizeof(__pyx_k_expected_Status_or_str_got), 0, 1, 0, 0}, {&__pyx_n_s_ext, __pyx_k_ext, sizeof(__pyx_k_ext), 0, 0, 1, 1}, {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, {&__pyx_n_s_extension, __pyx_k_extension, sizeof(__pyx_k_extension), 0, 0, 1, 1}, {&__pyx_n_s_extensions, __pyx_k_extensions, sizeof(__pyx_k_extensions), 0, 0, 1, 1}, {&__pyx_n_u_extensions, __pyx_k_extensions, sizeof(__pyx_k_extensions), 0, 1, 0, 1}, {&__pyx_n_s_extensions_2, __pyx_k_extensions_2, sizeof(__pyx_k_extensions_2), 0, 0, 1, 1}, {&__pyx_n_s_extra, __pyx_k_extra, sizeof(__pyx_k_extra), 0, 0, 1, 1}, {&__pyx_n_u_extra_2, __pyx_k_extra_2, sizeof(__pyx_k_extra_2), 0, 1, 0, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_fast, __pyx_k_fast, sizeof(__pyx_k_fast), 0, 0, 1, 1}, {&__pyx_n_s_feed, __pyx_k_feed, sizeof(__pyx_k_feed), 0, 0, 1, 1}, {&__pyx_n_u_feed, __pyx_k_feed, sizeof(__pyx_k_feed), 0, 1, 0, 1}, {&__pyx_n_s_fifo_timeout, __pyx_k_fifo_timeout, sizeof(__pyx_k_fifo_timeout), 0, 0, 1, 1}, {&__pyx_n_s_fig, __pyx_k_fig, sizeof(__pyx_k_fig), 0, 0, 1, 1}, {&__pyx_n_s_figure, __pyx_k_figure, sizeof(__pyx_k_figure), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_final, __pyx_k_final, sizeof(__pyx_k_final), 0, 0, 1, 1}, {&__pyx_n_s_finalize, __pyx_k_finalize, sizeof(__pyx_k_finalize), 0, 0, 1, 1}, {&__pyx_n_s_finish, __pyx_k_finish, sizeof(__pyx_k_finish), 0, 0, 1, 1}, {&__pyx_n_s_finish2, __pyx_k_finish2, sizeof(__pyx_k_finish2), 0, 0, 1, 1}, {&__pyx_n_s_finished, __pyx_k_finished, sizeof(__pyx_k_finished), 0, 0, 1, 1}, {&__pyx_kp_u_fire_and_forget, __pyx_k_fire_and_forget, sizeof(__pyx_k_fire_and_forget), 0, 1, 0, 0}, {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1}, {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, {&__pyx_n_u_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 1, 0, 1}, {&__pyx_n_u_forgotten, __pyx_k_forgotten, sizeof(__pyx_k_forgotten), 0, 1, 0, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_format_bytes, __pyx_k_format_bytes, sizeof(__pyx_k_format_bytes), 0, 0, 1, 1}, {&__pyx_n_s_format_time, __pyx_k_format_time, sizeof(__pyx_k_format_time), 0, 0, 1, 1}, {&__pyx_n_s_frac, __pyx_k_frac, sizeof(__pyx_k_frac), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_n_s_function, __pyx_k_function, sizeof(__pyx_k_function), 0, 0, 1, 1}, {&__pyx_n_u_function, __pyx_k_function, sizeof(__pyx_k_function), 0, 1, 0, 1}, {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, {&__pyx_n_s_future, __pyx_k_future, sizeof(__pyx_k_future), 0, 0, 1, 1}, {&__pyx_n_s_futures, __pyx_k_futures, sizeof(__pyx_k_futures), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_gather, __pyx_k_gather, sizeof(__pyx_k_gather), 0, 0, 1, 1}, {&__pyx_n_u_gather, __pyx_k_gather, sizeof(__pyx_k_gather), 0, 1, 0, 1}, {&__pyx_n_s_gather_from_workers, __pyx_k_gather_from_workers, sizeof(__pyx_k_gather_from_workers), 0, 0, 1, 1}, {&__pyx_n_s_gathers, __pyx_k_gathers, sizeof(__pyx_k_gathers), 0, 0, 1, 1}, {&__pyx_n_s_generation, __pyx_k_generation, sizeof(__pyx_k_generation), 0, 0, 1, 1}, {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1}, {&__pyx_n_s_get_address_host, __pyx_k_get_address_host, sizeof(__pyx_k_get_address_host), 0, 0, 1, 1}, {&__pyx_n_s_get_call_stack, __pyx_k_get_call_stack, sizeof(__pyx_k_get_call_stack), 0, 0, 1, 1}, {&__pyx_n_s_get_comm_cost, __pyx_k_get_comm_cost, sizeof(__pyx_k_get_comm_cost), 0, 0, 1, 1}, {&__pyx_n_s_get_connection_args, __pyx_k_get_connection_args, sizeof(__pyx_k_get_connection_args), 0, 0, 1, 1}, {&__pyx_n_s_get_connection_info, __pyx_k_get_connection_info, sizeof(__pyx_k_get_connection_info), 0, 0, 1, 1}, {&__pyx_n_s_get_env, __pyx_k_get_env, sizeof(__pyx_k_get_env), 0, 0, 1, 1}, {&__pyx_n_s_get_events, __pyx_k_get_events, sizeof(__pyx_k_get_events), 0, 0, 1, 1}, {&__pyx_n_s_get_fileno_limit, __pyx_k_get_fileno_limit, sizeof(__pyx_k_get_fileno_limit), 0, 0, 1, 1}, {&__pyx_n_s_get_handlers, __pyx_k_get_handlers, sizeof(__pyx_k_get_handlers), 0, 0, 1, 1}, {&__pyx_n_s_get_has_what, __pyx_k_get_has_what, sizeof(__pyx_k_get_has_what), 0, 0, 1, 1}, {&__pyx_n_s_get_listen_args, __pyx_k_get_listen_args, sizeof(__pyx_k_get_listen_args), 0, 0, 1, 1}, {&__pyx_n_s_get_logs, __pyx_k_get_logs, sizeof(__pyx_k_get_logs), 0, 0, 1, 1}, {&__pyx_n_u_get_logs, __pyx_k_get_logs, sizeof(__pyx_k_get_logs), 0, 1, 0, 1}, {&__pyx_n_s_get_metadata, __pyx_k_get_metadata, sizeof(__pyx_k_get_metadata), 0, 0, 1, 1}, {&__pyx_n_u_get_metadata, __pyx_k_get_metadata, sizeof(__pyx_k_get_metadata), 0, 1, 0, 1}, {&__pyx_n_s_get_nbytes, __pyx_k_get_nbytes, sizeof(__pyx_k_get_nbytes), 0, 0, 1, 1}, {&__pyx_n_s_get_ncores, __pyx_k_get_ncores, sizeof(__pyx_k_get_ncores), 0, 0, 1, 1}, {&__pyx_n_s_get_processing, __pyx_k_get_processing, sizeof(__pyx_k_get_processing), 0, 0, 1, 1}, {&__pyx_n_s_get_profile, __pyx_k_get_profile, sizeof(__pyx_k_get_profile), 0, 0, 1, 1}, {&__pyx_n_s_get_profile_metadata, __pyx_k_get_profile_metadata, sizeof(__pyx_k_get_profile_metadata), 0, 0, 1, 1}, {&__pyx_n_s_get_task_duration, __pyx_k_get_task_duration, sizeof(__pyx_k_get_task_duration), 0, 0, 1, 1}, {&__pyx_n_s_get_task_status, __pyx_k_get_task_status, sizeof(__pyx_k_get_task_status), 0, 0, 1, 1}, {&__pyx_n_u_get_task_status, __pyx_k_get_task_status, sizeof(__pyx_k_get_task_status), 0, 1, 0, 1}, {&__pyx_n_s_get_task_stream, __pyx_k_get_task_stream, sizeof(__pyx_k_get_task_stream), 0, 0, 1, 1}, {&__pyx_n_u_get_task_stream, __pyx_k_get_task_stream, sizeof(__pyx_k_get_task_stream), 0, 1, 0, 1}, {&__pyx_n_s_get_template, __pyx_k_get_template, sizeof(__pyx_k_get_template), 0, 0, 1, 1}, {&__pyx_n_s_get_versions, __pyx_k_get_versions, sizeof(__pyx_k_get_versions), 0, 0, 1, 1}, {&__pyx_n_s_get_who_has, __pyx_k_get_who_has, sizeof(__pyx_k_get_who_has), 0, 0, 1, 1}, {&__pyx_n_s_get_worker_logs, __pyx_k_get_worker_logs, sizeof(__pyx_k_get_worker_logs), 0, 0, 1, 1}, {&__pyx_n_s_get_worker_service_addr, __pyx_k_get_worker_service_addr, sizeof(__pyx_k_get_worker_service_addr), 0, 0, 1, 1}, {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_u_group_2, __pyx_k_group_2, sizeof(__pyx_k_group_2), 0, 1, 0, 1}, {&__pyx_n_s_group_bytes, __pyx_k_group_bytes, sizeof(__pyx_k_group_bytes), 0, 0, 1, 1}, {&__pyx_n_u_group_key, __pyx_k_group_key, sizeof(__pyx_k_group_key), 0, 1, 0, 1}, {&__pyx_n_s_group_key_2, __pyx_k_group_key_2, sizeof(__pyx_k_group_key_2), 0, 0, 1, 1}, {&__pyx_n_s_groupby, __pyx_k_groupby, sizeof(__pyx_k_groupby), 0, 0, 1, 1}, {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1}, {&__pyx_n_s_groups1, __pyx_k_groups1, sizeof(__pyx_k_groups1), 0, 0, 1, 1}, {&__pyx_n_s_groups2, __pyx_k_groups2, sizeof(__pyx_k_groups2), 0, 0, 1, 1}, {&__pyx_kp_u_h1_Dask_Performance_Report_h1_i, __pyx_k_h1_Dask_Performance_Report_h1_i, sizeof(__pyx_k_h1_Dask_Performance_Report_h1_i), 0, 1, 0, 0}, {&__pyx_n_s_handle_long_running, __pyx_k_handle_long_running, sizeof(__pyx_k_handle_long_running), 0, 0, 1, 1}, {&__pyx_n_s_handle_missing_data, __pyx_k_handle_missing_data, sizeof(__pyx_k_handle_missing_data), 0, 0, 1, 1}, {&__pyx_kp_u_handle_missing_data_key_s_worker, __pyx_k_handle_missing_data_key_s_worker, sizeof(__pyx_k_handle_missing_data_key_s_worker), 0, 1, 0, 0}, {&__pyx_n_s_handle_release_data, __pyx_k_handle_release_data, sizeof(__pyx_k_handle_release_data), 0, 0, 1, 1}, {&__pyx_n_s_handle_stream, __pyx_k_handle_stream, sizeof(__pyx_k_handle_stream), 0, 0, 1, 1}, {&__pyx_n_s_handle_task_erred, __pyx_k_handle_task_erred, sizeof(__pyx_k_handle_task_erred), 0, 0, 1, 1}, {&__pyx_n_s_handle_task_finished, __pyx_k_handle_task_finished, sizeof(__pyx_k_handle_task_finished), 0, 0, 1, 1}, {&__pyx_n_s_handle_uncaught_error, __pyx_k_handle_uncaught_error, sizeof(__pyx_k_handle_uncaught_error), 0, 0, 1, 1}, {&__pyx_n_s_handle_worker, __pyx_k_handle_worker, sizeof(__pyx_k_handle_worker), 0, 0, 1, 1}, {&__pyx_n_s_handlers, __pyx_k_handlers, sizeof(__pyx_k_handlers), 0, 0, 1, 1}, {&__pyx_n_s_handshake_overrides, __pyx_k_handshake_overrides, sizeof(__pyx_k_handshake_overrides), 0, 0, 1, 1}, {&__pyx_n_u_handshake_overrides, __pyx_k_handshake_overrides, sizeof(__pyx_k_handshake_overrides), 0, 1, 0, 1}, {&__pyx_n_u_has_lost_dependencies, __pyx_k_has_lost_dependencies, sizeof(__pyx_k_has_lost_dependencies), 0, 1, 0, 1}, {&__pyx_n_s_has_what, __pyx_k_has_what, sizeof(__pyx_k_has_what), 0, 0, 1, 1}, {&__pyx_n_u_has_what, __pyx_k_has_what, sizeof(__pyx_k_has_what), 0, 1, 0, 1}, {&__pyx_n_u_has_what_2, __pyx_k_has_what_2, sizeof(__pyx_k_has_what_2), 0, 1, 0, 1}, {&__pyx_n_u_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 1, 0, 1}, {&__pyx_n_u_heartbeat, __pyx_k_heartbeat, sizeof(__pyx_k_heartbeat), 0, 1, 0, 1}, {&__pyx_kp_u_heartbeat_client, __pyx_k_heartbeat_client, sizeof(__pyx_k_heartbeat_client), 0, 1, 0, 0}, {&__pyx_kp_u_heartbeat_interval, __pyx_k_heartbeat_interval, sizeof(__pyx_k_heartbeat_interval), 0, 1, 0, 0}, {&__pyx_n_s_heartbeat_interval_2, __pyx_k_heartbeat_interval_2, sizeof(__pyx_k_heartbeat_interval_2), 0, 0, 1, 1}, {&__pyx_n_s_heartbeat_worker, __pyx_k_heartbeat_worker, sizeof(__pyx_k_heartbeat_worker), 0, 0, 1, 1}, {&__pyx_n_u_heartbeat_worker, __pyx_k_heartbeat_worker, sizeof(__pyx_k_heartbeat_worker), 0, 1, 0, 1}, {&__pyx_n_s_highlevelgraph_unpack, __pyx_k_highlevelgraph_unpack, sizeof(__pyx_k_highlevelgraph_unpack), 0, 0, 1, 1}, {&__pyx_n_s_hlg, __pyx_k_hlg, sizeof(__pyx_k_hlg), 0, 0, 1, 1}, {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, {&__pyx_n_u_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 1, 0, 1}, {&__pyx_n_s_host_info, __pyx_k_host_info, sizeof(__pyx_k_host_info), 0, 0, 1, 1}, {&__pyx_n_u_host_info, __pyx_k_host_info, sizeof(__pyx_k_host_info), 0, 1, 0, 1}, {&__pyx_n_u_host_restrictions, __pyx_k_host_restrictions, sizeof(__pyx_k_host_restrictions), 0, 1, 0, 1}, {&__pyx_n_u_host_restrictions_2, __pyx_k_host_restrictions_2, sizeof(__pyx_k_host_restrictions_2), 0, 1, 0, 1}, {&__pyx_n_s_hosts, __pyx_k_hosts, sizeof(__pyx_k_hosts), 0, 0, 1, 1}, {&__pyx_kp_u_html, __pyx_k_html, sizeof(__pyx_k_html), 0, 1, 0, 0}, {&__pyx_n_s_html_2, __pyx_k_html_2, sizeof(__pyx_k_html_2), 0, 0, 1, 1}, {&__pyx_n_s_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 0, 1, 1}, {&__pyx_n_s_http_application, __pyx_k_http_application, sizeof(__pyx_k_http_application), 0, 0, 1, 1}, {&__pyx_n_s_http_prefix, __pyx_k_http_prefix, sizeof(__pyx_k_http_prefix), 0, 0, 1, 1}, {&__pyx_n_s_http_server, __pyx_k_http_server, sizeof(__pyx_k_http_server), 0, 0, 1, 1}, {&__pyx_n_s_http_server_modules, __pyx_k_http_server_modules, sizeof(__pyx_k_http_server_modules), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1}, {&__pyx_n_s_idempotent, __pyx_k_idempotent, sizeof(__pyx_k_idempotent), 0, 0, 1, 1}, {&__pyx_n_s_ident, __pyx_k_ident, sizeof(__pyx_k_ident), 0, 0, 1, 1}, {&__pyx_n_s_identity, __pyx_k_identity, sizeof(__pyx_k_identity), 0, 0, 1, 1}, {&__pyx_n_s_idle, __pyx_k_idle, sizeof(__pyx_k_idle), 0, 0, 1, 1}, {&__pyx_n_u_idle, __pyx_k_idle, sizeof(__pyx_k_idle), 0, 1, 0, 1}, {&__pyx_n_s_idle_since, __pyx_k_idle_since, sizeof(__pyx_k_idle_since), 0, 0, 1, 1}, {&__pyx_n_s_idle_timeout, __pyx_k_idle_timeout, sizeof(__pyx_k_idle_timeout), 0, 0, 1, 1}, {&__pyx_kp_u_idle_timeout_2, __pyx_k_idle_timeout_2, sizeof(__pyx_k_idle_timeout_2), 0, 1, 0, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_indent, __pyx_k_indent, sizeof(__pyx_k_indent), 0, 0, 1, 1}, {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_inline, __pyx_k_inline, sizeof(__pyx_k_inline), 0, 0, 1, 1}, {&__pyx_kp_u_inproc, __pyx_k_inproc, sizeof(__pyx_k_inproc), 0, 1, 0, 0}, {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1}, {&__pyx_n_s_instances, __pyx_k_instances, sizeof(__pyx_k_instances), 0, 0, 1, 1}, {&__pyx_n_s_interface, __pyx_k_interface, sizeof(__pyx_k_interface), 0, 0, 1, 1}, {&__pyx_n_s_intersection, __pyx_k_intersection, sizeof(__pyx_k_intersection), 0, 0, 1, 1}, {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, {&__pyx_n_s_io_loop, __pyx_k_io_loop, sizeof(__pyx_k_io_loop), 0, 0, 1, 1}, {&__pyx_n_s_ip, __pyx_k_ip, sizeof(__pyx_k_ip), 0, 0, 1, 1}, {&__pyx_n_s_ipython_kernel, __pyx_k_ipython_kernel, sizeof(__pyx_k_ipython_kernel), 0, 0, 1, 1}, {&__pyx_n_s_ipython_utils, __pyx_k_ipython_utils, sizeof(__pyx_k_ipython_utils), 0, 0, 1, 1}, {&__pyx_n_s_is_idle, __pyx_k_is_idle, sizeof(__pyx_k_is_idle), 0, 0, 1, 1}, {&__pyx_n_s_isawaitable, __pyx_k_isawaitable, sizeof(__pyx_k_isawaitable), 0, 0, 1, 1}, {&__pyx_n_s_issubset, __pyx_k_issubset, sizeof(__pyx_k_issubset), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1}, {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_kp_u_keep_alive, __pyx_k_keep_alive, sizeof(__pyx_k_keep_alive), 0, 1, 0, 0}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_u_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 1, 0, 1}, {&__pyx_n_s_key_2, __pyx_k_key_2, sizeof(__pyx_k_key_2), 0, 0, 1, 1}, {&__pyx_n_u_key_2, __pyx_k_key_2, sizeof(__pyx_k_key_2), 0, 1, 0, 1}, {&__pyx_kp_u_key_count, __pyx_k_key_count, sizeof(__pyx_k_key_count), 0, 1, 0, 0}, {&__pyx_kp_u_key_in_memory, __pyx_k_key_in_memory, sizeof(__pyx_k_key_in_memory), 0, 1, 0, 0}, {&__pyx_n_s_key_split, __pyx_k_key_split, sizeof(__pyx_k_key_split), 0, 0, 1, 1}, {&__pyx_n_s_key_split_group, __pyx_k_key_split_group, sizeof(__pyx_k_key_split_group), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_u_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 0, 1}, {&__pyx_n_s_kv, __pyx_k_kv, sizeof(__pyx_k_kv), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, {&__pyx_n_s_last_client, __pyx_k_last_client, sizeof(__pyx_k_last_client), 0, 0, 1, 1}, {&__pyx_n_u_last_seen, __pyx_k_last_seen, sizeof(__pyx_k_last_seen), 0, 1, 0, 1}, {&__pyx_kp_u_last_seen_2, __pyx_k_last_seen_2, sizeof(__pyx_k_last_seen_2), 0, 1, 0, 0}, {&__pyx_n_u_last_seen_3, __pyx_k_last_seen_3, sizeof(__pyx_k_last_seen_3), 0, 1, 0, 1}, {&__pyx_n_s_last_time, __pyx_k_last_time, sizeof(__pyx_k_last_time), 0, 0, 1, 1}, {&__pyx_n_s_last_worker, __pyx_k_last_worker, sizeof(__pyx_k_last_worker), 0, 0, 1, 1}, {&__pyx_n_s_legacy_client_key_set, __pyx_k_legacy_client_key_set, sizeof(__pyx_k_legacy_client_key_set), 0, 0, 1, 1}, {&__pyx_n_s_legacy_task_key_dict, __pyx_k_legacy_task_key_dict, sizeof(__pyx_k_legacy_task_key_dict), 0, 0, 1, 1}, {&__pyx_n_s_legacy_task_key_set, __pyx_k_legacy_task_key_set, sizeof(__pyx_k_legacy_task_key_set), 0, 0, 1, 1}, {&__pyx_n_s_legacy_worker_key_set, __pyx_k_legacy_worker_key_set, sizeof(__pyx_k_legacy_worker_key_set), 0, 0, 1, 1}, {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, {&__pyx_n_s_len_2, __pyx_k_len_2, sizeof(__pyx_k_len_2), 0, 0, 1, 1}, {&__pyx_kp_u_li, __pyx_k_li, sizeof(__pyx_k_li), 0, 1, 0, 0}, {&__pyx_kp_u_li_2, __pyx_k_li_2, sizeof(__pyx_k_li_2), 0, 1, 0, 0}, {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1}, {&__pyx_n_s_limit_bytes, __pyx_k_limit_bytes, sizeof(__pyx_k_limit_bytes), 0, 0, 1, 1}, {&__pyx_n_s_listen, __pyx_k_listen, sizeof(__pyx_k_listen), 0, 0, 1, 1}, {&__pyx_n_s_listen_address, __pyx_k_listen_address, sizeof(__pyx_k_listen_address), 0, 0, 1, 1}, {&__pyx_n_s_listen_ip, __pyx_k_listen_ip, sizeof(__pyx_k_listen_ip), 0, 0, 1, 1}, {&__pyx_n_s_listener, __pyx_k_listener, sizeof(__pyx_k_listener), 0, 0, 1, 1}, {&__pyx_n_s_listeners, __pyx_k_listeners, sizeof(__pyx_k_listeners), 0, 0, 1, 1}, {&__pyx_n_s_loader, __pyx_k_loader, sizeof(__pyx_k_loader), 0, 0, 1, 1}, {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1}, {&__pyx_n_s_local_directory, __pyx_k_local_directory, sizeof(__pyx_k_local_directory), 0, 0, 1, 1}, {&__pyx_n_u_local_directory, __pyx_k_local_directory, sizeof(__pyx_k_local_directory), 0, 1, 0, 1}, {&__pyx_n_u_local_directory_2, __pyx_k_local_directory_2, sizeof(__pyx_k_local_directory_2), 0, 1, 0, 1}, {&__pyx_n_s_local_now, __pyx_k_local_now, sizeof(__pyx_k_local_now), 0, 0, 1, 1}, {&__pyx_n_u_localhost, __pyx_k_localhost, sizeof(__pyx_k_localhost), 0, 1, 0, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_lock_2, __pyx_k_lock_2, sizeof(__pyx_k_lock_2), 0, 0, 1, 1}, {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1}, {&__pyx_n_s_log_errors, __pyx_k_log_errors, sizeof(__pyx_k_log_errors), 0, 0, 1, 1}, {&__pyx_kp_u_log_event, __pyx_k_log_event, sizeof(__pyx_k_log_event), 0, 1, 0, 0}, {&__pyx_n_s_log_event_2, __pyx_k_log_event_2, sizeof(__pyx_k_log_event_2), 0, 0, 1, 1}, {&__pyx_n_u_log_event_2, __pyx_k_log_event_2, sizeof(__pyx_k_log_event_2), 0, 1, 0, 1}, {&__pyx_n_s_log_worker_event, __pyx_k_log_worker_event, sizeof(__pyx_k_log_worker_event), 0, 0, 1, 1}, {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1}, {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1}, {&__pyx_n_u_logs, __pyx_k_logs, sizeof(__pyx_k_logs), 0, 1, 0, 1}, {&__pyx_kp_u_long_running, __pyx_k_long_running, sizeof(__pyx_k_long_running), 0, 1, 0, 0}, {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, {&__pyx_n_s_loose_restrictions, __pyx_k_loose_restrictions, sizeof(__pyx_k_loose_restrictions), 0, 0, 1, 1}, {&__pyx_n_u_loose_restrictions, __pyx_k_loose_restrictions, sizeof(__pyx_k_loose_restrictions), 0, 1, 0, 1}, {&__pyx_n_u_loose_restrictions_2, __pyx_k_loose_restrictions_2, sizeof(__pyx_k_loose_restrictions_2), 0, 1, 0, 1}, {&__pyx_kp_u_lost_data, __pyx_k_lost_data, sizeof(__pyx_k_lost_data), 0, 1, 0, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, {&__pyx_n_s_maxlen, __pyx_k_maxlen, sizeof(__pyx_k_maxlen), 0, 0, 1, 1}, {&__pyx_kp_u_memory, __pyx_k_memory, sizeof(__pyx_k_memory), 0, 1, 0, 0}, {&__pyx_n_s_memory_2, __pyx_k_memory_2, sizeof(__pyx_k_memory_2), 0, 0, 1, 1}, {&__pyx_n_u_memory_2, __pyx_k_memory_2, sizeof(__pyx_k_memory_2), 0, 1, 0, 1}, {&__pyx_n_s_memory_limit, __pyx_k_memory_limit, sizeof(__pyx_k_memory_limit), 0, 0, 1, 1}, {&__pyx_n_u_memory_limit, __pyx_k_memory_limit, sizeof(__pyx_k_memory_limit), 0, 1, 0, 1}, {&__pyx_n_u_memory_limit_2, __pyx_k_memory_limit_2, sizeof(__pyx_k_memory_limit_2), 0, 1, 0, 1}, {&__pyx_n_s_memory_ratio, __pyx_k_memory_ratio, sizeof(__pyx_k_memory_ratio), 0, 0, 1, 1}, {&__pyx_n_s_merge, __pyx_k_merge, sizeof(__pyx_k_merge), 0, 0, 1, 1}, {&__pyx_n_s_merge_sorted, __pyx_k_merge_sorted, sizeof(__pyx_k_merge_sorted), 0, 0, 1, 1}, {&__pyx_n_s_merge_with, __pyx_k_merge_with, sizeof(__pyx_k_merge_with), 0, 0, 1, 1}, {&__pyx_n_s_merge_workers, __pyx_k_merge_workers, sizeof(__pyx_k_merge_workers), 0, 0, 1, 1}, {&__pyx_n_u_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 1, 0, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_metadata, __pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 0, 1, 1}, {&__pyx_n_u_metadata, __pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 1, 0, 1}, {&__pyx_n_u_metadata_2, __pyx_k_metadata_2, sizeof(__pyx_k_metadata_2), 0, 1, 0, 1}, {&__pyx_n_s_metrics, __pyx_k_metrics, sizeof(__pyx_k_metrics), 0, 0, 1, 1}, {&__pyx_n_u_metrics, __pyx_k_metrics, sizeof(__pyx_k_metrics), 0, 1, 0, 1}, {&__pyx_n_u_metrics_2, __pyx_k_metrics_2, sizeof(__pyx_k_metrics_2), 0, 1, 0, 1}, {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, {&__pyx_n_s_minimum, __pyx_k_minimum, sizeof(__pyx_k_minimum), 0, 0, 1, 1}, {&__pyx_n_u_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 1, 0, 1}, {&__pyx_n_s_missing_bokeh, __pyx_k_missing_bokeh, sizeof(__pyx_k_missing_bokeh), 0, 0, 1, 1}, {&__pyx_kp_u_missing_data, __pyx_k_missing_data, sizeof(__pyx_k_missing_data), 0, 1, 0, 0}, {&__pyx_n_s_missing_data_2, __pyx_k_missing_data_2, sizeof(__pyx_k_missing_data_2), 0, 0, 1, 1}, {&__pyx_n_s_missing_keys, __pyx_k_missing_keys, sizeof(__pyx_k_missing_keys), 0, 0, 1, 1}, {&__pyx_n_s_missing_states, __pyx_k_missing_states, sizeof(__pyx_k_missing_states), 0, 0, 1, 1}, {&__pyx_n_s_missing_workers, __pyx_k_missing_workers, sizeof(__pyx_k_missing_workers), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_modules, __pyx_k_modules, sizeof(__pyx_k_modules), 0, 0, 1, 1}, {&__pyx_n_u_moved_keys, __pyx_k_moved_keys, sizeof(__pyx_k_moved_keys), 0, 1, 0, 1}, {&__pyx_kp_u_moved_keys_2, __pyx_k_moved_keys_2, sizeof(__pyx_k_moved_keys_2), 0, 1, 0, 0}, {&__pyx_n_u_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 0, 1}, {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, {&__pyx_n_s_msg_key, __pyx_k_msg_key, sizeof(__pyx_k_msg_key), 0, 0, 1, 1}, {&__pyx_n_s_msgs, __pyx_k_msgs, sizeof(__pyx_k_msgs), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_u_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 1, 0, 1}, {&__pyx_n_s_n_missing, __pyx_k_n_missing, sizeof(__pyx_k_n_missing), 0, 0, 1, 1}, {&__pyx_n_s_n_remain, __pyx_k_n_remain, sizeof(__pyx_k_n_remain), 0, 0, 1, 1}, {&__pyx_n_u_n_tasks, __pyx_k_n_tasks, sizeof(__pyx_k_n_tasks), 0, 1, 0, 1}, {&__pyx_n_s_n_workers, __pyx_k_n_workers, sizeof(__pyx_k_n_workers), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1}, {&__pyx_kp_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 0}, {&__pyx_n_s_name_3, __pyx_k_name_3, sizeof(__pyx_k_name_3), 0, 0, 1, 1}, {&__pyx_n_u_name_4, __pyx_k_name_4, sizeof(__pyx_k_name_4), 0, 1, 0, 1}, {&__pyx_kp_u_name_taken_s, __pyx_k_name_taken_s, sizeof(__pyx_k_name_taken_s), 0, 1, 0, 0}, {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1}, {&__pyx_n_s_nannies, __pyx_k_nannies, sizeof(__pyx_k_nannies), 0, 0, 1, 1}, {&__pyx_n_s_nanny, __pyx_k_nanny, sizeof(__pyx_k_nanny), 0, 0, 1, 1}, {&__pyx_n_u_nanny, __pyx_k_nanny, sizeof(__pyx_k_nanny), 0, 1, 0, 1}, {&__pyx_n_u_nanny_2, __pyx_k_nanny_2, sizeof(__pyx_k_nanny_2), 0, 1, 0, 1}, {&__pyx_n_s_nanny_addr, __pyx_k_nanny_addr, sizeof(__pyx_k_nanny_addr), 0, 0, 1, 1}, {&__pyx_n_s_nanny_address, __pyx_k_nanny_address, sizeof(__pyx_k_nanny_address), 0, 0, 1, 1}, {&__pyx_n_s_nb, __pyx_k_nb, sizeof(__pyx_k_nb), 0, 0, 1, 1}, {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1}, {&__pyx_n_u_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 1, 0, 1}, {&__pyx_n_u_nbytes_2, __pyx_k_nbytes_2, sizeof(__pyx_k_nbytes_2), 0, 1, 0, 1}, {&__pyx_n_u_ncores, __pyx_k_ncores, sizeof(__pyx_k_ncores), 0, 1, 0, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_new_2, __pyx_k_new_2, sizeof(__pyx_k_new_2), 0, 0, 1, 1}, {&__pyx_n_s_new_attr, __pyx_k_new_attr, sizeof(__pyx_k_new_attr), 0, 0, 1, 1}, {&__pyx_n_s_new_cmsgs, __pyx_k_new_cmsgs, sizeof(__pyx_k_new_cmsgs), 0, 0, 1, 1}, {&__pyx_n_s_new_duration, __pyx_k_new_duration, sizeof(__pyx_k_new_duration), 0, 0, 1, 1}, {&__pyx_n_s_new_msgs, __pyx_k_new_msgs, sizeof(__pyx_k_new_msgs), 0, 0, 1, 1}, {&__pyx_n_s_new_recs, __pyx_k_new_recs, sizeof(__pyx_k_new_recs), 0, 0, 1, 1}, {&__pyx_n_s_new_task, __pyx_k_new_task, sizeof(__pyx_k_new_task), 0, 0, 1, 1}, {&__pyx_n_s_new_wmsgs, __pyx_k_new_wmsgs, sizeof(__pyx_k_new_wmsgs), 0, 0, 1, 1}, {&__pyx_n_s_next_time, __pyx_k_next_time, sizeof(__pyx_k_next_time), 0, 0, 1, 1}, {&__pyx_n_s_no_default, __pyx_k_no_default, sizeof(__pyx_k_no_default), 0, 0, 1, 1}, {&__pyx_kp_u_no_group, __pyx_k_no_group, sizeof(__pyx_k_no_group), 0, 1, 0, 0}, {&__pyx_kp_u_no_worker, __pyx_k_no_worker, sizeof(__pyx_k_no_worker), 0, 1, 0, 0}, {&__pyx_n_s_node, __pyx_k_node, sizeof(__pyx_k_node), 0, 0, 1, 1}, {&__pyx_n_s_nogil, __pyx_k_nogil, sizeof(__pyx_k_nogil), 0, 0, 1, 1}, {&__pyx_n_s_normalize_address, __pyx_k_normalize_address, sizeof(__pyx_k_normalize_address), 0, 0, 1, 1}, {&__pyx_kp_u_not_found, __pyx_k_not_found, sizeof(__pyx_k_not_found), 0, 1, 0, 0}, {&__pyx_kp_u_not_in_dependency_s_dependents, __pyx_k_not_in_dependency_s_dependents, sizeof(__pyx_k_not_in_dependency_s_dependents), 0, 1, 0, 0}, {&__pyx_kp_u_not_in_dependent_s_dependencies, __pyx_k_not_in_dependent_s_dependencies, sizeof(__pyx_k_not_in_dependent_s_dependencies), 0, 1, 0, 0}, {&__pyx_kp_u_not_in_has_what_who_has, __pyx_k_not_in_has_what_who_has, sizeof(__pyx_k_not_in_has_what_who_has), 0, 1, 0, 0}, {&__pyx_kp_u_not_in_wants_what_who_wants, __pyx_k_not_in_wants_what_who_wants, sizeof(__pyx_k_not_in_wants_what_who_wants), 0, 1, 0, 0}, {&__pyx_kp_u_not_in_who_has_has_what, __pyx_k_not_in_who_has_has_what, sizeof(__pyx_k_not_in_who_has_has_what), 0, 1, 0, 0}, {&__pyx_kp_u_not_in_who_wants_wants_what, __pyx_k_not_in_who_wants_wants_what, sizeof(__pyx_k_not_in_who_wants_wants_what), 0, 1, 0, 0}, {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1}, {&__pyx_n_s_ntasks, __pyx_k_ntasks, sizeof(__pyx_k_ntasks), 0, 0, 1, 1}, {&__pyx_n_s_nthreads, __pyx_k_nthreads, sizeof(__pyx_k_nthreads), 0, 0, 1, 1}, {&__pyx_n_u_nthreads, __pyx_k_nthreads, sizeof(__pyx_k_nthreads), 0, 1, 0, 1}, {&__pyx_n_u_nthreads_2, __pyx_k_nthreads_2, sizeof(__pyx_k_nthreads_2), 0, 1, 0, 1}, {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1}, {&__pyx_n_s_nworkers, __pyx_k_nworkers, sizeof(__pyx_k_nworkers), 0, 0, 1, 1}, {&__pyx_n_s_occ, __pyx_k_occ, sizeof(__pyx_k_occ), 0, 0, 1, 1}, {&__pyx_n_u_occupancy, __pyx_k_occupancy, sizeof(__pyx_k_occupancy), 0, 1, 0, 1}, {&__pyx_n_u_occupancy_2, __pyx_k_occupancy_2, sizeof(__pyx_k_occupancy_2), 0, 1, 0, 1}, {&__pyx_n_s_old_attr, __pyx_k_old_attr, sizeof(__pyx_k_old_attr), 0, 0, 1, 1}, {&__pyx_n_s_old_duration, __pyx_k_old_duration, sizeof(__pyx_k_old_duration), 0, 0, 1, 1}, {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1}, {&__pyx_n_u_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 1, 0, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_other_workers, __pyx_k_other_workers, sizeof(__pyx_k_other_workers), 0, 0, 1, 1}, {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, {&__pyx_n_s_output_file, __pyx_k_output_file, sizeof(__pyx_k_output_file), 0, 0, 1, 1}, {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, {&__pyx_n_s_parse_bytes, __pyx_k_parse_bytes, sizeof(__pyx_k_parse_bytes), 0, 0, 1, 1}, {&__pyx_n_s_parse_timedelta, __pyx_k_parse_timedelta, sizeof(__pyx_k_parse_timedelta), 0, 0, 1, 1}, {&__pyx_n_s_partial, __pyx_k_partial, sizeof(__pyx_k_partial), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pc, __pyx_k_pc, sizeof(__pyx_k_pc), 0, 0, 1, 1}, {&__pyx_n_s_pdb, __pyx_k_pdb, sizeof(__pyx_k_pdb), 0, 0, 1, 1}, {&__pyx_n_s_performance_report, __pyx_k_performance_report, sizeof(__pyx_k_performance_report), 0, 0, 1, 1}, {&__pyx_n_u_performance_report, __pyx_k_performance_report, sizeof(__pyx_k_performance_report), 0, 1, 0, 1}, {&__pyx_kp_u_performance_report_html, __pyx_k_performance_report_html, sizeof(__pyx_k_performance_report_html), 0, 1, 0, 0}, {&__pyx_n_s_periodic_callbacks, __pyx_k_periodic_callbacks, sizeof(__pyx_k_periodic_callbacks), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pickle5, __pyx_k_pickle5, sizeof(__pyx_k_pickle5), 0, 0, 1, 1}, {&__pyx_kp_u_pickle_protocol, __pyx_k_pickle_protocol, sizeof(__pyx_k_pickle_protocol), 0, 1, 0, 0}, {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, {&__pyx_n_u_pid_2, __pyx_k_pid_2, sizeof(__pyx_k_pid_2), 0, 1, 0, 1}, {&__pyx_n_s_plot_data, __pyx_k_plot_data, sizeof(__pyx_k_plot_data), 0, 0, 1, 1}, {&__pyx_n_s_plot_figure, __pyx_k_plot_figure, sizeof(__pyx_k_plot_figure), 0, 0, 1, 1}, {&__pyx_n_s_pluck, __pyx_k_pluck, sizeof(__pyx_k_pluck), 0, 0, 1, 1}, {&__pyx_n_s_plugin, __pyx_k_plugin, sizeof(__pyx_k_plugin), 0, 0, 1, 1}, {&__pyx_n_u_plugin, __pyx_k_plugin, sizeof(__pyx_k_plugin), 0, 1, 0, 1}, {&__pyx_kp_u_plugin_add, __pyx_k_plugin_add, sizeof(__pyx_k_plugin_add), 0, 1, 0, 0}, {&__pyx_n_s_plugins, __pyx_k_plugins, sizeof(__pyx_k_plugins), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_popitem, __pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 0, 1, 1}, {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, {&__pyx_n_u_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 1, 0, 1}, {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1}, {&__pyx_n_u_prefix_2, __pyx_k_prefix_2, sizeof(__pyx_k_prefix_2), 0, 1, 0, 1}, {&__pyx_n_s_prefix_key, __pyx_k_prefix_key, sizeof(__pyx_k_prefix_key), 0, 0, 1, 1}, {&__pyx_n_s_preload, __pyx_k_preload, sizeof(__pyx_k_preload), 0, 0, 1, 1}, {&__pyx_n_s_preload_argv, __pyx_k_preload_argv, sizeof(__pyx_k_preload_argv), 0, 0, 1, 1}, {&__pyx_n_s_preloading, __pyx_k_preloading, sizeof(__pyx_k_preloading), 0, 0, 1, 1}, {&__pyx_n_s_preloads, __pyx_k_preloads, sizeof(__pyx_k_preloads), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, {&__pyx_n_u_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 1, 0, 1}, {&__pyx_n_u_priority_2, __pyx_k_priority_2, sizeof(__pyx_k_priority_2), 0, 1, 0, 1}, {&__pyx_n_s_proc, __pyx_k_proc, sizeof(__pyx_k_proc), 0, 0, 1, 1}, {&__pyx_n_s_process_preloads, __pyx_k_process_preloads, sizeof(__pyx_k_process_preloads), 0, 0, 1, 1}, {&__pyx_kp_u_processes, __pyx_k_processes, sizeof(__pyx_k_processes), 0, 1, 0, 0}, {&__pyx_kp_u_processing, __pyx_k_processing, sizeof(__pyx_k_processing), 0, 1, 0, 0}, {&__pyx_n_s_processing_2, __pyx_k_processing_2, sizeof(__pyx_k_processing_2), 0, 0, 1, 1}, {&__pyx_n_u_processing_2, __pyx_k_processing_2, sizeof(__pyx_k_processing_2), 0, 1, 0, 1}, {&__pyx_n_u_processing_3, __pyx_k_processing_3, sizeof(__pyx_k_processing_3), 0, 1, 0, 1}, {&__pyx_n_u_processing_on, __pyx_k_processing_on, sizeof(__pyx_k_processing_on), 0, 1, 0, 1}, {&__pyx_n_u_processing_on_2, __pyx_k_processing_on_2, sizeof(__pyx_k_processing_on_2), 0, 1, 0, 1}, {&__pyx_kp_u_processing_tasks, __pyx_k_processing_tasks, sizeof(__pyx_k_processing_tasks), 0, 1, 0, 0}, {&__pyx_n_s_proctitle, __pyx_k_proctitle, sizeof(__pyx_k_proctitle), 0, 0, 1, 1}, {&__pyx_n_s_profile, __pyx_k_profile, sizeof(__pyx_k_profile), 0, 0, 1, 1}, {&__pyx_n_u_profile, __pyx_k_profile, sizeof(__pyx_k_profile), 0, 1, 0, 1}, {&__pyx_n_s_profile_cycle_interval, __pyx_k_profile_cycle_interval, sizeof(__pyx_k_profile_cycle_interval), 0, 0, 1, 1}, {&__pyx_n_s_profile_metadata, __pyx_k_profile_metadata, sizeof(__pyx_k_profile_metadata), 0, 0, 1, 1}, {&__pyx_n_s_profile_to_figure, __pyx_k_profile_to_figure, sizeof(__pyx_k_profile_to_figure), 0, 0, 1, 1}, {&__pyx_n_s_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 0, 1, 1}, {&__pyx_n_u_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 1, 0, 1}, {&__pyx_n_s_protocol_highlevelgraph, __pyx_k_protocol_highlevelgraph, sizeof(__pyx_k_protocol_highlevelgraph), 0, 0, 1, 1}, {&__pyx_kp_u_protocol_s_host_s_port_d, __pyx_k_protocol_s_host_s_port_d, sizeof(__pyx_k_protocol_s_host_s_port_d), 0, 1, 0, 0}, {&__pyx_n_s_proxy, __pyx_k_proxy, sizeof(__pyx_k_proxy), 0, 0, 1, 1}, {&__pyx_n_u_proxy, __pyx_k_proxy, sizeof(__pyx_k_proxy), 0, 1, 0, 1}, {&__pyx_n_s_psutil, __pyx_k_psutil, sizeof(__pyx_k_psutil), 0, 0, 1, 1}, {&__pyx_n_s_publish, __pyx_k_publish, sizeof(__pyx_k_publish), 0, 0, 1, 1}, {&__pyx_n_s_pubsub, __pyx_k_pubsub, sizeof(__pyx_k_pubsub), 0, 0, 1, 1}, {&__pyx_n_s_put_key_in_stealable, __pyx_k_put_key_in_stealable, sizeof(__pyx_k_put_key_in_stealable), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_ClientState, __pyx_k_pyx_unpickle_ClientState, sizeof(__pyx_k_pyx_unpickle_ClientState), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_SchedulerState, __pyx_k_pyx_unpickle_SchedulerState, sizeof(__pyx_k_pyx_unpickle_SchedulerState), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_TaskGroup, __pyx_k_pyx_unpickle_TaskGroup, sizeof(__pyx_k_pyx_unpickle_TaskGroup), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_TaskPrefix, __pyx_k_pyx_unpickle_TaskPrefix, sizeof(__pyx_k_pyx_unpickle_TaskPrefix), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_TaskState, __pyx_k_pyx_unpickle_TaskState, sizeof(__pyx_k_pyx_unpickle_TaskState), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_WorkerState, __pyx_k_pyx_unpickle_WorkerState, sizeof(__pyx_k_pyx_unpickle_WorkerState), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quantity, __pyx_k_quantity, sizeof(__pyx_k_quantity), 0, 0, 1, 1}, {&__pyx_n_s_queues, __pyx_k_queues, sizeof(__pyx_k_queues), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_rebalance, __pyx_k_rebalance, sizeof(__pyx_k_rebalance), 0, 0, 1, 1}, {&__pyx_n_u_rebalance, __pyx_k_rebalance, sizeof(__pyx_k_rebalance), 0, 1, 0, 1}, {&__pyx_n_s_recipient, __pyx_k_recipient, sizeof(__pyx_k_recipient), 0, 0, 1, 1}, {&__pyx_n_s_recipients, __pyx_k_recipients, sizeof(__pyx_k_recipients), 0, 0, 1, 1}, {&__pyx_n_u_recipients, __pyx_k_recipients, sizeof(__pyx_k_recipients), 0, 1, 0, 1}, {&__pyx_n_s_recommendations, __pyx_k_recommendations, sizeof(__pyx_k_recommendations), 0, 0, 1, 1}, {&__pyx_n_s_recreate_exceptions, __pyx_k_recreate_exceptions, sizeof(__pyx_k_recreate_exceptions), 0, 0, 1, 1}, {&__pyx_n_s_rectangles, __pyx_k_rectangles, sizeof(__pyx_k_rectangles), 0, 0, 1, 1}, {&__pyx_n_s_rects, __pyx_k_rects, sizeof(__pyx_k_rects), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_reevaluate_occupancy, __pyx_k_reevaluate_occupancy, sizeof(__pyx_k_reevaluate_occupancy), 0, 0, 1, 1}, {&__pyx_kp_u_register_client, __pyx_k_register_client, sizeof(__pyx_k_register_client), 0, 1, 0, 0}, {&__pyx_kp_u_register_worker, __pyx_k_register_worker, sizeof(__pyx_k_register_worker), 0, 1, 0, 0}, {&__pyx_n_s_register_worker_plugin, __pyx_k_register_worker_plugin, sizeof(__pyx_k_register_worker_plugin), 0, 0, 1, 1}, {&__pyx_n_u_register_worker_plugin, __pyx_k_register_worker_plugin, sizeof(__pyx_k_register_worker_plugin), 0, 1, 0, 1}, {&__pyx_n_u_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 1, 0, 1}, {&__pyx_n_s_release_resources, __pyx_k_release_resources, sizeof(__pyx_k_release_resources), 0, 0, 1, 1}, {&__pyx_kp_u_release_task, __pyx_k_release_task, sizeof(__pyx_k_release_task), 0, 1, 0, 0}, {&__pyx_kp_u_release_worker_data, __pyx_k_release_worker_data, sizeof(__pyx_k_release_worker_data), 0, 1, 0, 0}, {&__pyx_n_s_release_worker_data_2, __pyx_k_release_worker_data_2, sizeof(__pyx_k_release_worker_data_2), 0, 0, 1, 1}, {&__pyx_n_u_released, __pyx_k_released, sizeof(__pyx_k_released), 0, 1, 0, 1}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_u_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 1, 0, 1}, {&__pyx_n_s_remove_client, __pyx_k_remove_client, sizeof(__pyx_k_remove_client), 0, 0, 1, 1}, {&__pyx_kp_u_remove_client_2, __pyx_k_remove_client_2, sizeof(__pyx_k_remove_client_2), 0, 1, 0, 0}, {&__pyx_n_s_remove_client_from_events, __pyx_k_remove_client_from_events, sizeof(__pyx_k_remove_client_from_events), 0, 0, 1, 1}, {&__pyx_n_s_remove_key, __pyx_k_remove_key, sizeof(__pyx_k_remove_key), 0, 0, 1, 1}, {&__pyx_n_s_remove_key_from_stealable, __pyx_k_remove_key_from_stealable, sizeof(__pyx_k_remove_key_from_stealable), 0, 0, 1, 1}, {&__pyx_n_s_remove_plugin, __pyx_k_remove_plugin, sizeof(__pyx_k_remove_plugin), 0, 0, 1, 1}, {&__pyx_n_s_remove_resources, __pyx_k_remove_resources, sizeof(__pyx_k_remove_resources), 0, 0, 1, 1}, {&__pyx_n_s_remove_worker, __pyx_k_remove_worker, sizeof(__pyx_k_remove_worker), 0, 0, 1, 1}, {&__pyx_kp_u_remove_worker_2, __pyx_k_remove_worker_2, sizeof(__pyx_k_remove_worker_2), 0, 1, 0, 0}, {&__pyx_kp_u_remove_worker_data, __pyx_k_remove_worker_data, sizeof(__pyx_k_remove_worker_data), 0, 1, 0, 0}, {&__pyx_n_s_remove_worker_from_events, __pyx_k_remove_worker_from_events, sizeof(__pyx_k_remove_worker_from_events), 0, 0, 1, 1}, {&__pyx_n_s_removed_tasks, __pyx_k_removed_tasks, sizeof(__pyx_k_removed_tasks), 0, 0, 1, 1}, {&__pyx_n_s_replicate, __pyx_k_replicate, sizeof(__pyx_k_replicate), 0, 0, 1, 1}, {&__pyx_n_u_replicate, __pyx_k_replicate, sizeof(__pyx_k_replicate), 0, 1, 0, 1}, {&__pyx_kp_u_replicate_add, __pyx_k_replicate_add, sizeof(__pyx_k_replicate_add), 0, 1, 0, 0}, {&__pyx_n_s_report, __pyx_k_report, sizeof(__pyx_k_report), 0, 0, 1, 1}, {&__pyx_n_u_report, __pyx_k_report, sizeof(__pyx_k_report), 0, 1, 0, 1}, {&__pyx_kp_u_report_key, __pyx_k_report_key, sizeof(__pyx_k_report_key), 0, 1, 0, 0}, {&__pyx_n_s_report_msg, __pyx_k_report_msg, sizeof(__pyx_k_report_msg), 0, 0, 1, 1}, {&__pyx_n_s_report_on_key, __pyx_k_report_on_key, sizeof(__pyx_k_report_on_key), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_repr___locals_genexpr, __pyx_k_repr___locals_genexpr, sizeof(__pyx_k_repr___locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_reschedule, __pyx_k_reschedule, sizeof(__pyx_k_reschedule), 0, 0, 1, 1}, {&__pyx_n_u_reschedule, __pyx_k_reschedule, sizeof(__pyx_k_reschedule), 0, 1, 0, 1}, {&__pyx_n_s_resolve, __pyx_k_resolve, sizeof(__pyx_k_resolve), 0, 0, 1, 1}, {&__pyx_n_s_resolve_address, __pyx_k_resolve_address, sizeof(__pyx_k_resolve_address), 0, 0, 1, 1}, {&__pyx_n_s_resource, __pyx_k_resource, sizeof(__pyx_k_resource), 0, 0, 1, 1}, {&__pyx_n_u_resource_restrictions, __pyx_k_resource_restrictions, sizeof(__pyx_k_resource_restrictions), 0, 1, 0, 1}, {&__pyx_n_u_resource_restrictions_2, __pyx_k_resource_restrictions_2, sizeof(__pyx_k_resource_restrictions_2), 0, 1, 0, 1}, {&__pyx_n_s_resources, __pyx_k_resources, sizeof(__pyx_k_resources), 0, 0, 1, 1}, {&__pyx_n_u_resources, __pyx_k_resources, sizeof(__pyx_k_resources), 0, 1, 0, 1}, {&__pyx_n_u_resources_2, __pyx_k_resources_2, sizeof(__pyx_k_resources_2), 0, 1, 0, 1}, {&__pyx_n_s_resp, __pyx_k_resp, sizeof(__pyx_k_resp), 0, 0, 1, 1}, {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1}, {&__pyx_n_s_responses, __pyx_k_responses, sizeof(__pyx_k_responses), 0, 0, 1, 1}, {&__pyx_n_s_resps, __pyx_k_resps, sizeof(__pyx_k_resps), 0, 0, 1, 1}, {&__pyx_n_s_restart, __pyx_k_restart, sizeof(__pyx_k_restart), 0, 0, 1, 1}, {&__pyx_n_u_restart, __pyx_k_restart, sizeof(__pyx_k_restart), 0, 1, 0, 1}, {&__pyx_n_s_restrictions, __pyx_k_restrictions, sizeof(__pyx_k_restrictions), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1}, {&__pyx_n_s_retire_workers, __pyx_k_retire_workers, sizeof(__pyx_k_retire_workers), 0, 0, 1, 1}, {&__pyx_n_u_retire_workers, __pyx_k_retire_workers, sizeof(__pyx_k_retire_workers), 0, 1, 0, 1}, {&__pyx_kp_u_retire_workers_2, __pyx_k_retire_workers_2, sizeof(__pyx_k_retire_workers_2), 0, 1, 0, 0}, {&__pyx_n_u_retired, __pyx_k_retired, sizeof(__pyx_k_retired), 0, 1, 0, 1}, {&__pyx_n_s_retries, __pyx_k_retries, sizeof(__pyx_k_retries), 0, 0, 1, 1}, {&__pyx_n_u_retries, __pyx_k_retries, sizeof(__pyx_k_retries), 0, 1, 0, 1}, {&__pyx_n_u_retries_2, __pyx_k_retries_2, sizeof(__pyx_k_retries_2), 0, 1, 0, 1}, {&__pyx_n_u_retry, __pyx_k_retry, sizeof(__pyx_k_retry), 0, 1, 0, 1}, {&__pyx_n_s_retry_operation, __pyx_k_retry_operation, sizeof(__pyx_k_retry_operation), 0, 0, 1, 1}, {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, {&__pyx_n_s_return_exceptions, __pyx_k_return_exceptions, sizeof(__pyx_k_return_exceptions), 0, 0, 1, 1}, {&__pyx_n_s_reuse, __pyx_k_reuse, sizeof(__pyx_k_reuse), 0, 0, 1, 1}, {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1}, {&__pyx_n_s_reverse_dict, __pyx_k_reverse_dict, sizeof(__pyx_k_reverse_dict), 0, 0, 1, 1}, {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, {&__pyx_n_s_roots, __pyx_k_roots, sizeof(__pyx_k_roots), 0, 0, 1, 1}, {&__pyx_n_s_round_robin, __pyx_k_round_robin, sizeof(__pyx_k_round_robin), 0, 0, 1, 1}, {&__pyx_n_s_routes, __pyx_k_routes, sizeof(__pyx_k_routes), 0, 0, 1, 1}, {&__pyx_n_s_rpc, __pyx_k_rpc, sizeof(__pyx_k_rpc), 0, 0, 1, 1}, {&__pyx_n_u_rprocessing, __pyx_k_rprocessing, sizeof(__pyx_k_rprocessing), 0, 1, 0, 1}, {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, {&__pyx_n_s_run_function, __pyx_k_run_function, sizeof(__pyx_k_run_function), 0, 0, 1, 1}, {&__pyx_n_u_run_function, __pyx_k_run_function, sizeof(__pyx_k_run_function), 0, 1, 0, 1}, {&__pyx_kp_u_run_function_2, __pyx_k_run_function_2, sizeof(__pyx_k_run_function_2), 0, 1, 0, 0}, {&__pyx_n_s_run_spec, __pyx_k_run_spec, sizeof(__pyx_k_run_spec), 0, 0, 1, 1}, {&__pyx_n_u_run_spec_2, __pyx_k_run_spec_2, sizeof(__pyx_k_run_spec_2), 0, 1, 0, 1}, {&__pyx_n_s_runnables, __pyx_k_runnables, sizeof(__pyx_k_runnables), 0, 0, 1, 1}, {&__pyx_n_s_running, __pyx_k_running, sizeof(__pyx_k_running), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_safe, __pyx_k_safe, sizeof(__pyx_k_safe), 0, 0, 1, 1}, {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1}, {&__pyx_n_u_saturated, __pyx_k_saturated, sizeof(__pyx_k_saturated), 0, 1, 0, 1}, {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1}, {&__pyx_n_s_scatter, __pyx_k_scatter, sizeof(__pyx_k_scatter), 0, 0, 1, 1}, {&__pyx_n_u_scatter, __pyx_k_scatter, sizeof(__pyx_k_scatter), 0, 1, 0, 1}, {&__pyx_n_s_scatter_to_workers, __pyx_k_scatter_to_workers, sizeof(__pyx_k_scatter_to_workers), 0, 0, 1, 1}, {&__pyx_n_s_scheduler, __pyx_k_scheduler, sizeof(__pyx_k_scheduler), 0, 0, 1, 1}, {&__pyx_n_u_scheduler, __pyx_k_scheduler, sizeof(__pyx_k_scheduler), 0, 1, 0, 1}, {&__pyx_n_s_scheduler_file, __pyx_k_scheduler_file, sizeof(__pyx_k_scheduler_file), 0, 0, 1, 1}, {&__pyx_n_s_searchpath, __pyx_k_searchpath, sizeof(__pyx_k_searchpath), 0, 0, 1, 1}, {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_security, __pyx_k_security, sizeof(__pyx_k_security), 0, 0, 1, 1}, {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_u_self_validate__s_not_found, __pyx_k_self_validate__s_not_found, sizeof(__pyx_k_self_validate__s_not_found), 0, 1, 0, 0}, {&__pyx_n_s_semaphore, __pyx_k_semaphore, sizeof(__pyx_k_semaphore), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, {&__pyx_n_s_send_all, __pyx_k_send_all, sizeof(__pyx_k_send_all), 0, 0, 1, 1}, {&__pyx_n_s_send_message, __pyx_k_send_message, sizeof(__pyx_k_send_message), 0, 0, 1, 1}, {&__pyx_n_s_send_recv, __pyx_k_send_recv, sizeof(__pyx_k_send_recv), 0, 0, 1, 1}, {&__pyx_n_s_send_task_to_worker, __pyx_k_send_task_to_worker, sizeof(__pyx_k_send_task_to_worker), 0, 0, 1, 1}, {&__pyx_n_s_sender, __pyx_k_sender, sizeof(__pyx_k_sender), 0, 0, 1, 1}, {&__pyx_n_s_sender_keys, __pyx_k_sender_keys, sizeof(__pyx_k_sender_keys), 0, 0, 1, 1}, {&__pyx_n_u_senders, __pyx_k_senders, sizeof(__pyx_k_senders), 0, 1, 0, 1}, {&__pyx_n_s_serializers, __pyx_k_serializers, sizeof(__pyx_k_serializers), 0, 0, 1, 1}, {&__pyx_n_s_server, __pyx_k_server, sizeof(__pyx_k_server), 0, 0, 1, 1}, {&__pyx_n_s_service_kwargs, __pyx_k_service_kwargs, sizeof(__pyx_k_service_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_service_name, __pyx_k_service_name, sizeof(__pyx_k_service_name), 0, 0, 1, 1}, {&__pyx_n_s_service_specs, __pyx_k_service_specs, sizeof(__pyx_k_service_specs), 0, 0, 1, 1}, {&__pyx_n_s_services, __pyx_k_services, sizeof(__pyx_k_services), 0, 0, 1, 1}, {&__pyx_n_u_services, __pyx_k_services, sizeof(__pyx_k_services), 0, 1, 0, 1}, {&__pyx_n_u_services_2, __pyx_k_services_2, sizeof(__pyx_k_services_2), 0, 1, 0, 1}, {&__pyx_n_s_set_duration_estimate, __pyx_k_set_duration_estimate, sizeof(__pyx_k_set_duration_estimate), 0, 0, 1, 1}, {&__pyx_n_s_set_metadata, __pyx_k_set_metadata, sizeof(__pyx_k_set_metadata), 0, 0, 1, 1}, {&__pyx_n_u_set_metadata, __pyx_k_set_metadata, sizeof(__pyx_k_set_metadata), 0, 1, 0, 1}, {&__pyx_n_u_set_resources, __pyx_k_set_resources, sizeof(__pyx_k_set_resources), 0, 1, 0, 1}, {&__pyx_n_s_set_trace, __pyx_k_set_trace, sizeof(__pyx_k_set_trace), 0, 0, 1, 1}, {&__pyx_n_s_setproctitle, __pyx_k_setproctitle, sizeof(__pyx_k_setproctitle), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 0, 0, 1, 1}, {&__pyx_n_s_setup_logging, __pyx_k_setup_logging, sizeof(__pyx_k_setup_logging), 0, 0, 1, 1}, {&__pyx_n_s_show_dashboard, __pyx_k_show_dashboard, sizeof(__pyx_k_show_dashboard), 0, 0, 1, 1}, {&__pyx_n_s_shutting_down, __pyx_k_shutting_down, sizeof(__pyx_k_shutting_down), 0, 0, 1, 1}, {&__pyx_n_s_sizing_mode, __pyx_k_sizing_mode, sizeof(__pyx_k_sizing_mode), 0, 0, 1, 1}, {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1}, {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, {&__pyx_n_s_sorted_workers, __pyx_k_sorted_workers, sizeof(__pyx_k_sorted_workers), 0, 0, 1, 1}, {&__pyx_n_s_sortedcontainers, __pyx_k_sortedcontainers, sizeof(__pyx_k_sortedcontainers), 0, 0, 1, 1}, {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, {&__pyx_n_s_stack, __pyx_k_stack, sizeof(__pyx_k_stack), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_u_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 1, 0, 1}, {&__pyx_n_s_start_address, __pyx_k_start_address, sizeof(__pyx_k_start_address), 0, 0, 1, 1}, {&__pyx_n_s_start_finish, __pyx_k_start_finish, sizeof(__pyx_k_start_finish), 0, 0, 1, 1}, {&__pyx_n_s_start_http_server, __pyx_k_start_http_server, sizeof(__pyx_k_start_http_server), 0, 0, 1, 1}, {&__pyx_n_s_start_ipython, __pyx_k_start_ipython, sizeof(__pyx_k_start_ipython), 0, 0, 1, 1}, {&__pyx_n_u_start_ipython, __pyx_k_start_ipython, sizeof(__pyx_k_start_ipython), 0, 1, 0, 1}, {&__pyx_n_s_start_periodic_callbacks, __pyx_k_start_periodic_callbacks, sizeof(__pyx_k_start_periodic_callbacks), 0, 0, 1, 1}, {&__pyx_n_s_start_services, __pyx_k_start_services, sizeof(__pyx_k_start_services), 0, 0, 1, 1}, {&__pyx_n_s_start_task_metadata, __pyx_k_start_task_metadata, sizeof(__pyx_k_start_task_metadata), 0, 0, 1, 1}, {&__pyx_n_u_start_task_metadata, __pyx_k_start_task_metadata, sizeof(__pyx_k_start_task_metadata), 0, 1, 0, 1}, {&__pyx_n_u_started, __pyx_k_started, sizeof(__pyx_k_started), 0, 1, 0, 1}, {&__pyx_n_s_startstops, __pyx_k_startstops, sizeof(__pyx_k_startstops), 0, 0, 1, 1}, {&__pyx_n_u_startstops, __pyx_k_startstops, sizeof(__pyx_k_startstops), 0, 1, 0, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_u_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 1, 0, 1}, {&__pyx_n_u_state_2, __pyx_k_state_2, sizeof(__pyx_k_state_2), 0, 1, 0, 1}, {&__pyx_n_s_states, __pyx_k_states, sizeof(__pyx_k_states), 0, 0, 1, 1}, {&__pyx_n_s_states_2, __pyx_k_states_2, sizeof(__pyx_k_states_2), 0, 0, 1, 1}, {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1}, {&__pyx_n_u_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 1, 0, 1}, {&__pyx_n_u_status_2, __pyx_k_status_2, sizeof(__pyx_k_status_2), 0, 1, 0, 1}, {&__pyx_n_s_stealing, __pyx_k_stealing, sizeof(__pyx_k_stealing), 0, 0, 1, 1}, {&__pyx_n_u_stealing, __pyx_k_stealing, sizeof(__pyx_k_stealing), 0, 1, 0, 1}, {&__pyx_n_s_stimulus_cancel, __pyx_k_stimulus_cancel, sizeof(__pyx_k_stimulus_cancel), 0, 0, 1, 1}, {&__pyx_n_s_stimulus_missing_data, __pyx_k_stimulus_missing_data, sizeof(__pyx_k_stimulus_missing_data), 0, 0, 1, 1}, {&__pyx_n_s_stimulus_retry, __pyx_k_stimulus_retry, sizeof(__pyx_k_stimulus_retry), 0, 0, 1, 1}, {&__pyx_n_s_stimulus_task_erred, __pyx_k_stimulus_task_erred, sizeof(__pyx_k_stimulus_task_erred), 0, 0, 1, 1}, {&__pyx_n_s_stimulus_task_finished, __pyx_k_stimulus_task_finished, sizeof(__pyx_k_stimulus_task_finished), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_u_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 1, 0, 1}, {&__pyx_n_s_stop_services, __pyx_k_stop_services, sizeof(__pyx_k_stop_services), 0, 0, 1, 1}, {&__pyx_n_s_stop_task_metadata, __pyx_k_stop_task_metadata, sizeof(__pyx_k_stop_task_metadata), 0, 0, 1, 1}, {&__pyx_n_u_stop_task_metadata, __pyx_k_stop_task_metadata, sizeof(__pyx_k_stop_task_metadata), 0, 1, 0, 1}, {&__pyx_n_s_story, __pyx_k_story, sizeof(__pyx_k_story), 0, 0, 1, 1}, {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1}, {&__pyx_kp_u_stream_closed, __pyx_k_stream_closed, sizeof(__pyx_k_stream_closed), 0, 1, 0, 0}, {&__pyx_n_s_stream_comms, __pyx_k_stream_comms, sizeof(__pyx_k_stream_comms), 0, 0, 1, 1}, {&__pyx_n_s_stream_handlers, __pyx_k_stream_handlers, sizeof(__pyx_k_stream_handlers), 0, 0, 1, 1}, {&__pyx_kp_u_stream_start, __pyx_k_stream_start, sizeof(__pyx_k_stream_start), 0, 1, 0, 0}, {&__pyx_n_u_stretch_both, __pyx_k_stretch_both, sizeof(__pyx_k_stretch_both), 0, 1, 0, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_stripped_deps, __pyx_k_stripped_deps, sizeof(__pyx_k_stripped_deps), 0, 0, 1, 1}, {&__pyx_n_s_submitting_task, __pyx_k_submitting_task, sizeof(__pyx_k_submitting_task), 0, 0, 1, 1}, {&__pyx_n_s_subscribe_worker_status, __pyx_k_subscribe_worker_status, sizeof(__pyx_k_subscribe_worker_status), 0, 0, 1, 1}, {&__pyx_n_u_subscribe_worker_status, __pyx_k_subscribe_worker_status, sizeof(__pyx_k_subscribe_worker_status), 0, 1, 0, 1}, {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, {&__pyx_n_s_summary, __pyx_k_summary, sizeof(__pyx_k_summary), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_suppress, __pyx_k_suppress, sizeof(__pyx_k_suppress), 0, 0, 1, 1}, {&__pyx_n_u_suspicious, __pyx_k_suspicious, sizeof(__pyx_k_suspicious), 0, 1, 0, 1}, {&__pyx_n_u_suspicious_2, __pyx_k_suspicious_2, sizeof(__pyx_k_suspicious_2), 0, 1, 0, 1}, {&__pyx_n_u_suspicious_tasks, __pyx_k_suspicious_tasks, sizeof(__pyx_k_suspicious_tasks), 0, 1, 0, 1}, {&__pyx_n_s_synchronize_worker_interval, __pyx_k_synchronize_worker_interval, sizeof(__pyx_k_synchronize_worker_interval), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_tabs, __pyx_k_tabs, sizeof(__pyx_k_tabs), 0, 0, 1, 1}, {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1}, {&__pyx_n_s_target_duration, __pyx_k_target_duration, sizeof(__pyx_k_target_duration), 0, 0, 1, 1}, {&__pyx_n_s_task, __pyx_k_task, sizeof(__pyx_k_task), 0, 0, 1, 1}, {&__pyx_n_u_task, __pyx_k_task, sizeof(__pyx_k_task), 0, 1, 0, 1}, {&__pyx_n_s_task_dict, __pyx_k_task_dict, sizeof(__pyx_k_task_dict), 0, 0, 1, 1}, {&__pyx_kp_u_task_erred, __pyx_k_task_erred, sizeof(__pyx_k_task_erred), 0, 1, 0, 0}, {&__pyx_kp_u_task_finished, __pyx_k_task_finished, sizeof(__pyx_k_task_finished), 0, 1, 0, 0}, {&__pyx_n_u_task_groups, __pyx_k_task_groups, sizeof(__pyx_k_task_groups), 0, 1, 0, 1}, {&__pyx_n_s_task_key_or_none, __pyx_k_task_key_or_none, sizeof(__pyx_k_task_key_or_none), 0, 0, 1, 1}, {&__pyx_n_u_task_prefixes, __pyx_k_task_prefixes, sizeof(__pyx_k_task_prefixes), 0, 1, 0, 1}, {&__pyx_kp_u_task_processing_without_all_deps, __pyx_k_task_processing_without_all_deps, sizeof(__pyx_k_task_processing_without_all_deps), 0, 1, 0, 0}, {&__pyx_kp_u_task_retried, __pyx_k_task_retried, sizeof(__pyx_k_task_retried), 0, 1, 0, 0}, {&__pyx_n_s_task_state_collections, __pyx_k_task_state_collections, sizeof(__pyx_k_task_state_collections), 0, 0, 1, 1}, {&__pyx_n_s_task_stream, __pyx_k_task_stream, sizeof(__pyx_k_task_stream), 0, 0, 1, 1}, {&__pyx_n_s_task_stream_figure, __pyx_k_task_stream_figure, sizeof(__pyx_k_task_stream_figure), 0, 0, 1, 1}, {&__pyx_n_s_tasks, __pyx_k_tasks, sizeof(__pyx_k_tasks), 0, 0, 1, 1}, {&__pyx_n_u_tasks, __pyx_k_tasks, sizeof(__pyx_k_tasks), 0, 1, 0, 1}, {&__pyx_n_s_tasks_by_worker, __pyx_k_tasks_by_worker, sizeof(__pyx_k_tasks_by_worker), 0, 0, 1, 1}, {&__pyx_n_s_tasks_processing, __pyx_k_tasks_processing, sizeof(__pyx_k_tasks_processing), 0, 0, 1, 1}, {&__pyx_n_s_tasks_timings, __pyx_k_tasks_timings, sizeof(__pyx_k_tasks_timings), 0, 0, 1, 1}, {&__pyx_n_s_teardown, __pyx_k_teardown, sizeof(__pyx_k_teardown), 0, 0, 1, 1}, {&__pyx_n_s_template, __pyx_k_template, sizeof(__pyx_k_template), 0, 0, 1, 1}, {&__pyx_n_s_template_directory, __pyx_k_template_directory, sizeof(__pyx_k_template_directory), 0, 0, 1, 1}, {&__pyx_n_s_template_environment, __pyx_k_template_environment, sizeof(__pyx_k_template_environment), 0, 0, 1, 1}, {&__pyx_n_u_templates, __pyx_k_templates, sizeof(__pyx_k_templates), 0, 1, 0, 1}, {&__pyx_n_u_terminate, __pyx_k_terminate, sizeof(__pyx_k_terminate), 0, 1, 0, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_tg, __pyx_k_tg, sizeof(__pyx_k_tg), 0, 0, 1, 1}, {&__pyx_n_s_threads, __pyx_k_threads, sizeof(__pyx_k_threads), 0, 0, 1, 1}, {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_u_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 1, 0, 1}, {&__pyx_kp_u_time_2, __pyx_k_time_2, sizeof(__pyx_k_time_2), 0, 1, 0, 0}, {&__pyx_n_u_time_delay, __pyx_k_time_delay, sizeof(__pyx_k_time_delay), 0, 1, 0, 1}, {&__pyx_n_s_time_started, __pyx_k_time_started, sizeof(__pyx_k_time_started), 0, 0, 1, 1}, {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, {&__pyx_n_s_timespent, __pyx_k_timespent, sizeof(__pyx_k_timespent), 0, 0, 1, 1}, {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1}, {&__pyx_n_s_tlz, __pyx_k_tlz, sizeof(__pyx_k_tlz), 0, 0, 1, 1}, {&__pyx_n_s_tmpfile, __pyx_k_tmpfile, sizeof(__pyx_k_tmpfile), 0, 0, 1, 1}, {&__pyx_n_s_to_close, __pyx_k_to_close, sizeof(__pyx_k_to_close), 0, 0, 1, 1}, {&__pyx_n_s_to_recipients, __pyx_k_to_recipients, sizeof(__pyx_k_to_recipients), 0, 0, 1, 1}, {&__pyx_n_s_to_senders, __pyx_k_to_senders, sizeof(__pyx_k_to_senders), 0, 0, 1, 1}, {&__pyx_n_s_topic, __pyx_k_topic, sizeof(__pyx_k_topic), 0, 0, 1, 1}, {&__pyx_n_s_tornado_ioloop, __pyx_k_tornado_ioloop, sizeof(__pyx_k_tornado_ioloop), 0, 0, 1, 1}, {&__pyx_n_s_total, __pyx_k_total, sizeof(__pyx_k_total), 0, 0, 1, 1}, {&__pyx_n_u_total, __pyx_k_total, sizeof(__pyx_k_total), 0, 1, 0, 1}, {&__pyx_kp_u_total_keys, __pyx_k_total_keys, sizeof(__pyx_k_total_keys), 0, 1, 0, 0}, {&__pyx_n_u_total_nthreads, __pyx_k_total_nthreads, sizeof(__pyx_k_total_nthreads), 0, 1, 0, 1}, {&__pyx_n_u_total_occupancy, __pyx_k_total_occupancy, sizeof(__pyx_k_total_occupancy), 0, 1, 0, 1}, {&__pyx_n_s_total_tasks, __pyx_k_total_tasks, sizeof(__pyx_k_total_tasks), 0, 0, 1, 1}, {&__pyx_n_s_touched_keys, __pyx_k_touched_keys, sizeof(__pyx_k_touched_keys), 0, 0, 1, 1}, {&__pyx_n_s_touched_tasks, __pyx_k_touched_tasks, sizeof(__pyx_k_touched_tasks), 0, 0, 1, 1}, {&__pyx_n_s_tp, __pyx_k_tp, sizeof(__pyx_k_tp), 0, 0, 1, 1}, {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, {&__pyx_n_u_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 1, 0, 1}, {&__pyx_n_u_traceback_2, __pyx_k_traceback_2, sizeof(__pyx_k_traceback_2), 0, 1, 0, 1}, {&__pyx_n_u_tracebacks, __pyx_k_tracebacks, sizeof(__pyx_k_tracebacks), 0, 1, 0, 1}, {&__pyx_n_s_transition, __pyx_k_transition, sizeof(__pyx_k_transition), 0, 0, 1, 1}, {&__pyx_n_s_transition_2, __pyx_k_transition_2, sizeof(__pyx_k_transition_2), 0, 0, 1, 1}, {&__pyx_n_s_transition_erred_released, __pyx_k_transition_erred_released, sizeof(__pyx_k_transition_erred_released), 0, 0, 1, 1}, {&__pyx_n_s_transition_log, __pyx_k_transition_log, sizeof(__pyx_k_transition_log), 0, 0, 1, 1}, {&__pyx_n_s_transition_memory_forgotten, __pyx_k_transition_memory_forgotten, sizeof(__pyx_k_transition_memory_forgotten), 0, 0, 1, 1}, {&__pyx_n_s_transition_memory_released, __pyx_k_transition_memory_released, sizeof(__pyx_k_transition_memory_released), 0, 0, 1, 1}, {&__pyx_n_s_transition_no_worker_released, __pyx_k_transition_no_worker_released, sizeof(__pyx_k_transition_no_worker_released), 0, 0, 1, 1}, {&__pyx_n_s_transition_no_worker_waiting, __pyx_k_transition_no_worker_waiting, sizeof(__pyx_k_transition_no_worker_waiting), 0, 0, 1, 1}, {&__pyx_n_s_transition_processing_erred, __pyx_k_transition_processing_erred, sizeof(__pyx_k_transition_processing_erred), 0, 0, 1, 1}, {&__pyx_n_s_transition_processing_memory, __pyx_k_transition_processing_memory, sizeof(__pyx_k_transition_processing_memory), 0, 0, 1, 1}, {&__pyx_n_s_transition_processing_released, __pyx_k_transition_processing_released, sizeof(__pyx_k_transition_processing_released), 0, 0, 1, 1}, {&__pyx_n_s_transition_released_erred, __pyx_k_transition_released_erred, sizeof(__pyx_k_transition_released_erred), 0, 0, 1, 1}, {&__pyx_n_s_transition_released_forgotten, __pyx_k_transition_released_forgotten, sizeof(__pyx_k_transition_released_forgotten), 0, 0, 1, 1}, {&__pyx_n_s_transition_released_waiting, __pyx_k_transition_released_waiting, sizeof(__pyx_k_transition_released_waiting), 0, 0, 1, 1}, {&__pyx_n_s_transition_story, __pyx_k_transition_story, sizeof(__pyx_k_transition_story), 0, 0, 1, 1}, {&__pyx_n_s_transition_waiting_memory, __pyx_k_transition_waiting_memory, sizeof(__pyx_k_transition_waiting_memory), 0, 0, 1, 1}, {&__pyx_n_s_transition_waiting_processing, __pyx_k_transition_waiting_processing, sizeof(__pyx_k_transition_waiting_processing), 0, 0, 1, 1}, {&__pyx_n_s_transition_waiting_released, __pyx_k_transition_waiting_released, sizeof(__pyx_k_transition_waiting_released), 0, 0, 1, 1}, {&__pyx_n_s_transitions, __pyx_k_transitions, sizeof(__pyx_k_transitions), 0, 0, 1, 1}, {&__pyx_n_s_transitions_2, __pyx_k_transitions_2, sizeof(__pyx_k_transitions_2), 0, 0, 1, 1}, {&__pyx_n_s_ts, __pyx_k_ts, sizeof(__pyx_k_ts), 0, 0, 1, 1}, {&__pyx_n_s_tsp, __pyx_k_tsp, sizeof(__pyx_k_tsp), 0, 0, 1, 1}, {&__pyx_n_s_tt, __pyx_k_tt, sizeof(__pyx_k_tt), 0, 0, 1, 1}, {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_u_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 1, 0, 1}, {&__pyx_n_u_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 1, 0, 1}, {&__pyx_n_s_typename, __pyx_k_typename, sizeof(__pyx_k_typename), 0, 0, 1, 1}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_n_u_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 1, 0, 1}, {&__pyx_n_s_undefined, __pyx_k_undefined, sizeof(__pyx_k_undefined), 0, 0, 1, 1}, {&__pyx_n_u_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 1, 0, 1}, {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1}, {&__pyx_n_u_unknown_durations, __pyx_k_unknown_durations, sizeof(__pyx_k_unknown_durations), 0, 1, 0, 1}, {&__pyx_kp_u_unneeded_task_in_memory, __pyx_k_unneeded_task_in_memory, sizeof(__pyx_k_unneeded_task_in_memory), 0, 1, 0, 0}, {&__pyx_n_s_unparse_host_port, __pyx_k_unparse_host_port, sizeof(__pyx_k_unparse_host_port), 0, 0, 1, 1}, {&__pyx_n_u_unregister, __pyx_k_unregister, sizeof(__pyx_k_unregister), 0, 1, 0, 1}, {&__pyx_n_s_unrunnable, __pyx_k_unrunnable, sizeof(__pyx_k_unrunnable), 0, 0, 1, 1}, {&__pyx_n_u_unrunnable, __pyx_k_unrunnable, sizeof(__pyx_k_unrunnable), 0, 1, 0, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_kp_u_update_data, __pyx_k_update_data, sizeof(__pyx_k_update_data), 0, 1, 0, 0}, {&__pyx_n_s_update_data_2, __pyx_k_update_data_2, sizeof(__pyx_k_update_data_2), 0, 0, 1, 1}, {&__pyx_n_u_update_data_2, __pyx_k_update_data_2, sizeof(__pyx_k_update_data_2), 0, 1, 0, 1}, {&__pyx_kp_u_update_graph, __pyx_k_update_graph, sizeof(__pyx_k_update_graph), 0, 1, 0, 0}, {&__pyx_n_s_update_graph_2, __pyx_k_update_graph_2, sizeof(__pyx_k_update_graph_2), 0, 0, 1, 1}, {&__pyx_n_u_update_graph_2, __pyx_k_update_graph_2, sizeof(__pyx_k_update_graph_2), 0, 1, 0, 1}, {&__pyx_kp_u_update_graph_duration, __pyx_k_update_graph_duration, sizeof(__pyx_k_update_graph_duration), 0, 1, 0, 0}, {&__pyx_kp_u_update_graph_hlg, __pyx_k_update_graph_hlg, sizeof(__pyx_k_update_graph_hlg), 0, 1, 0, 0}, {&__pyx_n_s_update_graph_hlg_2, __pyx_k_update_graph_hlg_2, sizeof(__pyx_k_update_graph_hlg_2), 0, 0, 1, 1}, {&__pyx_n_u_used_resources, __pyx_k_used_resources, sizeof(__pyx_k_used_resources), 0, 1, 0, 1}, {&__pyx_n_u_used_resources_2, __pyx_k_used_resources_2, sizeof(__pyx_k_used_resources_2), 0, 1, 0, 1}, {&__pyx_n_s_user_priority, __pyx_k_user_priority, sizeof(__pyx_k_user_priority), 0, 0, 1, 1}, {&__pyx_n_s_utils, __pyx_k_utils, sizeof(__pyx_k_utils), 0, 0, 1, 1}, {&__pyx_n_s_utils_comm, __pyx_k_utils_comm, sizeof(__pyx_k_utils_comm), 0, 0, 1, 1}, {&__pyx_n_s_utils_perf, __pyx_k_utils_perf, sizeof(__pyx_k_utils_perf), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_valid, __pyx_k_valid, sizeof(__pyx_k_valid), 0, 0, 1, 1}, {&__pyx_n_s_valid_workers, __pyx_k_valid_workers, sizeof(__pyx_k_valid_workers), 0, 0, 1, 1}, {&__pyx_n_s_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 0, 1, 1}, {&__pyx_n_u_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 1, 0, 1}, {&__pyx_n_u_validate_2, __pyx_k_validate_2, sizeof(__pyx_k_validate_2), 0, 1, 0, 1}, {&__pyx_n_s_validate_erred, __pyx_k_validate_erred, sizeof(__pyx_k_validate_erred), 0, 0, 1, 1}, {&__pyx_n_s_validate_key, __pyx_k_validate_key, sizeof(__pyx_k_validate_key), 0, 0, 1, 1}, {&__pyx_n_s_validate_memory, __pyx_k_validate_memory, sizeof(__pyx_k_validate_memory), 0, 0, 1, 1}, {&__pyx_n_s_validate_no_worker, __pyx_k_validate_no_worker, sizeof(__pyx_k_validate_no_worker), 0, 0, 1, 1}, {&__pyx_n_s_validate_processing, __pyx_k_validate_processing, sizeof(__pyx_k_validate_processing), 0, 0, 1, 1}, {&__pyx_n_s_validate_released, __pyx_k_validate_released, sizeof(__pyx_k_validate_released), 0, 0, 1, 1}, {&__pyx_n_s_validate_state, __pyx_k_validate_state, sizeof(__pyx_k_validate_state), 0, 0, 1, 1}, {&__pyx_n_s_validate_task_state, __pyx_k_validate_task_state, sizeof(__pyx_k_validate_task_state), 0, 0, 1, 1}, {&__pyx_n_s_validate_waiting, __pyx_k_validate_waiting, sizeof(__pyx_k_validate_waiting), 0, 0, 1, 1}, {&__pyx_n_s_validate_worker_state, __pyx_k_validate_worker_state, sizeof(__pyx_k_validate_worker_state), 0, 0, 1, 1}, {&__pyx_n_s_valmap, __pyx_k_valmap, sizeof(__pyx_k_valmap), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_variable, __pyx_k_variable, sizeof(__pyx_k_variable), 0, 0, 1, 1}, {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, {&__pyx_n_s_version_module, __pyx_k_version_module, sizeof(__pyx_k_version_module), 0, 0, 1, 1}, {&__pyx_n_s_version_warning, __pyx_k_version_warning, sizeof(__pyx_k_version_warning), 0, 0, 1, 1}, {&__pyx_n_s_versions, __pyx_k_versions, sizeof(__pyx_k_versions), 0, 0, 1, 1}, {&__pyx_n_u_versions, __pyx_k_versions, sizeof(__pyx_k_versions), 0, 1, 0, 1}, {&__pyx_n_u_versions_2, __pyx_k_versions_2, sizeof(__pyx_k_versions_2), 0, 1, 0, 1}, {&__pyx_n_s_vv, __pyx_k_vv, sizeof(__pyx_k_vv), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {&__pyx_n_s_wait_for, __pyx_k_wait_for, sizeof(__pyx_k_wait_for), 0, 0, 1, 1}, {&__pyx_kp_u_waiter_not_in_play, __pyx_k_waiter_not_in_play, sizeof(__pyx_k_waiter_not_in_play), 0, 1, 0, 0}, {&__pyx_n_u_waiters, __pyx_k_waiters, sizeof(__pyx_k_waiters), 0, 1, 0, 1}, {&__pyx_n_u_waiters_2, __pyx_k_waiters_2, sizeof(__pyx_k_waiters_2), 0, 1, 0, 1}, {&__pyx_kp_u_waiters_not_subset_of_dependents, __pyx_k_waiters_not_subset_of_dependents, sizeof(__pyx_k_waiters_not_subset_of_dependents), 0, 1, 0, 0}, {&__pyx_n_u_waiting, __pyx_k_waiting, sizeof(__pyx_k_waiting), 0, 1, 0, 1}, {&__pyx_n_u_waiting_data, __pyx_k_waiting_data, sizeof(__pyx_k_waiting_data), 0, 1, 0, 1}, {&__pyx_kp_u_waiting_not_subset_of_dependenci, __pyx_k_waiting_not_subset_of_dependenci, sizeof(__pyx_k_waiting_not_subset_of_dependenci), 0, 1, 0, 0}, {&__pyx_n_u_waiting_on, __pyx_k_waiting_on, sizeof(__pyx_k_waiting_on), 0, 1, 0, 1}, {&__pyx_n_u_waiting_on_2, __pyx_k_waiting_on_2, sizeof(__pyx_k_waiting_on_2), 0, 1, 0, 1}, {&__pyx_kp_u_waiting_on_in_memory_dep, __pyx_k_waiting_on_in_memory_dep, sizeof(__pyx_k_waiting_on_in_memory_dep), 0, 1, 0, 0}, {&__pyx_kp_u_waiting_on_released_dep, __pyx_k_waiting_on_released_dep, sizeof(__pyx_k_waiting_on_released_dep), 0, 1, 0, 0}, {&__pyx_n_u_wants_what, __pyx_k_wants_what, sizeof(__pyx_k_wants_what), 0, 1, 0, 1}, {&__pyx_n_u_wants_what_2, __pyx_k_wants_what_2, sizeof(__pyx_k_wants_what_2), 0, 1, 0, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, {&__pyx_n_s_wh, __pyx_k_wh, sizeof(__pyx_k_wh), 0, 0, 1, 1}, {&__pyx_n_s_who_has, __pyx_k_who_has, sizeof(__pyx_k_who_has), 0, 0, 1, 1}, {&__pyx_n_u_who_has, __pyx_k_who_has, sizeof(__pyx_k_who_has), 0, 1, 0, 1}, {&__pyx_n_u_who_has_2, __pyx_k_who_has_2, sizeof(__pyx_k_who_has_2), 0, 1, 0, 1}, {&__pyx_n_u_who_wants, __pyx_k_who_wants, sizeof(__pyx_k_who_wants), 0, 1, 0, 1}, {&__pyx_n_u_who_wants_2, __pyx_k_who_wants_2, sizeof(__pyx_k_who_wants_2), 0, 1, 0, 1}, {&__pyx_n_s_worker, __pyx_k_worker, sizeof(__pyx_k_worker), 0, 0, 1, 1}, {&__pyx_n_u_worker, __pyx_k_worker, sizeof(__pyx_k_worker), 0, 1, 0, 1}, {&__pyx_n_s_worker_address, __pyx_k_worker_address, sizeof(__pyx_k_worker_address), 0, 0, 1, 1}, {&__pyx_n_s_worker_bytes, __pyx_k_worker_bytes, sizeof(__pyx_k_worker_bytes), 0, 0, 1, 1}, {&__pyx_n_u_worker_bytes, __pyx_k_worker_bytes, sizeof(__pyx_k_worker_bytes), 0, 1, 0, 1}, {&__pyx_n_s_worker_collections, __pyx_k_worker_collections, sizeof(__pyx_k_worker_collections), 0, 0, 1, 1}, {&__pyx_n_s_worker_comm, __pyx_k_worker_comm, sizeof(__pyx_k_worker_comm), 0, 0, 1, 1}, {&__pyx_n_s_worker_coroutines, __pyx_k_worker_coroutines, sizeof(__pyx_k_worker_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_worker_handlers, __pyx_k_worker_handlers, sizeof(__pyx_k_worker_handlers), 0, 0, 1, 1}, {&__pyx_n_s_worker_index, __pyx_k_worker_index, sizeof(__pyx_k_worker_index), 0, 0, 1, 1}, {&__pyx_n_u_worker_info, __pyx_k_worker_info, sizeof(__pyx_k_worker_info), 0, 1, 0, 1}, {&__pyx_n_s_worker_keys, __pyx_k_worker_keys, sizeof(__pyx_k_worker_keys), 0, 0, 1, 1}, {&__pyx_n_u_worker_logs, __pyx_k_worker_logs, sizeof(__pyx_k_worker_logs), 0, 1, 0, 1}, {&__pyx_n_s_worker_msgs, __pyx_k_worker_msgs, sizeof(__pyx_k_worker_msgs), 0, 0, 1, 1}, {&__pyx_n_s_worker_objective, __pyx_k_worker_objective, sizeof(__pyx_k_worker_objective), 0, 0, 1, 1}, {&__pyx_n_s_worker_plugins, __pyx_k_worker_plugins, sizeof(__pyx_k_worker_plugins), 0, 0, 1, 1}, {&__pyx_kp_u_worker_plugins_2, __pyx_k_worker_plugins_2, sizeof(__pyx_k_worker_plugins_2), 0, 1, 0, 0}, {&__pyx_n_u_worker_resources, __pyx_k_worker_resources, sizeof(__pyx_k_worker_resources), 0, 1, 0, 1}, {&__pyx_n_u_worker_restrictions, __pyx_k_worker_restrictions, sizeof(__pyx_k_worker_restrictions), 0, 1, 0, 1}, {&__pyx_n_u_worker_restrictions_2, __pyx_k_worker_restrictions_2, sizeof(__pyx_k_worker_restrictions_2), 0, 1, 0, 1}, {&__pyx_n_s_worker_send, __pyx_k_worker_send, sizeof(__pyx_k_worker_send), 0, 0, 1, 1}, {&__pyx_n_s_worker_ttl, __pyx_k_worker_ttl, sizeof(__pyx_k_worker_ttl), 0, 0, 1, 1}, {&__pyx_kp_u_worker_ttl_2, __pyx_k_worker_ttl_2, sizeof(__pyx_k_worker_ttl_2), 0, 1, 0, 0}, {&__pyx_n_s_workers, __pyx_k_workers, sizeof(__pyx_k_workers), 0, 0, 1, 1}, {&__pyx_n_u_workers, __pyx_k_workers, sizeof(__pyx_k_workers), 0, 1, 0, 1}, {&__pyx_n_s_workers_by_task, __pyx_k_workers_by_task, sizeof(__pyx_k_workers_by_task), 0, 0, 1, 1}, {&__pyx_n_s_workers_list, __pyx_k_workers_list, sizeof(__pyx_k_workers_list), 0, 0, 1, 1}, {&__pyx_n_s_workers_to_close, __pyx_k_workers_to_close, sizeof(__pyx_k_workers_to_close), 0, 0, 1, 1}, {&__pyx_n_u_workers_to_close, __pyx_k_workers_to_close, sizeof(__pyx_k_workers_to_close), 0, 1, 0, 1}, {&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 0, 0, 1, 1}, {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {&__pyx_n_s_ws, __pyx_k_ws, sizeof(__pyx_k_ws), 0, 0, 1, 1}, {&__pyx_n_s_ww, __pyx_k_ww, sizeof(__pyx_k_ww), 0, 0, 1, 1}, {&__pyx_n_s_wws, __pyx_k_wws, sizeof(__pyx_k_wws), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 91, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 561, __pyx_L1_error) __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 702, __pyx_L1_error) __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(0, 710, __pyx_L1_error) __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 740, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 1468, __pyx_L1_error) __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 1659, __pyx_L1_error) __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 1900, __pyx_L1_error) __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_n_s_all); if (!__pyx_builtin_all) __PYX_ERR(0, 1946, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 3241, __pyx_L1_error) __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 3272, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 3316, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 3485, __pyx_L1_error) __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 3892, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 4978, __pyx_L1_error) __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 5059, __pyx_L1_error) __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 5085, __pyx_L1_error) __pyx_builtin_EnvironmentError = __Pyx_GetBuiltinName(__pyx_n_s_EnvironmentError); if (!__pyx_builtin_EnvironmentError) __PYX_ERR(0, 5628, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 5941, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "distributed/scheduler.py":138 * * def exceptval(*a, **k): * def wrapper(func): # <<<<<<<<<<<<<< * return func * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_func); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_wrapper, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 138, __pyx_L1_error) /* "distributed/scheduler.py":1625 * else: * self._clients = dict() * self._clients["fire-and-forget"] = ClientState("fire-and-forget") # <<<<<<<<<<<<<< * self._extensions = dict() * if host_info is not None: */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_fire_and_forget); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "distributed/scheduler.py":2219 * * if self._validate: * with log_errors(pdb=LOG_PDB): # <<<<<<<<<<<<<< * assert ts._exception_blame * assert not ts._who_has */ __pyx_tuple__12 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "distributed/scheduler.py":2949 * tasks = dict() * for old_attr, new_attr, wrap in [ * ("priority", "priority", None), # <<<<<<<<<<<<<< * ("dependencies", "dependencies", _legacy_task_key_set), * ("dependents", "dependents", _legacy_task_key_set), */ __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_u_priority, __pyx_n_u_priority, Py_None); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "distributed/scheduler.py":2952 * ("dependencies", "dependencies", _legacy_task_key_set), * ("dependents", "dependents", _legacy_task_key_set), * ("retries", "retries", None), # <<<<<<<<<<<<<< * ]: * func = operator.attrgetter(new_attr) */ __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_u_retries, __pyx_n_u_retries, Py_None); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 2952, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "distributed/scheduler.py":2960 * * for old_attr, new_attr, wrap in [ * ("nbytes", "nbytes", None), # <<<<<<<<<<<<<< * ("who_wants", "who_wants", _legacy_client_key_set), * ("who_has", "who_has", _legacy_worker_key_set), */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_u_nbytes, __pyx_n_u_nbytes, Py_None); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 2960, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "distributed/scheduler.py":2965 * ("waiting", "waiting_on", _legacy_task_key_set), * ("waiting_data", "waiters", _legacy_task_key_set), * ("rprocessing", "processing_on", None), # <<<<<<<<<<<<<< * ("host_restrictions", "host_restrictions", None), * ("worker_restrictions", "worker_restrictions", None), */ __pyx_tuple__18 = PyTuple_Pack(3, __pyx_n_u_rprocessing, __pyx_n_u_processing_on, Py_None); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 2965, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "distributed/scheduler.py":2966 * ("waiting_data", "waiters", _legacy_task_key_set), * ("rprocessing", "processing_on", None), * ("host_restrictions", "host_restrictions", None), # <<<<<<<<<<<<<< * ("worker_restrictions", "worker_restrictions", None), * ("resource_restrictions", "resource_restrictions", None), */ __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_u_host_restrictions, __pyx_n_u_host_restrictions, Py_None); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 2966, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "distributed/scheduler.py":2967 * ("rprocessing", "processing_on", None), * ("host_restrictions", "host_restrictions", None), * ("worker_restrictions", "worker_restrictions", None), # <<<<<<<<<<<<<< * ("resource_restrictions", "resource_restrictions", None), * ("suspicious_tasks", "suspicious", None), */ __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_u_worker_restrictions, __pyx_n_u_worker_restrictions, Py_None); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 2967, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "distributed/scheduler.py":2968 * ("host_restrictions", "host_restrictions", None), * ("worker_restrictions", "worker_restrictions", None), * ("resource_restrictions", "resource_restrictions", None), # <<<<<<<<<<<<<< * ("suspicious_tasks", "suspicious", None), * ("exceptions", "exception", None), */ __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_u_resource_restrictions, __pyx_n_u_resource_restrictions, Py_None); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2968, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "distributed/scheduler.py":2969 * ("worker_restrictions", "worker_restrictions", None), * ("resource_restrictions", "resource_restrictions", None), * ("suspicious_tasks", "suspicious", None), # <<<<<<<<<<<<<< * ("exceptions", "exception", None), * ("tracebacks", "traceback", None), */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_u_suspicious_tasks, __pyx_n_u_suspicious, Py_None); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 2969, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "distributed/scheduler.py":2970 * ("resource_restrictions", "resource_restrictions", None), * ("suspicious_tasks", "suspicious", None), * ("exceptions", "exception", None), # <<<<<<<<<<<<<< * ("tracebacks", "traceback", None), * ("exceptions_blame", "exception_blame", _task_key_or_none), */ __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_u_exceptions, __pyx_n_u_exception, Py_None); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 2970, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "distributed/scheduler.py":2971 * ("suspicious_tasks", "suspicious", None), * ("exceptions", "exception", None), * ("tracebacks", "traceback", None), # <<<<<<<<<<<<<< * ("exceptions_blame", "exception_blame", _task_key_or_none), * ]: */ __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_u_tracebacks, __pyx_n_u_traceback, Py_None); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 2971, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "distributed/scheduler.py":2980 * * for old_attr, new_attr, wrap in [ * ("loose_restrictions", "loose_restrictions", None) # <<<<<<<<<<<<<< * ]: * func = operator.attrgetter(new_attr) */ __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_u_loose_restrictions, __pyx_n_u_loose_restrictions, Py_None); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 2980, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "distributed/scheduler.py":2979 * setattr(self, old_attr, _OptionalStateLegacyMapping(tasks, func)) * * for old_attr, new_attr, wrap in [ # <<<<<<<<<<<<<< * ("loose_restrictions", "loose_restrictions", None) * ]: */ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_tuple__25); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "distributed/scheduler.py":3009 * workers = sortedcontainers.SortedDict() * for old_attr, new_attr, wrap in [ * ("nthreads", "nthreads", None), # <<<<<<<<<<<<<< * ("worker_bytes", "nbytes", None), * ("worker_resources", "resources", None), */ __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_u_nthreads, __pyx_n_u_nthreads, Py_None); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3009, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "distributed/scheduler.py":3010 * for old_attr, new_attr, wrap in [ * ("nthreads", "nthreads", None), * ("worker_bytes", "nbytes", None), # <<<<<<<<<<<<<< * ("worker_resources", "resources", None), * ("used_resources", "used_resources", None), */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_n_u_worker_bytes, __pyx_n_u_nbytes, Py_None); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3010, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "distributed/scheduler.py":3011 * ("nthreads", "nthreads", None), * ("worker_bytes", "nbytes", None), * ("worker_resources", "resources", None), # <<<<<<<<<<<<<< * ("used_resources", "used_resources", None), * ("occupancy", "occupancy", None), */ __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_u_worker_resources, __pyx_n_u_resources, Py_None); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 3011, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "distributed/scheduler.py":3012 * ("worker_bytes", "nbytes", None), * ("worker_resources", "resources", None), * ("used_resources", "used_resources", None), # <<<<<<<<<<<<<< * ("occupancy", "occupancy", None), * ("worker_info", "metrics", None), */ __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_u_used_resources, __pyx_n_u_used_resources, Py_None); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 3012, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "distributed/scheduler.py":3013 * ("worker_resources", "resources", None), * ("used_resources", "used_resources", None), * ("occupancy", "occupancy", None), # <<<<<<<<<<<<<< * ("worker_info", "metrics", None), * ("processing", "processing", _legacy_task_key_dict), */ __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_u_occupancy, __pyx_n_u_occupancy, Py_None); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 3013, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "distributed/scheduler.py":3014 * ("used_resources", "used_resources", None), * ("occupancy", "occupancy", None), * ("worker_info", "metrics", None), # <<<<<<<<<<<<<< * ("processing", "processing", _legacy_task_key_dict), * ("has_what", "has_what", _legacy_task_key_set), */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_u_worker_info, __pyx_n_u_metrics, Py_None); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 3014, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "distributed/scheduler.py":3120 * * self._transitions = { * ("released", "waiting"): self.transition_released_waiting, # <<<<<<<<<<<<<< * ("waiting", "released"): self.transition_waiting_released, * ("waiting", "processing"): self.transition_waiting_processing, */ __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_u_released, __pyx_n_u_waiting); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 3120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "distributed/scheduler.py":3121 * self._transitions = { * ("released", "waiting"): self.transition_released_waiting, * ("waiting", "released"): self.transition_waiting_released, # <<<<<<<<<<<<<< * ("waiting", "processing"): self.transition_waiting_processing, * ("waiting", "memory"): self.transition_waiting_memory, */ __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_u_waiting, __pyx_n_u_released); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 3121, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "distributed/scheduler.py":3122 * ("released", "waiting"): self.transition_released_waiting, * ("waiting", "released"): self.transition_waiting_released, * ("waiting", "processing"): self.transition_waiting_processing, # <<<<<<<<<<<<<< * ("waiting", "memory"): self.transition_waiting_memory, * ("processing", "released"): self.transition_processing_released, */ __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_u_waiting, __pyx_n_u_processing_2); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 3122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "distributed/scheduler.py":3123 * ("waiting", "released"): self.transition_waiting_released, * ("waiting", "processing"): self.transition_waiting_processing, * ("waiting", "memory"): self.transition_waiting_memory, # <<<<<<<<<<<<<< * ("processing", "released"): self.transition_processing_released, * ("processing", "memory"): self.transition_processing_memory, */ __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_u_waiting, __pyx_n_u_memory_2); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 3123, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "distributed/scheduler.py":3124 * ("waiting", "processing"): self.transition_waiting_processing, * ("waiting", "memory"): self.transition_waiting_memory, * ("processing", "released"): self.transition_processing_released, # <<<<<<<<<<<<<< * ("processing", "memory"): self.transition_processing_memory, * ("processing", "erred"): self.transition_processing_erred, */ __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_u_processing_2, __pyx_n_u_released); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 3124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "distributed/scheduler.py":3125 * ("waiting", "memory"): self.transition_waiting_memory, * ("processing", "released"): self.transition_processing_released, * ("processing", "memory"): self.transition_processing_memory, # <<<<<<<<<<<<<< * ("processing", "erred"): self.transition_processing_erred, * ("no-worker", "released"): self.transition_no_worker_released, */ __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_u_processing_2, __pyx_n_u_memory_2); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "distributed/scheduler.py":3126 * ("processing", "released"): self.transition_processing_released, * ("processing", "memory"): self.transition_processing_memory, * ("processing", "erred"): self.transition_processing_erred, # <<<<<<<<<<<<<< * ("no-worker", "released"): self.transition_no_worker_released, * ("no-worker", "waiting"): self.transition_no_worker_waiting, */ __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_u_processing_2, __pyx_n_u_erred); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 3126, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); /* "distributed/scheduler.py":3127 * ("processing", "memory"): self.transition_processing_memory, * ("processing", "erred"): self.transition_processing_erred, * ("no-worker", "released"): self.transition_no_worker_released, # <<<<<<<<<<<<<< * ("no-worker", "waiting"): self.transition_no_worker_waiting, * ("released", "forgotten"): self.transition_released_forgotten, */ __pyx_tuple__40 = PyTuple_Pack(2, __pyx_kp_u_no_worker, __pyx_n_u_released); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 3127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); /* "distributed/scheduler.py":3128 * ("processing", "erred"): self.transition_processing_erred, * ("no-worker", "released"): self.transition_no_worker_released, * ("no-worker", "waiting"): self.transition_no_worker_waiting, # <<<<<<<<<<<<<< * ("released", "forgotten"): self.transition_released_forgotten, * ("memory", "forgotten"): self.transition_memory_forgotten, */ __pyx_tuple__41 = PyTuple_Pack(2, __pyx_kp_u_no_worker, __pyx_n_u_waiting); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 3128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); /* "distributed/scheduler.py":3129 * ("no-worker", "released"): self.transition_no_worker_released, * ("no-worker", "waiting"): self.transition_no_worker_waiting, * ("released", "forgotten"): self.transition_released_forgotten, # <<<<<<<<<<<<<< * ("memory", "forgotten"): self.transition_memory_forgotten, * ("erred", "forgotten"): self.transition_released_forgotten, */ __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_u_released, __pyx_n_u_forgotten); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3129, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "distributed/scheduler.py":3130 * ("no-worker", "waiting"): self.transition_no_worker_waiting, * ("released", "forgotten"): self.transition_released_forgotten, * ("memory", "forgotten"): self.transition_memory_forgotten, # <<<<<<<<<<<<<< * ("erred", "forgotten"): self.transition_released_forgotten, * ("erred", "released"): self.transition_erred_released, */ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_u_memory_2, __pyx_n_u_forgotten); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 3130, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "distributed/scheduler.py":3131 * ("released", "forgotten"): self.transition_released_forgotten, * ("memory", "forgotten"): self.transition_memory_forgotten, * ("erred", "forgotten"): self.transition_released_forgotten, # <<<<<<<<<<<<<< * ("erred", "released"): self.transition_erred_released, * ("memory", "released"): self.transition_memory_released, */ __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_u_erred, __pyx_n_u_forgotten); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 3131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "distributed/scheduler.py":3132 * ("memory", "forgotten"): self.transition_memory_forgotten, * ("erred", "forgotten"): self.transition_released_forgotten, * ("erred", "released"): self.transition_erred_released, # <<<<<<<<<<<<<< * ("memory", "released"): self.transition_memory_released, * ("released", "erred"): self.transition_released_erred, */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_u_erred, __pyx_n_u_released); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 3132, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "distributed/scheduler.py":3133 * ("erred", "forgotten"): self.transition_released_forgotten, * ("erred", "released"): self.transition_erred_released, * ("memory", "released"): self.transition_memory_released, # <<<<<<<<<<<<<< * ("released", "erred"): self.transition_released_erred, * } */ __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_u_memory_2, __pyx_n_u_released); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 3133, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "distributed/scheduler.py":3134 * ("erred", "released"): self.transition_erred_released, * ("memory", "released"): self.transition_memory_released, * ("released", "erred"): self.transition_released_erred, # <<<<<<<<<<<<<< * } * */ __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_u_released, __pyx_n_u_erred); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 3134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "distributed/scheduler.py":3277 * fn = self.scheduler_file # remove file when we close the process * * def del_scheduler_file(): # <<<<<<<<<<<<<< * if os.path.exists(fn): * os.remove(fn) */ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_del_scheduler_file, 3277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 3277, __pyx_L1_error) /* "distributed/scheduler.py":3542 * parent._idle[ws._address] = ws * * for plugin in self.plugins[:]: # <<<<<<<<<<<<<< * try: * result = plugin.add_worker(scheduler=self, worker=address) */ __pyx_slice__57 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__57)) __PYX_ERR(0, 3542, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__57); __Pyx_GIVEREF(__pyx_slice__57); /* "distributed/scheduler.py":4185 * self.bandwidth_workers.pop((w, address), None) * * def remove_worker_from_events(): # <<<<<<<<<<<<<< * # If the worker isn't registered anymore after the delay, remove from events * if address not in parent._workers_dv and address in self.events: */ __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_remove_worker_from_events, 4185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 4185, __pyx_L1_error) /* "distributed/scheduler.py":4371 * * if not (set(parent._workers_dv) == set(self.stream_comms)): * raise ValueError("Workers not the same in all collections") # <<<<<<<<<<<<<< * * ws: WorkerState */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_u_Workers_not_the_same_in_all_coll); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4371, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "distributed/scheduler.py":4532 * logger.exception(e) * * def remove_client_from_events(): # <<<<<<<<<<<<<< * # If the client isn't registered anymore after the delay, remove from events * if client not in parent._clients and client in self.events: */ __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_remove_client_from_events, 4532, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 4532, __pyx_L1_error) /* "distributed/scheduler.py":4882 * await self.remove_worker(address=addr, close=addr not in nannies) * except Exception as e: * logger.info( # <<<<<<<<<<<<<< * "Exception while restarting. This is normal", exc_info=True * ) */ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_u_Exception_while_restarting_This); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 4882, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "distributed/scheduler.py":4965 * addresses = workers * * async def send_message(addr): # <<<<<<<<<<<<<< * comm = await self.rpc.connect(addr) * comm.name = "Scheduler Broadcast" */ __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_addr, __pyx_n_s_comm, __pyx_n_s_resp); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 4965, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_send_message, 4965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 4965, __pyx_L1_error) /* "distributed/scheduler.py":5191 * n = min(n, len(workers)) * if n == 0: * raise ValueError("Can not use replicate to delete data") # <<<<<<<<<<<<<< * * tasks = {parent._tasks[k] for k in keys} */ __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_u_Can_not_use_replicate_to_delete); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 5191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); /* "distributed/scheduler.py":5362 * total = sum(group_bytes.values()) * * def _key(group): # <<<<<<<<<<<<<< * wws: WorkerState * is_idle = not any([wws._processing for wws in groups[group]]) */ __pyx_tuple__78 = PyTuple_Pack(5, __pyx_n_s_group, __pyx_n_s_wws, __pyx_n_s_is_idle, __pyx_n_s_bytes, __pyx_n_s_wws); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 5362, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_key_2, 5362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 5362, __pyx_L1_error) /* "distributed/scheduler.py":5774 * try: * metadata = parent._task_metadata * for key in keys[:-1]: # <<<<<<<<<<<<<< * if key not in metadata or not isinstance(metadata[key], (dict, list)): * metadata[key] = dict() */ __pyx_slice__83 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__83)) __PYX_ERR(0, 5774, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__83); __Pyx_GIVEREF(__pyx_slice__83); /* "distributed/scheduler.py":5964 * plugin.transition(key, start, finish2, *args, **kwargs) * except Exception: * logger.info("Plugin failed with exception", exc_info=True) # <<<<<<<<<<<<<< * if ts._state == "forgotten": * del parent._tasks[ts._key] */ __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_u_Plugin_failed_with_exception); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 5964, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); /* "distributed/scheduler.py":6264 * from . import profile * * def profile_to_figure(state): # <<<<<<<<<<<<<< * data = profile.plot_data(state) * figure, source = profile.plot_figure(data, sizing_mode="stretch_both") */ __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_state, __pyx_n_s_data, __pyx_n_s_figure, __pyx_n_s_source); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 6264, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_profile_to_figure, 6264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 6264, __pyx_L1_error) /* "distributed/scheduler.py":6461 * * except Exception: * logger.error("Error in reevaluate occupancy", exc_info=True) # <<<<<<<<<<<<<< * raise * */ __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_u_Error_in_reevaluate_occupancy); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 6461, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); /* "distributed/scheduler.py":119 * bint = bool * * def cast(T, v, *a, **k): # <<<<<<<<<<<<<< * return v * */ __pyx_tuple__95 = PyTuple_Pack(4, __pyx_n_s_T, __pyx_n_s_v, __pyx_n_s_a, __pyx_n_s_k); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_cast, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 119, __pyx_L1_error) /* "distributed/scheduler.py":122 * return v * * def ccall(func): # <<<<<<<<<<<<<< * return func * */ __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_s_func); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_ccall, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 122, __pyx_L1_error) /* "distributed/scheduler.py":125 * return func * * def cclass(cls): # <<<<<<<<<<<<<< * return cls * */ __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_cclass, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 125, __pyx_L1_error) /* "distributed/scheduler.py":128 * return cls * * def cfunc(func): # <<<<<<<<<<<<<< * return func * */ __pyx_tuple__101 = PyTuple_Pack(1, __pyx_n_s_func); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_cfunc, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 128, __pyx_L1_error) /* "distributed/scheduler.py":131 * return func * * def declare(*a, **k): # <<<<<<<<<<<<<< * if len(a) == 2: * return a[1] */ __pyx_tuple__103 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_k); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_declare, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 131, __pyx_L1_error) /* "distributed/scheduler.py":137 * pass * * def exceptval(*a, **k): # <<<<<<<<<<<<<< * def wrapper(func): * return func */ __pyx_tuple__105 = PyTuple_Pack(4, __pyx_n_s_a, __pyx_n_s_k, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_exceptval, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 137, __pyx_L1_error) /* "distributed/scheduler.py":143 * return wrapper * * def final(cls): # <<<<<<<<<<<<<< * return cls * */ __pyx_tuple__107 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_final, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 143, __pyx_L1_error) /* "distributed/scheduler.py":146 * return cls * * def inline(func): # <<<<<<<<<<<<<< * return func * */ __pyx_tuple__109 = PyTuple_Pack(1, __pyx_n_s_func); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__109); __Pyx_GIVEREF(__pyx_tuple__109); __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_inline, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 146, __pyx_L1_error) /* "distributed/scheduler.py":149 * return func * * def nogil(func): # <<<<<<<<<<<<<< * return func * */ __pyx_tuple__111 = PyTuple_Pack(1, __pyx_n_s_func); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_nogil, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 149, __pyx_L1_error) /* "distributed/scheduler.py":153 * * * if sys.version_info < (3, 8): # <<<<<<<<<<<<<< * try: * import pickle5 as pickle */ __pyx_tuple__113 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_8); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); /* "distributed/scheduler.py":165 * * * LOG_PDB = dask.config.get("distributed.admin.pdb-on-err") # <<<<<<<<<<<<<< * DEFAULT_DATA_SIZE = declare( * Py_ssize_t, parse_bytes(dask.config.get("distributed.scheduler.default-data-size")) */ __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_u_distributed_admin_pdb_on_err); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); /* "distributed/scheduler.py":167 * LOG_PDB = dask.config.get("distributed.admin.pdb-on-err") * DEFAULT_DATA_SIZE = declare( * Py_ssize_t, parse_bytes(dask.config.get("distributed.scheduler.default-data-size")) # <<<<<<<<<<<<<< * ) * UNKNOWN_TASK_DURATION = declare( */ __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_u_distributed_scheduler_default_da); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__115); __Pyx_GIVEREF(__pyx_tuple__115); /* "distributed/scheduler.py":171 * UNKNOWN_TASK_DURATION = declare( * double, * parse_timedelta(dask.config.get("distributed.scheduler.unknown-task-duration")), # <<<<<<<<<<<<<< * ) * */ __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_u_distributed_scheduler_unknown_ta); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); /* "distributed/scheduler.py":220 * _versions: dict * * __slots__ = ("_client_key", "_hash", "_wants_what", "_last_seen", "_versions") # <<<<<<<<<<<<<< * * def __init__(self, client: str, versions: dict = None): */ __pyx_tuple__117 = PyTuple_Pack(5, __pyx_n_u_client_key, __pyx_n_u_hash, __pyx_n_u_wants_what_2, __pyx_n_u_last_seen_3, __pyx_n_u_versions_2); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); /* "distributed/scheduler.py":379 * * __slots__ = ( * "_actors", # <<<<<<<<<<<<<< * "_address", * "_bandwidth", */ __pyx_tuple__118 = PyTuple_Pack(24, __pyx_n_u_actors_2, __pyx_n_u_address_2, __pyx_n_u_bandwidth_2, __pyx_n_u_extra_2, __pyx_n_u_executing_2, __pyx_n_u_has_what_2, __pyx_n_u_hash, __pyx_n_u_last_seen_3, __pyx_n_u_local_directory_2, __pyx_n_u_memory_limit_2, __pyx_n_u_metrics_2, __pyx_n_u_name_4, __pyx_n_u_nanny_2, __pyx_n_u_nbytes_2, __pyx_n_u_nthreads_2, __pyx_n_u_occupancy_2, __pyx_n_u_pid_2, __pyx_n_u_processing_3, __pyx_n_u_resources_2, __pyx_n_u_services_2, __pyx_n_u_status_2, __pyx_n_u_time_delay, __pyx_n_u_used_resources_2, __pyx_n_u_versions_2); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); /* "distributed/scheduler.py":1145 * __slots__ = ( * # === General description === * "_actor", # <<<<<<<<<<<<<< * # Key name * "_key", */ __pyx_tuple__119 = PyTuple_Pack(30, __pyx_n_u_actor_2, __pyx_n_u_key_2, __pyx_n_u_hash, __pyx_n_u_prefix_2, __pyx_n_u_run_spec_2, __pyx_n_u_dependencies_2, __pyx_n_u_dependents_2, __pyx_n_u_priority_2, __pyx_n_u_host_restrictions_2, __pyx_n_u_worker_restrictions_2, __pyx_n_u_resource_restrictions_2, __pyx_n_u_loose_restrictions_2, __pyx_n_u_state_2, __pyx_n_u_has_lost_dependencies, __pyx_n_u_waiting_on_2, __pyx_n_u_waiters_2, __pyx_n_u_processing_on_2, __pyx_n_u_who_has_2, __pyx_n_u_who_wants_2, __pyx_n_u_exception_2, __pyx_n_u_traceback_2, __pyx_n_u_exception_blame_2, __pyx_n_u_suspicious_2, __pyx_n_u_retries_2, __pyx_n_u_nbytes_2, __pyx_n_u_type_2, __pyx_n_u_group_key, __pyx_n_u_group_2, __pyx_n_u_metadata_2, __pyx_n_u_annotations_2); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__119); __Pyx_GIVEREF(__pyx_tuple__119); /* "distributed/scheduler.py":1428 * """ * * def __init__(self, states, accessor): # <<<<<<<<<<<<<< * self._states = states * self._accessor = accessor */ __pyx_tuple__120 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_states, __pyx_n_s_accessor); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__120); __Pyx_GIVEREF(__pyx_tuple__120); __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_init, 1428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 1428, __pyx_L1_error) /* "distributed/scheduler.py":1432 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self._states) * */ __pyx_tuple__122 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_iter, 1432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 1432, __pyx_L1_error) /* "distributed/scheduler.py":1435 * return iter(self._states) * * def __len__(self): # <<<<<<<<<<<<<< * return len(self._states) * */ __pyx_tuple__124 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_len_2, 1435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 1435, __pyx_L1_error) /* "distributed/scheduler.py":1438 * return len(self._states) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self._accessor(self._states[key]) * */ __pyx_tuple__126 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_getitem, 1438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 1438, __pyx_L1_error) /* "distributed/scheduler.py":1441 * return self._accessor(self._states[key]) * * def __repr__(self): # <<<<<<<<<<<<<< * return "%s(%s)" % (self.__class__, dict(self)) * */ __pyx_tuple__128 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_repr, 1441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1441, __pyx_L1_error) /* "distributed/scheduler.py":1453 * # For tasks etc. * * def __iter__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * for k, v in self._states.items(): */ __pyx_tuple__130 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_accessor, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_iter, 1453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 1453, __pyx_L1_error) /* "distributed/scheduler.py":1459 * yield k * * def __len__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) */ __pyx_tuple__131 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_accessor, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1459, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_len_2, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 1459, __pyx_L1_error) /* "distributed/scheduler.py":1463 * return sum(bool(accessor(v)) for v in self._states.values()) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * v = self._accessor(self._states[key]) * if v: */ __pyx_tuple__133 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_v); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_getitem, 1463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 1463, __pyx_L1_error) /* "distributed/scheduler.py":1479 * # For loose_restrictions * * def __init__(self, states, accessor): # <<<<<<<<<<<<<< * self._states = states * self._accessor = accessor */ __pyx_tuple__135 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_states, __pyx_n_s_accessor); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_init, 1479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 1479, __pyx_L1_error) /* "distributed/scheduler.py":1483 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return (k for k, v in self._states.items() if self._accessor(v)) * */ __pyx_tuple__137 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 1483, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_iter, 1483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 1483, __pyx_L1_error) /* "distributed/scheduler.py":1486 * return (k for k, v in self._states.items() if self._accessor(v)) * * def __len__(self): # <<<<<<<<<<<<<< * return sum(map(bool, map(self._accessor, self._states.values()))) * */ __pyx_tuple__139 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139); __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_len_2, 1486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 1486, __pyx_L1_error) /* "distributed/scheduler.py":1489 * return sum(map(bool, map(self._accessor, self._states.values()))) * * def __contains__(self, k): # <<<<<<<<<<<<<< * st = self._states.get(k) * return st is not None and bool(self._accessor(st)) */ __pyx_tuple__141 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_k, __pyx_n_s_st); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_contains, 1489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 1489, __pyx_L1_error) /* "distributed/scheduler.py":1493 * return st is not None and bool(self._accessor(st)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "%s(%s)" % (self.__class__, set(self)) * */ __pyx_tuple__143 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_repr, 1493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 1493, __pyx_L1_error) /* "distributed/scheduler.py":1497 * * * def _legacy_task_key_set(tasks): # <<<<<<<<<<<<<< * """ * Transform a set of task states into a set of task keys. */ __pyx_tuple__145 = PyTuple_Pack(3, __pyx_n_s_tasks, __pyx_n_s_ts, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 1497, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_legacy_task_key_set, 1497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 1497, __pyx_L1_error) /* "distributed/scheduler.py":1505 * * * def _legacy_client_key_set(clients): # <<<<<<<<<<<<<< * """ * Transform a set of client states into a set of client keys. */ __pyx_tuple__147 = PyTuple_Pack(3, __pyx_n_s_clients, __pyx_n_s_cs, __pyx_n_s_cs); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_legacy_client_key_set, 1505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 1505, __pyx_L1_error) /* "distributed/scheduler.py":1513 * * * def _legacy_worker_key_set(workers): # <<<<<<<<<<<<<< * """ * Transform a set of worker states into a set of worker keys. */ __pyx_tuple__149 = PyTuple_Pack(3, __pyx_n_s_workers, __pyx_n_s_ws, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 1513, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__149); __Pyx_GIVEREF(__pyx_tuple__149); __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_legacy_worker_key_set, 1513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 1513, __pyx_L1_error) /* "distributed/scheduler.py":1521 * * * def _legacy_task_key_dict(task_dict): # <<<<<<<<<<<<<< * """ * Transform a dict of {task state: value} into a dict of {task key: value}. */ __pyx_tuple__151 = PyTuple_Pack(4, __pyx_n_s_task_dict, __pyx_n_s_ts, __pyx_n_s_ts, __pyx_n_s_value); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 1521, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151); __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_legacy_task_key_dict, 1521, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 1521, __pyx_L1_error) /* "distributed/scheduler.py":1529 * * * def _task_key_or_none(task): # <<<<<<<<<<<<<< * return task.key if task is not None else None * */ __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_task); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 1529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_task_key_or_none, 1529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 1529, __pyx_L1_error) /* "distributed/scheduler.py":2837 * _instances = weakref.WeakSet() * * def __init__( # <<<<<<<<<<<<<< * self, * loop=None, */ __pyx_tuple__155 = PyTuple_Pack(45, __pyx_n_s_self, __pyx_n_s_loop, __pyx_n_s_delete_interval, __pyx_n_s_synchronize_worker_interval, __pyx_n_s_services, __pyx_n_s_service_kwargs, __pyx_n_s_allowed_failures, __pyx_n_s_extensions, __pyx_n_s_validate, __pyx_n_s_scheduler_file, __pyx_n_s_security, __pyx_n_s_worker_ttl, __pyx_n_s_idle_timeout, __pyx_n_s_interface, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_protocol, __pyx_n_s_dashboard_address, __pyx_n_s_dashboard, __pyx_n_s_http_prefix, __pyx_n_s_preload, __pyx_n_s_preload_argv, __pyx_n_s_plugins, __pyx_n_s_kwargs, __pyx_n_s_http_server_modules, __pyx_n_s_show_dashboard, __pyx_n_s_missing_bokeh, __pyx_n_s_distributed, __pyx_n_s_routes, __pyx_n_s_tasks, __pyx_n_s_old_attr, __pyx_n_s_new_attr, __pyx_n_s_wrap, __pyx_n_s_func, __pyx_n_s_unrunnable, __pyx_n_s_clients, __pyx_n_s_workers, __pyx_n_s_host_info, __pyx_n_s_resources, __pyx_n_s_aliases, __pyx_n_s_worker_handlers, __pyx_n_s_client_handlers, __pyx_n_s_connection_limit, __pyx_n_s_pc, __pyx_n_s_ext); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 2837, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155); __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(23, 0, 45, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_init, 2837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 2837, __pyx_L1_error) __pyx_tuple__157 = PyTuple_Pack(22, ((PyObject *)Py_None), ((PyObject*)__pyx_kp_u_500ms), ((PyObject*)__pyx_kp_u_60s), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)__pyx_int_0), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_kp_u__14), ((PyObject *)Py_None), ((PyObject*)__pyx_empty_tuple), ((PyObject*)__pyx_empty_tuple)); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 2837, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__157); __Pyx_GIVEREF(__pyx_tuple__157); /* "distributed/scheduler.py":3181 * ################## * * def __repr__(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * return '' % ( */ __pyx_tuple__158 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 3181, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__158); __Pyx_GIVEREF(__pyx_tuple__158); __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_repr, 3181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 3181, __pyx_L1_error) /* "distributed/scheduler.py":3189 * ) * * def identity(self, comm=None): # <<<<<<<<<<<<<< * """ Basic information about ourselves and our cluster """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_tuple__160 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_parent, __pyx_n_s_d, __pyx_n_s_key, __pyx_n_s_v, __pyx_n_s_worker); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 3189, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__160); __Pyx_GIVEREF(__pyx_tuple__160); __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_identity, 3189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 3189, __pyx_L1_error) __pyx_tuple__162 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 3189, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__162); __Pyx_GIVEREF(__pyx_tuple__162); /* "distributed/scheduler.py":3204 * return d * * def get_worker_service_addr(self, worker, service_name, protocol=False): # <<<<<<<<<<<<<< * """ * Get the (host, port) address of the named service on the *worker*. */ __pyx_tuple__163 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_worker, __pyx_n_s_service_name, __pyx_n_s_protocol, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_port); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 3204, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__163); __Pyx_GIVEREF(__pyx_tuple__163); __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_worker_service_addr, 3204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 3204, __pyx_L1_error) __pyx_tuple__165 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 3204, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__165); __Pyx_GIVEREF(__pyx_tuple__165); /* "distributed/scheduler.py":3232 * return ws.host, port * * async def start(self): # <<<<<<<<<<<<<< * """ Clear out old state and restart all running coroutines """ * await super().start() */ __pyx_tuple__166 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_c, __pyx_n_s_addr, __pyx_n_s_listen_ip, __pyx_n_s_listener, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_f, __pyx_n_s_fn, __pyx_n_s_del_scheduler_file, __pyx_n_s_del_scheduler_file, __pyx_n_s_preload, __pyx_n_s_plugin); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 3232, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__166); __Pyx_GIVEREF(__pyx_tuple__166); __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_start, 3232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 3232, __pyx_L1_error) /* "distributed/scheduler.py":3293 * return self * * async def close(self, comm=None, fast=False, close_workers=False): # <<<<<<<<<<<<<< * """Send cleanup signal to all coroutines then wait until finished * */ __pyx_tuple__167 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_fast, __pyx_n_s_close_workers, __pyx_n_s_parent, __pyx_n_s_preload, __pyx_n_s_worker, __pyx_n_s_i, __pyx_n_s_pc, __pyx_n_s_ext, __pyx_n_s_futures, __pyx_n_s_w, __pyx_n_s_future, __pyx_n_s_plugin); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__167); __Pyx_GIVEREF(__pyx_tuple__167); __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_close, 3293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 3293, __pyx_L1_error) __pyx_tuple__168 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__168); __Pyx_GIVEREF(__pyx_tuple__168); /* "distributed/scheduler.py":3358 * disable_gc_diagnosis() * * async def close_worker(self, comm=None, worker=None, safe=None): # <<<<<<<<<<<<<< * """Remove a worker from the cluster * */ __pyx_tuple__169 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_worker, __pyx_n_s_safe, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_nanny_addr, __pyx_n_s_address); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 3358, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__169); __Pyx_GIVEREF(__pyx_tuple__169); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_close_worker, 3358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 3358, __pyx_L1_error) __pyx_tuple__170 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 3358, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__170); __Pyx_GIVEREF(__pyx_tuple__170); /* "distributed/scheduler.py":3380 * ########### * * def heartbeat_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__171 = PyTuple_Pack(22, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_address, __pyx_n_s_resolve_address, __pyx_n_s_now, __pyx_n_s_resources, __pyx_n_s_host_info, __pyx_n_s_metrics, __pyx_n_s_executing, __pyx_n_s_parent, __pyx_n_s_host, __pyx_n_s_local_now, __pyx_n_s_frac, __pyx_n_s_other, __pyx_n_s_bw, __pyx_n_s_count, __pyx_n_s_alpha, __pyx_n_s_typ, __pyx_n_s_ws, __pyx_n_s_delay, __pyx_n_s_key, __pyx_n_s_duration); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 3380, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__171); __Pyx_GIVEREF(__pyx_tuple__171); __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(9, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_heartbeat_worker, 3380, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 3380, __pyx_L1_error) __pyx_tuple__173 = PyTuple_Pack(8, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_True), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 3380, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__173); __Pyx_GIVEREF(__pyx_tuple__173); /* "distributed/scheduler.py":3454 * } * * async def add_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__174 = PyTuple_Pack(39, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_address, __pyx_n_s_keys, __pyx_n_s_nthreads, __pyx_n_s_name, __pyx_n_s_resolve_address, __pyx_n_s_nbytes, __pyx_n_s_types, __pyx_n_s_now, __pyx_n_s_resources, __pyx_n_s_host_info, __pyx_n_s_memory_limit, __pyx_n_s_metrics, __pyx_n_s_pid, __pyx_n_s_services, __pyx_n_s_local_directory, __pyx_n_s_versions, __pyx_n_s_nanny, __pyx_n_s_extra, __pyx_n_s_parent, __pyx_n_s_host, __pyx_n_s_ws, __pyx_n_s_msg, __pyx_n_s_response, __pyx_n_s_plugin, __pyx_n_s_result, __pyx_n_s_e, __pyx_n_s_recommendations, __pyx_n_s_key, __pyx_n_s_tasks, __pyx_n_s_ts, __pyx_n_s_valid, __pyx_n_s_cs, __pyx_n_s_version_warning, __pyx_n_s_w, __pyx_n_s_ws, __pyx_n_s_c, __pyx_n_s_cs); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 3454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__174); __Pyx_GIVEREF(__pyx_tuple__174); __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(20, 0, 39, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_add_worker, 3454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 3454, __pyx_L1_error) __pyx_tuple__175 = PyTuple_Pack(19, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_empty_tuple), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_True), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)__pyx_int_0), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 3454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__175); __Pyx_GIVEREF(__pyx_tuple__175); /* "distributed/scheduler.py":3605 * await self.handle_worker(comm=comm, worker=address) * * def update_graph_hlg( # <<<<<<<<<<<<<< * self, * client=None, */ __pyx_tuple__176 = PyTuple_Pack(23, __pyx_n_s_self, __pyx_n_s_client, __pyx_n_s_hlg, __pyx_n_s_keys, __pyx_n_s_dependencies, __pyx_n_s_restrictions, __pyx_n_s_priority, __pyx_n_s_loose_restrictions, __pyx_n_s_resources, __pyx_n_s_submitting_task, __pyx_n_s_retries, __pyx_n_s_user_priority, __pyx_n_s_actors, __pyx_n_s_fifo_timeout, __pyx_n_s_annotations, __pyx_n_s_dsk, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_deps, __pyx_n_s_dsk_keys, __pyx_n_s_stripped_deps, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 3605, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__176); __Pyx_GIVEREF(__pyx_tuple__176); __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(15, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_update_graph_hlg_2, 3605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 3605, __pyx_L1_error) __pyx_tuple__178 = PyTuple_Pack(14, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)__pyx_int_0), ((PyObject *)Py_None), ((PyObject *)__pyx_int_0), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 3605, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__178); __Pyx_GIVEREF(__pyx_tuple__178); /* "distributed/scheduler.py":3659 * ) * * def update_graph( # <<<<<<<<<<<<<< * self, * client=None, */ __pyx_tuple__179 = PyTuple_Pack(49, __pyx_n_s_self, __pyx_n_s_client, __pyx_n_s_tasks, __pyx_n_s_keys, __pyx_n_s_dependencies, __pyx_n_s_restrictions, __pyx_n_s_priority, __pyx_n_s_loose_restrictions, __pyx_n_s_resources, __pyx_n_s_submitting_task, __pyx_n_s_retries, __pyx_n_s_user_priority, __pyx_n_s_actors, __pyx_n_s_fifo_timeout, __pyx_n_s_annotations, __pyx_n_s_parent, __pyx_n_s_start, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_deps, __pyx_n_s_ts, __pyx_n_s_already_in_memory, __pyx_n_s_v, __pyx_n_s_dts, __pyx_n_s_dependents, __pyx_n_s_stack, __pyx_n_s_done, __pyx_n_s_key, __pyx_n_s_dep, __pyx_n_s_child_deps, __pyx_n_s_d, __pyx_n_s_touched_keys, __pyx_n_s_touched_tasks, __pyx_n_s_a, __pyx_n_s_kv, __pyx_n_s_actor, __pyx_n_s_generation, __pyx_n_s_runnables, __pyx_n_s_w, __pyx_n_s_recommendations, __pyx_n_s_plugin, __pyx_n_s_e, __pyx_n_s_end, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_k, __pyx_n_s_genexpr, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 3659, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__179); __Pyx_GIVEREF(__pyx_tuple__179); __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(15, 0, 49, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_update_graph_2, 3659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 3659, __pyx_L1_error) __pyx_tuple__181 = PyTuple_Pack(14, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)__pyx_int_0), ((PyObject *)Py_None), ((PyObject *)__pyx_int_0), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 3659, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__181); __Pyx_GIVEREF(__pyx_tuple__181); /* "distributed/scheduler.py":3932 * # TODO: balance workers * * def new_task(self, key, spec, state): # <<<<<<<<<<<<<< * """ Create a new task, and associated states """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_tuple__182 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_spec, __pyx_n_s_state, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_tp, __pyx_n_s_tg, __pyx_n_s_prefix_key, __pyx_n_s_group_key_2); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 3932, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__182); __Pyx_GIVEREF(__pyx_tuple__182); __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_new_task, 3932, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 3932, __pyx_L1_error) /* "distributed/scheduler.py":3955 * return ts * * def stimulus_task_finished(self, key=None, worker=None, **kwargs): # <<<<<<<<<<<<<< * """ Mark that a task has finished execution on a particular worker """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_tuple__184 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_worker, __pyx_n_s_kwargs, __pyx_n_s_parent, __pyx_n_s_tasks, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_recommendations); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 3955, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__184); __Pyx_GIVEREF(__pyx_tuple__184); __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_stimulus_task_finished, 3955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 3955, __pyx_L1_error) __pyx_tuple__186 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 3955, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__186); __Pyx_GIVEREF(__pyx_tuple__186); /* "distributed/scheduler.py":3988 * return recommendations * * def stimulus_task_erred( # <<<<<<<<<<<<<< * self, key=None, worker=None, exception=None, traceback=None, **kwargs * ): */ __pyx_tuple__187 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_worker, __pyx_n_s_exception, __pyx_n_s_traceback, __pyx_n_s_kwargs, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_recommendations, __pyx_n_s_retries); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 3988, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__187); __Pyx_GIVEREF(__pyx_tuple__187); __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_stimulus_task_erred, 3988, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 3988, __pyx_L1_error) __pyx_tuple__189 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 3988, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__189); __Pyx_GIVEREF(__pyx_tuple__189); /* "distributed/scheduler.py":4020 * return recommendations * * def stimulus_missing_data( # <<<<<<<<<<<<<< * self, cause=None, key=None, worker=None, ensure=True, **kwargs * ): */ __pyx_tuple__190 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_cause, __pyx_n_s_key, __pyx_n_s_worker, __pyx_n_s_ensure, __pyx_n_s_kwargs, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_cts, __pyx_n_s_recommendations, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 4020, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__190); __Pyx_GIVEREF(__pyx_tuple__190); __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_stimulus_missing_data, 4020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 4020, __pyx_L1_error) __pyx_tuple__192 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 4020, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__192); __Pyx_GIVEREF(__pyx_tuple__192); /* "distributed/scheduler.py":4053 * return {} * * def stimulus_retry(self, comm=None, keys=None, client=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Client %s requests to retry %d keys", client, len(keys)) */ __pyx_tuple__193 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_client, __pyx_n_s_parent, __pyx_n_s_stack, __pyx_n_s_seen, __pyx_n_s_roots, __pyx_n_s_ts, __pyx_n_s_dts, __pyx_n_s_key, __pyx_n_s_erred_deps, __pyx_n_s_recommendations, __pyx_n_s_dts, __pyx_n_s_key); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__193); __Pyx_GIVEREF(__pyx_tuple__193); __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_stimulus_retry, 4053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 4053, __pyx_L1_error) __pyx_tuple__195 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__195); __Pyx_GIVEREF(__pyx_tuple__195); /* "distributed/scheduler.py":4083 * return tuple(seen) * * async def remove_worker(self, comm=None, address=None, safe=False, close=True): # <<<<<<<<<<<<<< * """ * Remove worker from cluster */ __pyx_tuple__196 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_address, __pyx_n_s_safe, __pyx_n_s_close, __pyx_n_s_parent, __pyx_n_s_host, __pyx_n_s_ws, __pyx_n_s_recommendations, __pyx_n_s_ts, __pyx_n_s_k, __pyx_n_s_e, __pyx_n_s_r, __pyx_n_s_plugin, __pyx_n_s_result, __pyx_n_s_w, __pyx_n_s_remove_worker_from_events, __pyx_n_s_remove_worker_from_events, __pyx_n_s_cleanup_delay); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 4083, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__196); __Pyx_GIVEREF(__pyx_tuple__196); __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_remove_worker, 4083, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 4083, __pyx_L1_error) __pyx_tuple__197 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 4083, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__197); __Pyx_GIVEREF(__pyx_tuple__197); /* "distributed/scheduler.py":4198 * return "OK" * * def stimulus_cancel(self, comm, keys=None, client=None, force=False): # <<<<<<<<<<<<<< * """ Stop execution on a list of keys """ * logger.info("Client %s requests to cancel %d keys", client, len(keys)) */ __pyx_tuple__198 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_client, __pyx_n_s_force, __pyx_n_s_key); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 4198, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__198); __Pyx_GIVEREF(__pyx_tuple__198); __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_stimulus_cancel, 4198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 4198, __pyx_L1_error) __pyx_tuple__200 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 4198, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__200); __Pyx_GIVEREF(__pyx_tuple__200); /* "distributed/scheduler.py":4208 * self.cancel_key(key, client, force=force) * * def cancel_key(self, key, client, retries=5, force=False): # <<<<<<<<<<<<<< * """ Cancel a particular key and all dependents """ * # TODO: this should be converted to use the transition mechanism */ __pyx_tuple__201 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_client, __pyx_n_s_retries, __pyx_n_s_force, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_dts, __pyx_n_s_cs, __pyx_n_s_clients); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__201); __Pyx_GIVEREF(__pyx_tuple__201); __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_cancel_key, 4208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 4208, __pyx_L1_error) __pyx_tuple__203 = PyTuple_Pack(2, ((PyObject *)__pyx_int_5), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__203); __Pyx_GIVEREF(__pyx_tuple__203); /* "distributed/scheduler.py":4233 * self.client_releases_keys(keys=[key], client=cs._client_key) * * def client_desires_keys(self, keys=None, client=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients.get(client) */ __pyx_tuple__204 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_keys, __pyx_n_s_client, __pyx_n_s_parent, __pyx_n_s_cs, __pyx_n_s_ts, __pyx_n_s_k); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 4233, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__204); __Pyx_GIVEREF(__pyx_tuple__204); __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_client_desires_keys_2, 4233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 4233, __pyx_L1_error) __pyx_tuple__206 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 4233, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__206); __Pyx_GIVEREF(__pyx_tuple__206); /* "distributed/scheduler.py":4251 * self.report_on_key(ts=ts, client=client) * * def client_releases_keys(self, keys=None, client=None): # <<<<<<<<<<<<<< * """ Remove keys from client desired list """ * */ __pyx_tuple__207 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_keys, __pyx_n_s_client, __pyx_n_s_parent, __pyx_n_s_cs, __pyx_n_s_recommendations); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 4251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__207); __Pyx_GIVEREF(__pyx_tuple__207); __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_client_releases_keys_2, 4251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 4251, __pyx_L1_error) __pyx_tuple__209 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 4251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__209); __Pyx_GIVEREF(__pyx_tuple__209); /* "distributed/scheduler.py":4263 * self.transitions(recommendations) * * def client_heartbeat(self, client=None): # <<<<<<<<<<<<<< * """ Handle heartbeats from Client """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_tuple__210 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_client, __pyx_n_s_parent, __pyx_n_s_cs); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 4263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__210); __Pyx_GIVEREF(__pyx_tuple__210); __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_client_heartbeat, 4263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 4263, __pyx_L1_error) __pyx_tuple__212 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 4263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__212); __Pyx_GIVEREF(__pyx_tuple__212); /* "distributed/scheduler.py":4273 * ################### * * def validate_released(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_tuple__213 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_dts, __pyx_n_s_dts); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 4273, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__213); __Pyx_GIVEREF(__pyx_tuple__213); __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_released, 4273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(0, 4273, __pyx_L1_error) /* "distributed/scheduler.py":4285 * assert ts not in parent._unrunnable * * def validate_waiting(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_tuple__215 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_dts); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 4285, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__215); __Pyx_GIVEREF(__pyx_tuple__215); __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_waiting, 4285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 4285, __pyx_L1_error) /* "distributed/scheduler.py":4298 * assert ts in dts._waiters # XXX even if dts._who_has? * * def validate_processing(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_tuple__217 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_dts, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 4298, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__217); __Pyx_GIVEREF(__pyx_tuple__217); __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_processing, 4298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(0, 4298, __pyx_L1_error) /* "distributed/scheduler.py":4311 * assert ts in dts._waiters * * def validate_memory(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_tuple__219 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_dts); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 4311, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__219); __Pyx_GIVEREF(__pyx_tuple__219); __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_memory, 4311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 4311, __pyx_L1_error) /* "distributed/scheduler.py":4323 * assert ts not in dts._waiting_on * * def validate_no_worker(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_tuple__221 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_dts); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(0, 4323, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__221); __Pyx_GIVEREF(__pyx_tuple__221); __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_no_worker, 4323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(0, 4323, __pyx_L1_error) /* "distributed/scheduler.py":4335 * assert dts._who_has * * def validate_erred(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_tuple__223 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_parent, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 4335, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__223); __Pyx_GIVEREF(__pyx_tuple__223); __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_erred, 4335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(0, 4335, __pyx_L1_error) /* "distributed/scheduler.py":4341 * assert not ts._who_has * * def validate_key(self, key, ts: TaskState = None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * try: */ __pyx_tuple__225 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_ts, __pyx_n_s_parent, __pyx_n_s_func, __pyx_n_s_e, __pyx_n_s_pdb); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(0, 4341, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__225); __Pyx_GIVEREF(__pyx_tuple__225); __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_key, 4341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(0, 4341, __pyx_L1_error) __pyx_tuple__227 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 4341, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__227); __Pyx_GIVEREF(__pyx_tuple__227); /* "distributed/scheduler.py":4366 * raise * * def validate_state(self, allow_overlap=False): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * validate_state(parent._tasks, parent._workers, parent._clients) */ __pyx_tuple__228 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_allow_overlap, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_w, __pyx_n_s_ts, __pyx_n_s_k, __pyx_n_s_c, __pyx_n_s_cs, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_actual_total_occupancy, __pyx_n_s_worker, __pyx_n_s_w, __pyx_n_s_ws, __pyx_n_s_w, __pyx_n_s_ws, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 4366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__228); __Pyx_GIVEREF(__pyx_tuple__228); __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(2, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_state, 4366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 4366, __pyx_L1_error) __pyx_tuple__230 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 4366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__230); __Pyx_GIVEREF(__pyx_tuple__230); /* "distributed/scheduler.py":4417 * ################### * * def report(self, msg: dict, ts: TaskState = None, client: str = None): # <<<<<<<<<<<<<< * """ * Publish updates to all listening Queues and Comms */ __pyx_tuple__231 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_msg, __pyx_n_s_ts, __pyx_n_s_client, __pyx_n_s_parent, __pyx_n_s_msg_key, __pyx_n_s_tasks, __pyx_n_s_cs, __pyx_n_s_client_comms, __pyx_n_s_client_keys, __pyx_n_s_k, __pyx_n_s_c, __pyx_n_s_cs, __pyx_n_s_cs); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 4417, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__231); __Pyx_GIVEREF(__pyx_tuple__231); __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_report, 4417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 4417, __pyx_L1_error) __pyx_tuple__233 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 4417, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__233); __Pyx_GIVEREF(__pyx_tuple__233); /* "distributed/scheduler.py":4459 * logger.critical("Tried writing to closed comm: %s", msg) * * async def add_client(self, comm, client=None, versions=None): # <<<<<<<<<<<<<< * """Add client to network * */ __pyx_tuple__234 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_client, __pyx_n_s_versions, __pyx_n_s_parent, __pyx_n_s_plugin, __pyx_n_s_e, __pyx_n_s_bcomm, __pyx_n_s_msg, __pyx_n_s_ws, __pyx_n_s_version_warning, __pyx_n_s_w, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 4459, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__234); __Pyx_GIVEREF(__pyx_tuple__234); __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_add_client, 4459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 4459, __pyx_L1_error) __pyx_tuple__235 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 4459, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__235); __Pyx_GIVEREF(__pyx_tuple__235); /* "distributed/scheduler.py":4508 * pass * * def remove_client(self, client=None): # <<<<<<<<<<<<<< * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_tuple__236 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_client, __pyx_n_s_parent, __pyx_n_s_cs, __pyx_n_s_ts, __pyx_n_s_plugin, __pyx_n_s_e, __pyx_n_s_remove_client_from_events, __pyx_n_s_remove_client_from_events, __pyx_n_s_cleanup_delay, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 4508, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__236); __Pyx_GIVEREF(__pyx_tuple__236); __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_remove_client, 4508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 4508, __pyx_L1_error) __pyx_tuple__238 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 4508, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__238); __Pyx_GIVEREF(__pyx_tuple__238); /* "distributed/scheduler.py":4542 * self.loop.call_later(cleanup_delay, remove_client_from_events) * * def send_task_to_worker(self, worker, ts: TaskState, duration=None): # <<<<<<<<<<<<<< * """ Send a single computational task to a worker """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_tuple__239 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_worker, __pyx_n_s_ts, __pyx_n_s_duration, __pyx_n_s_parent, __pyx_n_s_msg, __pyx_n_s_e, __pyx_n_s_pdb); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 4542, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__239); __Pyx_GIVEREF(__pyx_tuple__239); __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_send_task_to_worker, 4542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 4542, __pyx_L1_error) __pyx_tuple__241 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 4542, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__241); __Pyx_GIVEREF(__pyx_tuple__241); /* "distributed/scheduler.py":4556 * raise * * def handle_uncaught_error(self, **msg): # <<<<<<<<<<<<<< * logger.exception(clean_exception(**msg)[1]) * */ __pyx_tuple__242 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 4556, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__242); __Pyx_GIVEREF(__pyx_tuple__242); __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_handle_uncaught_error, 4556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(0, 4556, __pyx_L1_error) /* "distributed/scheduler.py":4559 * logger.exception(clean_exception(**msg)[1]) * * def handle_task_finished(self, key=None, worker=None, **msg): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: */ __pyx_tuple__244 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_worker, __pyx_n_s_msg, __pyx_n_s_parent, __pyx_n_s_r); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 4559, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__244); __Pyx_GIVEREF(__pyx_tuple__244); __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_handle_task_finished, 4559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 4559, __pyx_L1_error) __pyx_tuple__246 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 4559, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__246); __Pyx_GIVEREF(__pyx_tuple__246); /* "distributed/scheduler.py":4567 * self.transitions(r) * * def handle_task_erred(self, key=None, **msg): # <<<<<<<<<<<<<< * r = self.stimulus_task_erred(key=key, **msg) * self.transitions(r) */ __pyx_tuple__247 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_msg, __pyx_n_s_r); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 4567, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__247); __Pyx_GIVEREF(__pyx_tuple__247); __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_handle_task_erred, 4567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 4567, __pyx_L1_error) __pyx_tuple__249 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 4567, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__249); __Pyx_GIVEREF(__pyx_tuple__249); /* "distributed/scheduler.py":4571 * self.transitions(r) * * def handle_release_data(self, key=None, worker=None, client=None, **msg): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks.get(key) */ __pyx_tuple__250 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_worker, __pyx_n_s_client, __pyx_n_s_msg, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_r); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(0, 4571, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__250); __Pyx_GIVEREF(__pyx_tuple__250); __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_handle_release_data, 4571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 4571, __pyx_L1_error) __pyx_tuple__252 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 4571, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__252); __Pyx_GIVEREF(__pyx_tuple__252); /* "distributed/scheduler.py":4582 * self.transitions(r) * * def handle_missing_data(self, key=None, errant_worker=None, **kwargs): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * logger.debug("handle missing data key=%s worker=%s", key, errant_worker) */ __pyx_tuple__253 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_errant_worker, __pyx_n_s_kwargs, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 4582, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__253); __Pyx_GIVEREF(__pyx_tuple__253); __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_handle_missing_data, 4582, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(0, 4582, __pyx_L1_error) __pyx_tuple__255 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 4582, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__255); __Pyx_GIVEREF(__pyx_tuple__255); /* "distributed/scheduler.py":4602 * self.transitions({key: "forgotten"}) * * def release_worker_data(self, comm=None, keys=None, worker=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ __pyx_tuple__256 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_worker, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_tasks, __pyx_n_s_removed_tasks, __pyx_n_s_ts, __pyx_n_s_recommendations, __pyx_n_s_wh, __pyx_n_s_k); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 4602, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__256); __Pyx_GIVEREF(__pyx_tuple__256); __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_release_worker_data_2, 4602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 4602, __pyx_L1_error) __pyx_tuple__258 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 4602, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__258); __Pyx_GIVEREF(__pyx_tuple__258); /* "distributed/scheduler.py":4620 * self.transitions(recommendations) * * def handle_long_running(self, key=None, worker=None, compute_duration=None): # <<<<<<<<<<<<<< * """A task has seceded from the thread pool * */ __pyx_tuple__259 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_worker, __pyx_n_s_compute_duration, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_old_duration, __pyx_n_s_new_duration, __pyx_n_s_avg_duration); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 4620, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__259); __Pyx_GIVEREF(__pyx_tuple__259); __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_handle_long_running, 4620, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 4620, __pyx_L1_error) __pyx_tuple__261 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 4620, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__261); __Pyx_GIVEREF(__pyx_tuple__261); /* "distributed/scheduler.py":4651 * self.check_idle_saturated(ws) * * async def handle_worker(self, comm=None, worker=None): # <<<<<<<<<<<<<< * """ * Listen to responses from a single worker */ __pyx_tuple__262 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_worker, __pyx_n_s_worker_comm); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 4651, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__262); __Pyx_GIVEREF(__pyx_tuple__262); __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__262, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_handle_worker, 4651, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 4651, __pyx_L1_error) __pyx_tuple__263 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 4651, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__263); __Pyx_GIVEREF(__pyx_tuple__263); /* "distributed/scheduler.py":4672 * await self.remove_worker(address=worker) * * def add_plugin(self, plugin=None, idempotent=False, **kwargs): # <<<<<<<<<<<<<< * """ * Add external plugin to scheduler */ __pyx_tuple__264 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_plugin, __pyx_n_s_idempotent, __pyx_n_s_kwargs, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 4672, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__264); __Pyx_GIVEREF(__pyx_tuple__264); __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_add_plugin, 4672, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 4672, __pyx_L1_error) __pyx_tuple__266 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 4672, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__266); __Pyx_GIVEREF(__pyx_tuple__266); /* "distributed/scheduler.py":4686 * self.plugins.append(plugin) * * def remove_plugin(self, plugin): # <<<<<<<<<<<<<< * """ Remove external plugin from scheduler """ * self.plugins.remove(plugin) */ __pyx_tuple__267 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_plugin); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(0, 4686, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__267); __Pyx_GIVEREF(__pyx_tuple__267); __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_remove_plugin, 4686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(0, 4686, __pyx_L1_error) /* "distributed/scheduler.py":4690 * self.plugins.remove(plugin) * * def worker_send(self, worker, msg): # <<<<<<<<<<<<<< * """Send message to worker * */ __pyx_tuple__269 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_worker, __pyx_n_s_msg, __pyx_n_s_stream_comms); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 4690, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__269); __Pyx_GIVEREF(__pyx_tuple__269); __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_worker_send, 4690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(0, 4690, __pyx_L1_error) /* "distributed/scheduler.py":4702 * self.loop.add_callback(self.remove_worker, address=worker) * * def client_send(self, client, msg): # <<<<<<<<<<<<<< * """Send message to client""" * client_comms: dict = self.client_comms */ __pyx_tuple__271 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_client, __pyx_n_s_msg, __pyx_n_s_client_comms, __pyx_n_s_c); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(0, 4702, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__271); __Pyx_GIVEREF(__pyx_tuple__271); __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_client_send, 4702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(0, 4702, __pyx_L1_error) /* "distributed/scheduler.py":4714 * logger.critical("Tried writing to closed comm: %s", msg) * * def send_all(self, client_msgs: dict, worker_msgs: dict): # <<<<<<<<<<<<<< * """Send messages to client and workers""" * stream_comms: dict = self.stream_comms */ __pyx_tuple__273 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_client_msgs, __pyx_n_s_worker_msgs, __pyx_n_s_stream_comms, __pyx_n_s_client_comms, __pyx_n_s_msgs, __pyx_n_s_worker, __pyx_n_s_w, __pyx_n_s_client, __pyx_n_s_c); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(0, 4714, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__273); __Pyx_GIVEREF(__pyx_tuple__273); __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_send_all, 4714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 4714, __pyx_L1_error) /* "distributed/scheduler.py":4741 * ############################ * * async def scatter( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__275 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_data, __pyx_n_s_workers, __pyx_n_s_client, __pyx_n_s_broadcast, __pyx_n_s_timeout, __pyx_n_s_parent, __pyx_n_s_start, __pyx_n_s_ws, __pyx_n_s_nthreads, __pyx_n_s_keys, __pyx_n_s_who_has, __pyx_n_s_nbytes, __pyx_n_s_n, __pyx_n_s_w, __pyx_n_s_ws, __pyx_n_s_w, __pyx_n_s_w); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(0, 4741, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__275); __Pyx_GIVEREF(__pyx_tuple__275); __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(7, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_scatter, 4741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 4741, __pyx_L1_error) __pyx_tuple__276 = PyTuple_Pack(6, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)__pyx_int_2)); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 4741, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__276); __Pyx_GIVEREF(__pyx_tuple__276); /* "distributed/scheduler.py":4790 * return keys * * async def gather(self, comm=None, keys=None, serializers=None): # <<<<<<<<<<<<<< * """ Collect data in from workers """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_tuple__277 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_serializers, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_who_has, __pyx_n_s_key, __pyx_n_s_ts, __pyx_n_s_data, __pyx_n_s_missing_keys, __pyx_n_s_missing_workers, __pyx_n_s_result, __pyx_n_s_missing_states, __pyx_n_s_workers, __pyx_n_s_worker, __pyx_n_s_ws, __pyx_n_s_key, __pyx_n_s_worker); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 4790, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__277); __Pyx_GIVEREF(__pyx_tuple__277); __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_gather, 4790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 4790, __pyx_L1_error) __pyx_tuple__278 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 4790, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__278); __Pyx_GIVEREF(__pyx_tuple__278); /* "distributed/scheduler.py":4851 * return result * * def clear_task_state(self): # <<<<<<<<<<<<<< * # XXX what about nested state such as ClientState.wants_what * # (see also fire-and-forget...) */ __pyx_tuple__279 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_collection); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(0, 4851, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__279); __Pyx_GIVEREF(__pyx_tuple__279); __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_clear_task_state, 4851, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(0, 4851, __pyx_L1_error) /* "distributed/scheduler.py":4858 * collection.clear() * * async def restart(self, client=None, timeout=3): # <<<<<<<<<<<<<< * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_tuple__281 = PyTuple_Pack(24, __pyx_n_s_self, __pyx_n_s_client, __pyx_n_s_timeout, __pyx_n_s_parent, __pyx_n_s_n_workers, __pyx_n_s_cs, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_nannies, __pyx_n_s_addr, __pyx_n_s_e, __pyx_n_s_plugin, __pyx_n_s_resps, __pyx_n_s_c, __pyx_n_s_start, __pyx_n_s_ts, __pyx_n_s_addr, __pyx_n_s_ws, __pyx_n_s_nanny_address, __pyx_n_s_nanny, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_nanny, __pyx_n_s_nanny); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(0, 4858, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__281); __Pyx_GIVEREF(__pyx_tuple__281); __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(3, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_restart, 4858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 4858, __pyx_L1_error) __pyx_tuple__282 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)__pyx_int_3)); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 4858, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__282); __Pyx_GIVEREF(__pyx_tuple__282); /* "distributed/scheduler.py":4938 * self.report({"op": "restart"}) * * async def broadcast( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__283 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_msg, __pyx_n_s_workers, __pyx_n_s_hosts, __pyx_n_s_nanny, __pyx_n_s_serializers, __pyx_n_s_parent, __pyx_n_s_host, __pyx_n_s_addresses, __pyx_n_s_send_message, __pyx_n_s_send_message, __pyx_n_s_results, __pyx_n_s_w, __pyx_n_s_address); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(0, 4938, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__283); __Pyx_GIVEREF(__pyx_tuple__283); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_broadcast, 4938, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 4938, __pyx_L1_error) __pyx_tuple__284 = PyTuple_Pack(6, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 4938, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__284); __Pyx_GIVEREF(__pyx_tuple__284); /* "distributed/scheduler.py":4980 * return dict(zip(workers, results)) * * async def proxy(self, comm=None, msg=None, worker=None, serializers=None): # <<<<<<<<<<<<<< * """ Proxy a communication through the scheduler to some other worker """ * d = await self.broadcast( */ __pyx_tuple__285 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_msg, __pyx_n_s_worker, __pyx_n_s_serializers, __pyx_n_s_d); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(0, 4980, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__285); __Pyx_GIVEREF(__pyx_tuple__285); __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_proxy, 4980, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 4980, __pyx_L1_error) __pyx_tuple__286 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 4980, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__286); __Pyx_GIVEREF(__pyx_tuple__286); /* "distributed/scheduler.py":4987 * return d[worker] * * async def _delete_worker_data(self, worker_address, keys): # <<<<<<<<<<<<<< * """Delete data from a worker and update the corresponding worker/task states * */ __pyx_tuple__287 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_worker_address, __pyx_n_s_keys, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_ts, __pyx_n_s_tasks, __pyx_n_s_key); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(0, 4987, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__287); __Pyx_GIVEREF(__pyx_tuple__287); __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_delete_worker_data, 4987, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 4987, __pyx_L1_error) /* "distributed/scheduler.py":5011 * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) * * async def rebalance(self, comm=None, keys=None, workers=None): # <<<<<<<<<<<<<< * """Rebalance keys so that each worker stores roughly equal bytes * */ __pyx_tuple__288 = PyTuple_Pack(42, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_workers, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_tasks, __pyx_n_s_missing_data_2, __pyx_n_s_workers_by_task, __pyx_n_s_ws, __pyx_n_s_tasks_by_worker, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_vv, __pyx_n_s_worker_bytes, __pyx_n_s_avg, __pyx_n_s_sorted_workers, __pyx_n_s_recipients, __pyx_n_s_recipient, __pyx_n_s_msgs, __pyx_n_s_sender, __pyx_n_s_sender_keys, __pyx_n_s_nb, __pyx_n_s_to_recipients, __pyx_n_s_to_senders, __pyx_n_s_result, __pyx_n_s_r, __pyx_n_s_k, __pyx_n_s_ts, __pyx_n_s_w, __pyx_n_s_ts, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_ws, __pyx_n_s_v, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_ts, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 5011, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__288); __Pyx_GIVEREF(__pyx_tuple__288); __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(4, 0, 42, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_rebalance, 5011, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 5011, __pyx_L1_error) __pyx_tuple__289 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 5011, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__289); __Pyx_GIVEREF(__pyx_tuple__289); /* "distributed/scheduler.py":5147 * return {"status": "OK"} * * async def replicate( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__290 = PyTuple_Pack(31, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_n, __pyx_n_s_workers, __pyx_n_s_branching_factor, __pyx_n_s_delete, __pyx_n_s_lock_2, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_wws, __pyx_n_s_ts, __pyx_n_s_tasks, __pyx_n_s_missing_data_2, __pyx_n_s_del_worker_tasks, __pyx_n_s_del_candidates, __pyx_n_s_gathers, __pyx_n_s_n_missing, __pyx_n_s_count, __pyx_n_s_results, __pyx_n_s_w, __pyx_n_s_v, __pyx_n_s_w, __pyx_n_s_k, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_tasks, __pyx_n_s_t, __pyx_n_s_wws, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 5147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__290); __Pyx_GIVEREF(__pyx_tuple__290); __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(8, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__290, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_replicate, 5147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 5147, __pyx_L1_error) __pyx_tuple__291 = PyTuple_Pack(7, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)__pyx_int_2), ((PyObject *)Py_True), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 5147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__291); __Pyx_GIVEREF(__pyx_tuple__291); /* "distributed/scheduler.py":5262 * ) * * def workers_to_close( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__292 = PyTuple_Pack(32, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_memory_ratio, __pyx_n_s_n, __pyx_n_s_key, __pyx_n_s_minimum, __pyx_n_s_target, __pyx_n_s_attribute, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_groups, __pyx_n_s_limit_bytes, __pyx_n_s_group_bytes, __pyx_n_s_limit, __pyx_n_s_total, __pyx_n_s_key_2, __pyx_n_s_key_2, __pyx_n_s_idle, __pyx_n_s_to_close, __pyx_n_s_n_remain, __pyx_n_s_group, __pyx_n_s_result, __pyx_n_s_ws, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_ws, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_ws, __pyx_n_s_ws, __pyx_n_s_g, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(0, 5262, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__292); __Pyx_GIVEREF(__pyx_tuple__292); __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(8, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__292, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_workers_to_close, 5262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(0, 5262, __pyx_L1_error) __pyx_tuple__294 = PyTuple_Pack(7, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_n_u_address)); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(0, 5262, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__294); __Pyx_GIVEREF(__pyx_tuple__294); /* "distributed/scheduler.py":5398 * return result * * async def retire_workers( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__295 = PyTuple_Pack(22, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_workers, __pyx_n_s_remove, __pyx_n_s_close_workers, __pyx_n_s_names, __pyx_n_s_lock_2, __pyx_n_s_kwargs, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_ts, __pyx_n_s_keys, __pyx_n_s_other_workers, __pyx_n_s_worker_keys, __pyx_n_s_ws, __pyx_n_s_w, __pyx_n_s_w, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_ws, __pyx_n_s_w, __pyx_n_s_w); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 5398, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__295); __Pyx_GIVEREF(__pyx_tuple__295); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(7, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_retire_workers, 5398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 5398, __pyx_L1_error) __pyx_tuple__296 = PyTuple_Pack(6, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_True), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 5398, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__296); __Pyx_GIVEREF(__pyx_tuple__296); /* "distributed/scheduler.py":5514 * return worker_keys * * def add_keys(self, comm=None, worker=None, keys=()): # <<<<<<<<<<<<<< * """ * Learn that a worker has certain keys */ __pyx_tuple__297 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_worker, __pyx_n_s_keys, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_key, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 5514, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__297); __Pyx_GIVEREF(__pyx_tuple__297); __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_add_keys_2, 5514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(0, 5514, __pyx_L1_error) __pyx_tuple__299 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_empty_tuple)); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 5514, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__299); __Pyx_GIVEREF(__pyx_tuple__299); /* "distributed/scheduler.py":5539 * return "OK" * * def update_data( # <<<<<<<<<<<<<< * self, comm=None, who_has=None, nbytes=None, client=None, serializers=None * ): */ __pyx_tuple__300 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_who_has, __pyx_n_s_nbytes, __pyx_n_s_client, __pyx_n_s_serializers, __pyx_n_s_parent, __pyx_n_s_key, __pyx_n_s_workers, __pyx_n_s_ts, __pyx_n_s_w, __pyx_n_s_ws, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_vv); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(0, 5539, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__300); __Pyx_GIVEREF(__pyx_tuple__300); __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(6, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__300, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_update_data_2, 5539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(0, 5539, __pyx_L1_error) __pyx_tuple__302 = PyTuple_Pack(5, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(0, 5539, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__302); __Pyx_GIVEREF(__pyx_tuple__302); /* "distributed/scheduler.py":5576 * self.client_desires_keys(keys=list(who_has), client=client) * * def report_on_key(self, key: str = None, ts: TaskState = None, client: str = None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: */ __pyx_tuple__303 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_ts, __pyx_n_s_client, __pyx_n_s_parent, __pyx_n_s_tasks, __pyx_n_s_report_msg); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(0, 5576, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__303); __Pyx_GIVEREF(__pyx_tuple__303); __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_report_on_key, 5576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(0, 5576, __pyx_L1_error) __pyx_tuple__305 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 5576, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__305); __Pyx_GIVEREF(__pyx_tuple__305); /* "distributed/scheduler.py":5591 * self.report(report_msg, ts=ts, client=client) * * async def feed( # <<<<<<<<<<<<<< * self, comm, function=None, setup=None, teardown=None, interval="1s", **kwargs * ): */ __pyx_tuple__306 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_function, __pyx_n_s_setup, __pyx_n_s_teardown, __pyx_n_s_interval, __pyx_n_s_kwargs, __pyx_n_s_state, __pyx_n_s_response); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(0, 5591, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__306); __Pyx_GIVEREF(__pyx_tuple__306); __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(6, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_feed, 5591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 5591, __pyx_L1_error) __pyx_tuple__307 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_kp_u_1s)); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 5591, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__307); __Pyx_GIVEREF(__pyx_tuple__307); /* "distributed/scheduler.py":5634 * teardown(self, state) * * def log_worker_event(self, worker=None, topic=None, msg=None): # <<<<<<<<<<<<<< * self.log_event(topic, msg) * */ __pyx_tuple__308 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_worker, __pyx_n_s_topic, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(0, 5634, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__308); __Pyx_GIVEREF(__pyx_tuple__308); __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_log_worker_event, 5634, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(0, 5634, __pyx_L1_error) __pyx_tuple__310 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(0, 5634, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__310); __Pyx_GIVEREF(__pyx_tuple__310); /* "distributed/scheduler.py":5637 * self.log_event(topic, msg) * * def subscribe_worker_status(self, comm=None): # <<<<<<<<<<<<<< * WorkerStatusPlugin(self, comm) * ident = self.identity() */ __pyx_tuple__311 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_ident, __pyx_n_s_v); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 5637, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__311); __Pyx_GIVEREF(__pyx_tuple__311); __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_subscribe_worker_status, 5637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(0, 5637, __pyx_L1_error) __pyx_tuple__313 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(0, 5637, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__313); __Pyx_GIVEREF(__pyx_tuple__313); /* "distributed/scheduler.py":5645 * return ident * * def get_processing(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_tuple__314 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_workers, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_ts, __pyx_n_s_w, __pyx_n_s_ts, __pyx_n_s_w, __pyx_n_s_ws, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(0, 5645, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__314); __Pyx_GIVEREF(__pyx_tuple__314); __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_processing, 5645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(0, 5645, __pyx_L1_error) __pyx_tuple__316 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(0, 5645, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__316); __Pyx_GIVEREF(__pyx_tuple__316); /* "distributed/scheduler.py":5660 * } * * def get_who_has(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_tuple__317 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_ts, __pyx_n_s_k, __pyx_n_s_ws, __pyx_n_s_key, __pyx_n_s_ts, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 5660, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__317); __Pyx_GIVEREF(__pyx_tuple__317); __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_who_has, 5660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(0, 5660, __pyx_L1_error) __pyx_tuple__319 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 5660, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__319); __Pyx_GIVEREF(__pyx_tuple__319); /* "distributed/scheduler.py":5677 * } * * def get_has_what(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_tuple__320 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_workers, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_ts, __pyx_n_s_w, __pyx_n_s_ts, __pyx_n_s_w, __pyx_n_s_ws, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(0, 5677, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__320); __Pyx_GIVEREF(__pyx_tuple__320); __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_has_what, 5677, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(0, 5677, __pyx_L1_error) __pyx_tuple__322 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(0, 5677, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__322); __Pyx_GIVEREF(__pyx_tuple__322); /* "distributed/scheduler.py":5695 * } * * def get_ncores(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_tuple__323 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_workers, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_w, __pyx_n_s_w, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 5695, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__323); __Pyx_GIVEREF(__pyx_tuple__323); __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_ncores, 5695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) __PYX_ERR(0, 5695, __pyx_L1_error) __pyx_tuple__325 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 5695, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__325); __Pyx_GIVEREF(__pyx_tuple__325); /* "distributed/scheduler.py":5708 * return {w: ws._nthreads for w, ws in parent._workers_dv.items()} * * async def get_call_stack(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ __pyx_tuple__326 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_dts, __pyx_n_s_stack, __pyx_n_s_processing_2, __pyx_n_s_key, __pyx_n_s_workers, __pyx_n_s_results, __pyx_n_s_response, __pyx_n_s_dts, __pyx_n_s_w, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_w, __pyx_n_s_r); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(0, 5708, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__326); __Pyx_GIVEREF(__pyx_tuple__326); __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_call_stack, 5708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 5708, __pyx_L1_error) __pyx_tuple__327 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(0, 5708, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__327); __Pyx_GIVEREF(__pyx_tuple__327); /* "distributed/scheduler.py":5739 * return response * * def get_nbytes(self, comm=None, keys=None, summary=True): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ __pyx_tuple__328 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_summary, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_result, __pyx_n_s_out, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_k, __pyx_n_s_k, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(0, 5739, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__328); __Pyx_GIVEREF(__pyx_tuple__328); __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_nbytes, 5739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(0, 5739, __pyx_L1_error) __pyx_tuple__330 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(0, 5739, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__330); __Pyx_GIVEREF(__pyx_tuple__330); /* "distributed/scheduler.py":5758 * return result * * def run_function(self, stream, function, args=(), kwargs={}, wait=True): # <<<<<<<<<<<<<< * """Run a function within this process * */ __pyx_tuple__331 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_function, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_wait, __pyx_n_s_run); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(0, 5758, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__331); __Pyx_GIVEREF(__pyx_tuple__331); __pyx_codeobj__332 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_run_function, 5758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__332)) __PYX_ERR(0, 5758, __pyx_L1_error) /* "distributed/scheduler.py":5770 * return run(self, stream, function=function, args=args, kwargs=kwargs, wait=wait) * * def set_metadata(self, comm=None, keys=None, value=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * try: */ __pyx_tuple__333 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_value, __pyx_n_s_parent, __pyx_n_s_metadata, __pyx_n_s_key, __pyx_n_s_e, __pyx_n_s_pdb); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(0, 5770, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__333); __Pyx_GIVEREF(__pyx_tuple__333); __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_set_metadata, 5770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(0, 5770, __pyx_L1_error) __pyx_tuple__335 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 5770, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__335); __Pyx_GIVEREF(__pyx_tuple__335); /* "distributed/scheduler.py":5784 * pdb.set_trace() * * def get_metadata(self, comm=None, keys=None, default=no_default): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * metadata = parent._task_metadata */ __pyx_tuple__336 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_default, __pyx_n_s_parent, __pyx_n_s_metadata, __pyx_n_s_key); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(0, 5784, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__336); __Pyx_GIVEREF(__pyx_tuple__336); __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_metadata, 5784, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) __PYX_ERR(0, 5784, __pyx_L1_error) /* "distributed/scheduler.py":5797 * raise * * def get_task_status(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * return { */ __pyx_tuple__338 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_keys, __pyx_n_s_parent, __pyx_n_s_key); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(0, 5797, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__338); __Pyx_GIVEREF(__pyx_tuple__338); __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_task_status, 5797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(0, 5797, __pyx_L1_error) __pyx_tuple__340 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(0, 5797, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__340); __Pyx_GIVEREF(__pyx_tuple__340); /* "distributed/scheduler.py":5804 * } * * def get_task_stream(self, comm=None, start=None, stop=None, count=None): # <<<<<<<<<<<<<< * from distributed.diagnostics.task_stream import TaskStreamPlugin * */ __pyx_tuple__341 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_count, __pyx_n_s_TaskStreamPlugin, __pyx_n_s_tsp, __pyx_n_s_p); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(0, 5804, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__341); __Pyx_GIVEREF(__pyx_tuple__341); __pyx_codeobj__342 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_task_stream, 5804, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__342)) __PYX_ERR(0, 5804, __pyx_L1_error) __pyx_tuple__343 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(0, 5804, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__343); __Pyx_GIVEREF(__pyx_tuple__343); /* "distributed/scheduler.py":5811 * return tsp.collect(start=start, stop=stop, count=count) * * def start_task_metadata(self, comm=None, name=None): # <<<<<<<<<<<<<< * plugin = CollectTaskMetaDataPlugin(scheduler=self, name=name) * */ __pyx_tuple__344 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_name, __pyx_n_s_plugin); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(0, 5811, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__344); __Pyx_GIVEREF(__pyx_tuple__344); __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_start_task_metadata, 5811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(0, 5811, __pyx_L1_error) __pyx_tuple__346 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(0, 5811, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__346); __Pyx_GIVEREF(__pyx_tuple__346); /* "distributed/scheduler.py":5816 * self.add_plugin(plugin) * * def stop_task_metadata(self, comm=None, name=None): # <<<<<<<<<<<<<< * plugins = [ * p */ __pyx_tuple__347 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_name, __pyx_n_s_plugins, __pyx_n_s_plugin, __pyx_n_s_p); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(0, 5816, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__347); __Pyx_GIVEREF(__pyx_tuple__347); __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_stop_task_metadata, 5816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) __PYX_ERR(0, 5816, __pyx_L1_error) __pyx_tuple__349 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(0, 5816, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__349); __Pyx_GIVEREF(__pyx_tuple__349); /* "distributed/scheduler.py":5832 * return {"metadata": plugin.metadata, "state": plugin.state} * * async def register_worker_plugin(self, comm, plugin, name=None): # <<<<<<<<<<<<<< * """ Registers a setup function, and call it on every worker """ * self.worker_plugins.append({"plugin": plugin, "name": name}) */ __pyx_tuple__350 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_plugin, __pyx_n_s_name, __pyx_n_s_responses); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(0, 5832, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__350); __Pyx_GIVEREF(__pyx_tuple__350); __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_register_worker_plugin, 5832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 5832, __pyx_L1_error) __pyx_tuple__351 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 5832, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__351); __Pyx_GIVEREF(__pyx_tuple__351); /* "distributed/scheduler.py":5845 * ##################### * * def _transition(self, key, finish: str, *args, **kwargs): # <<<<<<<<<<<<<< * """Transition a key from its current state to the finish state * */ __pyx_tuple__352 = PyTuple_Pack(35, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_finish, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_parent, __pyx_n_s_ts, __pyx_n_s_start, __pyx_n_s_start_finish, __pyx_n_s_finish2, __pyx_n_s_recommendations, __pyx_n_s_worker_msgs, __pyx_n_s_client_msgs, __pyx_n_s_msgs, __pyx_n_s_new_msgs, __pyx_n_s_dependents, __pyx_n_s_dependencies, __pyx_n_s_func, __pyx_n_s_a, __pyx_n_s_a_recs, __pyx_n_s_a_wmsgs, __pyx_n_s_a_cmsgs, __pyx_n_s_v, __pyx_n_s_b_recs, __pyx_n_s_b_wmsgs, __pyx_n_s_b_cmsgs, __pyx_n_s_b, __pyx_n_s_w, __pyx_n_s_c, __pyx_n_s_plugin, __pyx_n_s_tg, __pyx_n_s_all_forgotten, __pyx_n_s_s, __pyx_n_s_e, __pyx_n_s_pdb); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(0, 5845, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__352); __Pyx_GIVEREF(__pyx_tuple__352); __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(3, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__352, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_transition_2, 5845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) __PYX_ERR(0, 5845, __pyx_L1_error) /* "distributed/scheduler.py":5989 * raise * * def transition(self, key, finish: str, *args, **kwargs): # <<<<<<<<<<<<<< * """Transition a key from its current state to the finish state * */ __pyx_tuple__354 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_finish, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_recommendations, __pyx_n_s_worker_msgs, __pyx_n_s_client_msgs, __pyx_n_s_a); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(0, 5989, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__354); __Pyx_GIVEREF(__pyx_tuple__354); __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__354, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_transition, 5989, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) __PYX_ERR(0, 5989, __pyx_L1_error) /* "distributed/scheduler.py":6013 * return recommendations * * def transitions(self, recommendations: dict): # <<<<<<<<<<<<<< * """Process transitions until none are left * */ __pyx_tuple__356 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_recommendations, __pyx_n_s_parent, __pyx_n_s_keys, __pyx_n_s_worker_msgs, __pyx_n_s_client_msgs, __pyx_n_s_msgs, __pyx_n_s_new_msgs, __pyx_n_s_new_2, __pyx_n_s_new_recs, __pyx_n_s_new_wmsgs, __pyx_n_s_new_cmsgs, __pyx_n_s_key, __pyx_n_s_finish, __pyx_n_s_w, __pyx_n_s_c); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(0, 6013, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__356); __Pyx_GIVEREF(__pyx_tuple__356); __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_transitions_2, 6013, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) __PYX_ERR(0, 6013, __pyx_L1_error) /* "distributed/scheduler.py":6057 * self.validate_key(key) * * def story(self, *keys): # <<<<<<<<<<<<<< * """ Get all transitions that touch one of the input keys """ * keys = {key.key if isinstance(key, TaskState) else key for key in keys} */ __pyx_tuple__358 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_keys, __pyx_n_s_key, __pyx_n_s_t); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(0, 6057, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__358); __Pyx_GIVEREF(__pyx_tuple__358); __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_story, 6057, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) __PYX_ERR(0, 6057, __pyx_L1_error) /* "distributed/scheduler.py":6066 * transition_story = story * * def reschedule(self, key=None, worker=None): # <<<<<<<<<<<<<< * """Reschedule a task * */ __pyx_tuple__360 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_worker, __pyx_n_s_parent, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(0, 6066, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__360); __Pyx_GIVEREF(__pyx_tuple__360); __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_reschedule, 6066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) __PYX_ERR(0, 6066, __pyx_L1_error) __pyx_tuple__362 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(0, 6066, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__362); __Pyx_GIVEREF(__pyx_tuple__362); /* "distributed/scheduler.py":6092 * ##################### * * def add_resources(self, comm=None, worker=None, resources=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ __pyx_tuple__363 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_worker, __pyx_n_s_resources, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_resource, __pyx_n_s_quantity); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(0, 6092, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__363); __Pyx_GIVEREF(__pyx_tuple__363); __pyx_codeobj__364 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_add_resources, 6092, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__364)) __PYX_ERR(0, 6092, __pyx_L1_error) __pyx_tuple__365 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 6092, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__365); __Pyx_GIVEREF(__pyx_tuple__365); /* "distributed/scheduler.py":6103 * return "OK" * * def remove_resources(self, worker): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ __pyx_tuple__366 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_worker, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_resource, __pyx_n_s_quantity); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(0, 6103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__366); __Pyx_GIVEREF(__pyx_tuple__366); __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__366, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_remove_resources, 6103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) __PYX_ERR(0, 6103, __pyx_L1_error) /* "distributed/scheduler.py":6109 * del parent._resources[resource][worker] * * def coerce_address(self, addr, resolve=True): # <<<<<<<<<<<<<< * """ * Coerce possible input addresses to canonical form. */ __pyx_tuple__368 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_addr, __pyx_n_s_resolve, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(0, 6109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__368); __Pyx_GIVEREF(__pyx_tuple__368); __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_coerce_address, 6109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) __PYX_ERR(0, 6109, __pyx_L1_error) __pyx_tuple__370 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(0, 6109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__370); __Pyx_GIVEREF(__pyx_tuple__370); /* "distributed/scheduler.py":6132 * return addr * * def workers_list(self, workers): # <<<<<<<<<<<<<< * """ * List of qualifying workers */ __pyx_tuple__371 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_workers, __pyx_n_s_parent, __pyx_n_s_out, __pyx_n_s_w, __pyx_n_s_ww); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 6132, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__371); __Pyx_GIVEREF(__pyx_tuple__371); __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_workers_list, 6132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(0, 6132, __pyx_L1_error) /* "distributed/scheduler.py":6151 * return list(out) * * def start_ipython(self, comm=None): # <<<<<<<<<<<<<< * """Start an IPython kernel * */ __pyx_tuple__373 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_start_ipython); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 6151, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__373); __Pyx_GIVEREF(__pyx_tuple__373); __pyx_codeobj__374 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_start_ipython, 6151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__374)) __PYX_ERR(0, 6151, __pyx_L1_error) __pyx_tuple__375 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 6151, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__375); __Pyx_GIVEREF(__pyx_tuple__375); /* "distributed/scheduler.py":6164 * return self._ipython_kernel.get_connection_info() * * async def get_profile( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__376 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_workers, __pyx_n_s_scheduler, __pyx_n_s_server, __pyx_n_s_merge_workers, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_key, __pyx_n_s_parent, __pyx_n_s_results, __pyx_n_s_response, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_r); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(0, 6164, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__376); __Pyx_GIVEREF(__pyx_tuple__376); __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(9, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_profile, 6164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 6164, __pyx_L1_error) __pyx_tuple__377 = PyTuple_Pack(8, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_True), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(0, 6164, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__377); __Pyx_GIVEREF(__pyx_tuple__377); /* "distributed/scheduler.py":6200 * return response * * async def get_profile_metadata( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_tuple__378 = PyTuple_Pack(28, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_workers, __pyx_n_s_merge_workers, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_profile_cycle_interval, __pyx_n_s_parent, __pyx_n_s_dt, __pyx_n_s_results, __pyx_n_s_counts, __pyx_n_s_keys, __pyx_n_s_v, __pyx_n_s_t, __pyx_n_s_d, __pyx_n_s_k, __pyx_n_s_groups1, __pyx_n_s_groups2, __pyx_n_s_last, __pyx_n_s_tt, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_r, __pyx_n_s_v, __pyx_n_s_time, __pyx_n_s_group, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(0, 6200, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__378); __Pyx_GIVEREF(__pyx_tuple__378); __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(7, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_profile_metadata, 6200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 6200, __pyx_L1_error) __pyx_tuple__379 = PyTuple_Pack(6, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_True), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(0, 6200, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__379); __Pyx_GIVEREF(__pyx_tuple__379); /* "distributed/scheduler.py":6251 * return {"counts": counts, "keys": keys} * * async def performance_report(self, comm=None, start=None, code=""): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * stop = time() */ __pyx_tuple__380 = PyTuple_Pack(45, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_start, __pyx_n_s_code, __pyx_n_s_parent, __pyx_n_s_stop, __pyx_n_s_compute, __pyx_n_s_scheduler, __pyx_n_s_workers, __pyx_n_s_profile, __pyx_n_s_profile_to_figure, __pyx_n_s_profile_to_figure, __pyx_n_s_task_stream, __pyx_n_s_total_tasks, __pyx_n_s_timespent, __pyx_n_s_d, __pyx_n_s_x, __pyx_n_s_tasks_timings, __pyx_n_s_k, __pyx_n_s_rectangles, __pyx_n_s_task_stream_figure, __pyx_n_s_rects, __pyx_n_s_source, __pyx_n_s_BandwidthWorkers, __pyx_n_s_BandwidthTypes, __pyx_n_s_bandwidth_workers, __pyx_n_s_bandwidth_types, __pyx_n_s_Panel, __pyx_n_s_Tabs, __pyx_n_s_Div, __pyx_n_s_distributed, __pyx_n_s_ws, __pyx_n_s_html_2, __pyx_n_s_tabs, __pyx_n_s_save, __pyx_n_s_output_file, __pyx_n_s_get_env, __pyx_n_s_fn, __pyx_n_s_template_directory, __pyx_n_s_template_environment, __pyx_n_s_template, __pyx_n_s_f, __pyx_n_s_data, __pyx_n_s_ws, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(0, 6251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__380); __Pyx_GIVEREF(__pyx_tuple__380); __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(4, 0, 45, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_performance_report, 6251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 6251, __pyx_L1_error) __pyx_tuple__381 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_kp_u__50)); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 6251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__381); __Pyx_GIVEREF(__pyx_tuple__381); /* "distributed/scheduler.py":6388 * return data * * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): # <<<<<<<<<<<<<< * results = await self.broadcast( * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny */ __pyx_tuple__382 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_n, __pyx_n_s_workers, __pyx_n_s_nanny, __pyx_n_s_results); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(0, 6388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__382); __Pyx_GIVEREF(__pyx_tuple__382); __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__382, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_worker_logs, 6388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 6388, __pyx_L1_error) __pyx_tuple__383 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 6388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__383); __Pyx_GIVEREF(__pyx_tuple__383); /* "distributed/scheduler.py":6394 * return results * * def log_event(self, name, msg): # <<<<<<<<<<<<<< * event = (time(), msg) * if isinstance(name, list): */ __pyx_tuple__384 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_msg, __pyx_n_s_event, __pyx_n_s_n); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(0, 6394, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__384); __Pyx_GIVEREF(__pyx_tuple__384); __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__384, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_log_event_2, 6394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) __PYX_ERR(0, 6394, __pyx_L1_error) /* "distributed/scheduler.py":6404 * self.event_counts[name] += 1 * * def get_events(self, comm=None, topic=None): # <<<<<<<<<<<<<< * if topic is not None: * return tuple(self.events[topic]) */ __pyx_tuple__386 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_topic); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(0, 6404, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__386); __Pyx_GIVEREF(__pyx_tuple__386); __pyx_codeobj__387 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__386, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_get_events, 6404, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__387)) __PYX_ERR(0, 6404, __pyx_L1_error) __pyx_tuple__388 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(0, 6404, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__388); __Pyx_GIVEREF(__pyx_tuple__388); /* "distributed/scheduler.py":6414 * ########### * * def reevaluate_occupancy(self, worker_index: Py_ssize_t = 0): # <<<<<<<<<<<<<< * """Periodically reassess task duration time * */ __pyx_tuple__389 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_worker_index, __pyx_n_s_parent, __pyx_n_s_last, __pyx_n_s_next_time, __pyx_n_s_workers, __pyx_n_s_nworkers, __pyx_n_s_i, __pyx_n_s_ws, __pyx_n_s_duration); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(0, 6414, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__389); __Pyx_GIVEREF(__pyx_tuple__389); __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_reevaluate_occupancy, 6414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(0, 6414, __pyx_L1_error) /* "distributed/scheduler.py":6464 * raise * * async def check_worker_ttl(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_tuple__391 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_now); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(0, 6464, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__391); __Pyx_GIVEREF(__pyx_tuple__391); __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_check_worker_ttl, 6464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 6464, __pyx_L1_error) /* "distributed/scheduler.py":6479 * await self.remove_worker(address=ws._address) * * def check_idle(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_tuple__392 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_parent, __pyx_n_s_ws, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(0, 6479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__392); __Pyx_GIVEREF(__pyx_tuple__392); __pyx_codeobj__393 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__392, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_check_idle, 6479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__393)) __PYX_ERR(0, 6479, __pyx_L1_error) /* "distributed/scheduler.py":6498 * self.loop.add_callback(self.close) * * def adaptive_target(self, comm=None, target_duration=None): # <<<<<<<<<<<<<< * """Desired number of workers based on the current workload * */ __pyx_tuple__394 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_comm, __pyx_n_s_target_duration, __pyx_n_s_parent, __pyx_n_s_cpu, __pyx_n_s_ws, __pyx_n_s_tasks_processing, __pyx_n_s_limit_bytes, __pyx_n_s_worker_bytes, __pyx_n_s_limit, __pyx_n_s_total, __pyx_n_s_memory_2, __pyx_n_s_target, __pyx_n_s_to_close, __pyx_n_s_addr, __pyx_n_s_ws, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(0, 6498, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__394); __Pyx_GIVEREF(__pyx_tuple__394); __pyx_codeobj__395 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__394, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_adaptive_target, 6498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__395)) __PYX_ERR(0, 6498, __pyx_L1_error) __pyx_tuple__396 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(0, 6498, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__396); __Pyx_GIVEREF(__pyx_tuple__396); /* "distributed/scheduler.py":6878 * * * def validate_task_state(ts: TaskState): # <<<<<<<<<<<<<< * """ * Validate the given TaskState. */ __pyx_tuple__397 = PyTuple_Pack(7, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_dts, __pyx_n_s_cs, __pyx_n_s_dts, __pyx_n_s_dts, __pyx_n_s_ws); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(0, 6878, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__397); __Pyx_GIVEREF(__pyx_tuple__397); __pyx_codeobj__398 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_task_state, 6878, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__398)) __PYX_ERR(0, 6878, __pyx_L1_error) /* "distributed/scheduler.py":6979 * * * def validate_worker_state(ws: WorkerState): # <<<<<<<<<<<<<< * ts: TaskState * for ts in ws._has_what: */ __pyx_tuple__399 = PyTuple_Pack(2, __pyx_n_s_ws, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(0, 6979, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__399); __Pyx_GIVEREF(__pyx_tuple__399); __pyx_codeobj__400 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_worker_state, 6979, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__400)) __PYX_ERR(0, 6979, __pyx_L1_error) /* "distributed/scheduler.py":6993 * * * def validate_state(tasks, workers, clients): # <<<<<<<<<<<<<< * """ * Validate a current runtime state */ __pyx_tuple__401 = PyTuple_Pack(6, __pyx_n_s_tasks, __pyx_n_s_workers, __pyx_n_s_clients, __pyx_n_s_ts, __pyx_n_s_ws, __pyx_n_s_cs); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(0, 6993, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__401); __Pyx_GIVEREF(__pyx_tuple__401); __pyx_codeobj__402 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_validate_state, 6993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__402)) __PYX_ERR(0, 6993, __pyx_L1_error) /* "distributed/scheduler.py":7022 * * * def heartbeat_interval(n): # <<<<<<<<<<<<<< * """ * Interval in seconds that we desire heartbeats based on number of workers */ __pyx_tuple__403 = PyTuple_Pack(1, __pyx_n_s_n); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(0, 7022, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__403); __Pyx_GIVEREF(__pyx_tuple__403); __pyx_codeobj__404 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_heartbeat_interval_2, 7022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__404)) __PYX_ERR(0, 7022, __pyx_L1_error) /* "distributed/scheduler.py":7038 * * class KilledWorker(Exception): * def __init__(self, task, last_worker): # <<<<<<<<<<<<<< * super().__init__(task, last_worker) * self.task = task */ __pyx_tuple__405 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_task, __pyx_n_s_last_worker); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(0, 7038, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__405); __Pyx_GIVEREF(__pyx_tuple__405); __pyx_codeobj__406 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_init, 7038, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__406)) __PYX_ERR(0, 7038, __pyx_L1_error) /* "distributed/scheduler.py":7052 * """ * * def __init__(self, scheduler, comm): # <<<<<<<<<<<<<< * self.bcomm = BatchedSend(interval="5ms") * self.bcomm.start(comm) */ __pyx_tuple__407 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_scheduler, __pyx_n_s_comm); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(0, 7052, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__407); __Pyx_GIVEREF(__pyx_tuple__407); __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_init, 7052, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) __PYX_ERR(0, 7052, __pyx_L1_error) /* "distributed/scheduler.py":7059 * self.scheduler.add_plugin(self) * * def add_worker(self, worker=None, **kwargs): # <<<<<<<<<<<<<< * ident = self.scheduler.workers[worker].identity() * del ident["metrics"] */ __pyx_tuple__409 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_worker, __pyx_n_s_kwargs, __pyx_n_s_ident); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(0, 7059, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__409); __Pyx_GIVEREF(__pyx_tuple__409); __pyx_codeobj__410 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_add_worker, 7059, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__410)) __PYX_ERR(0, 7059, __pyx_L1_error) __pyx_tuple__411 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(0, 7059, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__411); __Pyx_GIVEREF(__pyx_tuple__411); /* "distributed/scheduler.py":7068 * self.scheduler.remove_plugin(self) * * def remove_worker(self, worker=None, **kwargs): # <<<<<<<<<<<<<< * try: * self.bcomm.send(["remove", worker]) */ __pyx_tuple__412 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_worker, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(0, 7068, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__412); __Pyx_GIVEREF(__pyx_tuple__412); __pyx_codeobj__413 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__412, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_remove_worker, 7068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__413)) __PYX_ERR(0, 7068, __pyx_L1_error) __pyx_tuple__414 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(0, 7068, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__414); __Pyx_GIVEREF(__pyx_tuple__414); /* "distributed/scheduler.py":7074 * self.scheduler.remove_plugin(self) * * def teardown(self): # <<<<<<<<<<<<<< * self.bcomm.close() * */ __pyx_tuple__415 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(0, 7074, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__415); __Pyx_GIVEREF(__pyx_tuple__415); __pyx_codeobj__416 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_teardown, 7074, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__416)) __PYX_ERR(0, 7074, __pyx_L1_error) /* "distributed/scheduler.py":7079 * * class CollectTaskMetaDataPlugin(SchedulerPlugin): * def __init__(self, scheduler, name): # <<<<<<<<<<<<<< * self.scheduler = scheduler * self.name = name */ __pyx_tuple__417 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_scheduler, __pyx_n_s_name); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(0, 7079, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__417); __Pyx_GIVEREF(__pyx_tuple__417); __pyx_codeobj__418 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__417, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_init, 7079, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__418)) __PYX_ERR(0, 7079, __pyx_L1_error) /* "distributed/scheduler.py":7086 * self.state = {} * * def update_graph(self, scheduler, dsk=None, keys=None, restrictions=None, **kwargs): # <<<<<<<<<<<<<< * self.keys.update(keys) * */ __pyx_tuple__419 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_scheduler, __pyx_n_s_dsk, __pyx_n_s_keys, __pyx_n_s_restrictions, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(0, 7086, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__419); __Pyx_GIVEREF(__pyx_tuple__419); __pyx_codeobj__420 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__419, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_update_graph_2, 7086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__420)) __PYX_ERR(0, 7086, __pyx_L1_error) __pyx_tuple__421 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(0, 7086, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__421); __Pyx_GIVEREF(__pyx_tuple__421); /* "distributed/scheduler.py":7089 * self.keys.update(keys) * * def transition(self, key, start, finish, *args, **kwargs): # <<<<<<<<<<<<<< * if finish == "memory" or finish == "erred": * ts: TaskState = self.scheduler.tasks.get(key) */ __pyx_tuple__422 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_start, __pyx_n_s_finish, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(0, 7089, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__422); __Pyx_GIVEREF(__pyx_tuple__422); __pyx_codeobj__423 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__422, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_distributed_scheduler_py, __pyx_n_s_transition, 7089, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__423)) __PYX_ERR(0, 7089, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_ClientState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__424 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__424); __Pyx_GIVEREF(__pyx_tuple__424); __pyx_codeobj__425 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__424, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ClientState, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__425)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_tuple__426 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__426); __Pyx_GIVEREF(__pyx_tuple__426); __pyx_codeobj__427 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__426, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_WorkerState, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__427)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_tuple__428 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__428); __Pyx_GIVEREF(__pyx_tuple__428); __pyx_codeobj__429 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__428, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TaskPrefix, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__429)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_tuple__430 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__430); __Pyx_GIVEREF(__pyx_tuple__430); __pyx_codeobj__431 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__430, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TaskGroup, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__431)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_tuple__432 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__432); __Pyx_GIVEREF(__pyx_tuple__432); __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TaskState, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_tuple__434 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__434); __Pyx_GIVEREF(__pyx_tuple__434); __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SchedulerState, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_popitem.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; __pyx_umethod_PySet_Type_update.type = (PyObject*)&PySet_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_0_1 = PyFloat_FromDouble(0.1); if (unlikely(!__pyx_float_0_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_2 = PyFloat_FromDouble(0.2); if (unlikely(!__pyx_float_0_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_6 = PyFloat_FromDouble(0.6); if (unlikely(!__pyx_float_0_6)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_8 = PyFloat_FromDouble(0.8); if (unlikely(!__pyx_float_0_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_05 = PyFloat_FromDouble(0.05); if (unlikely(!__pyx_float_0_05)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_1eneg_8 = PyFloat_FromDouble(1e-8); if (unlikely(!__pyx_float_1eneg_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_005 = PyFloat_FromDouble(0.005); if (unlikely(!__pyx_float_0_005)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8786 = PyInt_FromLong(8786); if (unlikely(!__pyx_int_8786)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8787 = PyInt_FromLong(8787); if (unlikely(!__pyx_int_8787)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_100000 = PyInt_FromLong(100000L); if (unlikely(!__pyx_int_100000)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_59694385 = PyInt_FromLong(59694385L); if (unlikely(!__pyx_int_59694385)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_64377685 = PyInt_FromLong(64377685L); if (unlikely(!__pyx_int_64377685)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_110416975 = PyInt_FromLong(110416975L); if (unlikely(!__pyx_int_110416975)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_135525525 = PyInt_FromLong(135525525L); if (unlikely(!__pyx_int_135525525)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_163323807 = PyInt_FromLong(163323807L); if (unlikely(!__pyx_int_163323807)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_247120481 = PyInt_FromLong(247120481L); if (unlikely(!__pyx_int_247120481)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11distributed_9scheduler_ALL_TASK_STATES = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11distributed_9scheduler_ClientState) < 0) __PYX_ERR(0, 193, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler_ClientState.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler_ClientState.tp_dictoffset && __pyx_type_11distributed_9scheduler_ClientState.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler_ClientState.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ClientState, (PyObject *)&__pyx_type_11distributed_9scheduler_ClientState) < 0) __PYX_ERR(0, 193, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11distributed_9scheduler_ClientState) < 0) __PYX_ERR(0, 193, __pyx_L1_error) __pyx_ptype_11distributed_9scheduler_ClientState = &__pyx_type_11distributed_9scheduler_ClientState; __pyx_vtabptr_11distributed_9scheduler_WorkerState = &__pyx_vtable_11distributed_9scheduler_WorkerState; __pyx_vtable_11distributed_9scheduler_WorkerState.clean = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_11WorkerState_clean; __pyx_vtable_11distributed_9scheduler_WorkerState.identity = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_11WorkerState_identity; if (PyType_Ready(&__pyx_type_11distributed_9scheduler_WorkerState) < 0) __PYX_ERR(0, 266, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler_WorkerState.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler_WorkerState.tp_dictoffset && __pyx_type_11distributed_9scheduler_WorkerState.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler_WorkerState.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } if (__Pyx_SetVtable(__pyx_type_11distributed_9scheduler_WorkerState.tp_dict, __pyx_vtabptr_11distributed_9scheduler_WorkerState) < 0) __PYX_ERR(0, 266, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WorkerState, (PyObject *)&__pyx_type_11distributed_9scheduler_WorkerState) < 0) __PYX_ERR(0, 266, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11distributed_9scheduler_WorkerState) < 0) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_ptype_11distributed_9scheduler_WorkerState = &__pyx_type_11distributed_9scheduler_WorkerState; if (PyType_Ready(&__pyx_type_11distributed_9scheduler_TaskPrefix) < 0) __PYX_ERR(0, 629, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler_TaskPrefix.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler_TaskPrefix.tp_dictoffset && __pyx_type_11distributed_9scheduler_TaskPrefix.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler_TaskPrefix.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaskPrefix, (PyObject *)&__pyx_type_11distributed_9scheduler_TaskPrefix) < 0) __PYX_ERR(0, 629, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11distributed_9scheduler_TaskPrefix) < 0) __PYX_ERR(0, 629, __pyx_L1_error) __pyx_ptype_11distributed_9scheduler_TaskPrefix = &__pyx_type_11distributed_9scheduler_TaskPrefix; __pyx_vtabptr_11distributed_9scheduler_TaskGroup = &__pyx_vtable_11distributed_9scheduler_TaskGroup; __pyx_vtable_11distributed_9scheduler_TaskGroup.add = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_TaskGroup *, PyObject *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_9TaskGroup_add; if (PyType_Ready(&__pyx_type_11distributed_9scheduler_TaskGroup) < 0) __PYX_ERR(0, 755, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler_TaskGroup.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler_TaskGroup.tp_dictoffset && __pyx_type_11distributed_9scheduler_TaskGroup.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler_TaskGroup.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } if (__Pyx_SetVtable(__pyx_type_11distributed_9scheduler_TaskGroup.tp_dict, __pyx_vtabptr_11distributed_9scheduler_TaskGroup) < 0) __PYX_ERR(0, 755, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaskGroup, (PyObject *)&__pyx_type_11distributed_9scheduler_TaskGroup) < 0) __PYX_ERR(0, 755, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11distributed_9scheduler_TaskGroup) < 0) __PYX_ERR(0, 755, __pyx_L1_error) __pyx_ptype_11distributed_9scheduler_TaskGroup = &__pyx_type_11distributed_9scheduler_TaskGroup; __pyx_vtabptr_11distributed_9scheduler_TaskState = &__pyx_vtable_11distributed_9scheduler_TaskState; __pyx_vtable_11distributed_9scheduler_TaskState.add_dependency = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_9TaskState_add_dependency; __pyx_vtable_11distributed_9scheduler_TaskState.get_nbytes = (Py_ssize_t (*)(struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_9TaskState_get_nbytes; __pyx_vtable_11distributed_9scheduler_TaskState.set_nbytes = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_TaskState *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_9TaskState_set_nbytes; __pyx_vtable_11distributed_9scheduler_TaskState.validate = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_9TaskState_validate; if (PyType_Ready(&__pyx_type_11distributed_9scheduler_TaskState) < 0) __PYX_ERR(0, 871, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler_TaskState.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler_TaskState.tp_dictoffset && __pyx_type_11distributed_9scheduler_TaskState.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler_TaskState.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } if (__Pyx_SetVtable(__pyx_type_11distributed_9scheduler_TaskState.tp_dict, __pyx_vtabptr_11distributed_9scheduler_TaskState) < 0) __PYX_ERR(0, 871, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaskState, (PyObject *)&__pyx_type_11distributed_9scheduler_TaskState) < 0) __PYX_ERR(0, 871, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11distributed_9scheduler_TaskState) < 0) __PYX_ERR(0, 871, __pyx_L1_error) __pyx_ptype_11distributed_9scheduler_TaskState = &__pyx_type_11distributed_9scheduler_TaskState; __pyx_vtabptr_11distributed_9scheduler_SchedulerState = &__pyx_vtable_11distributed_9scheduler_SchedulerState; __pyx_vtable_11distributed_9scheduler_SchedulerState.decide_worker = (struct __pyx_obj_11distributed_9scheduler_WorkerState *(*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_decide_worker; __pyx_vtable_11distributed_9scheduler_SchedulerState.set_duration_estimate = (double (*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_set_duration_estimate; __pyx_vtable_11distributed_9scheduler_SchedulerState.remove_key = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, PyObject *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_remove_key; __pyx_vtable_11distributed_9scheduler_SchedulerState.check_idle_saturated = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch, struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_check_idle_saturated *__pyx_optional_args))__pyx_f_11distributed_9scheduler_14SchedulerState_check_idle_saturated; __pyx_vtable_11distributed_9scheduler_SchedulerState.get_comm_cost = (double (*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_get_comm_cost; __pyx_vtable_11distributed_9scheduler_SchedulerState.get_task_duration = (double (*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch, struct __pyx_opt_args_11distributed_9scheduler_14SchedulerState_get_task_duration *__pyx_optional_args))__pyx_f_11distributed_9scheduler_14SchedulerState_get_task_duration; __pyx_vtable_11distributed_9scheduler_SchedulerState.valid_workers = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_valid_workers; __pyx_vtable_11distributed_9scheduler_SchedulerState.consume_resources = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_consume_resources; __pyx_vtable_11distributed_9scheduler_SchedulerState.release_resources = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_release_resources; __pyx_vtable_11distributed_9scheduler_SchedulerState.coerce_hostname = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, PyObject *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_coerce_hostname; __pyx_vtable_11distributed_9scheduler_SchedulerState.worker_objective = (PyObject *(*)(struct __pyx_obj_11distributed_9scheduler_SchedulerState *, struct __pyx_obj_11distributed_9scheduler_TaskState *, struct __pyx_obj_11distributed_9scheduler_WorkerState *, int __pyx_skip_dispatch))__pyx_f_11distributed_9scheduler_14SchedulerState_worker_objective; if (PyType_Ready(&__pyx_type_11distributed_9scheduler_SchedulerState) < 0) __PYX_ERR(0, 1534, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler_SchedulerState.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler_SchedulerState.tp_dictoffset && __pyx_type_11distributed_9scheduler_SchedulerState.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler_SchedulerState.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_11distributed_9scheduler_SchedulerState.tp_dict, __pyx_vtabptr_11distributed_9scheduler_SchedulerState) < 0) __PYX_ERR(0, 1534, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SchedulerState, (PyObject *)&__pyx_type_11distributed_9scheduler_SchedulerState) < 0) __PYX_ERR(0, 1534, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11distributed_9scheduler_SchedulerState) < 0) __PYX_ERR(0, 1534, __pyx_L1_error) __pyx_ptype_11distributed_9scheduler_SchedulerState = &__pyx_type_11distributed_9scheduler_SchedulerState; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct____repr__) < 0) __PYX_ERR(0, 718, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct____repr__.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct____repr__.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct____repr__.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct____repr__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct____repr__ = &__pyx_type_11distributed_9scheduler___pyx_scope_struct____repr__; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 724, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_1_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_1_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_1_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_2___repr__) < 0) __PYX_ERR(0, 854, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_2___repr__.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_2___repr__.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_2___repr__.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_2___repr__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_2___repr__ = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_2___repr__; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 860, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_3_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_3_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_3_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_4___iter__) < 0) __PYX_ERR(0, 1453, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_4___iter__.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_4___iter__.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_4___iter__.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_4___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_4___iter__ = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_4___iter__; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_5___len__) < 0) __PYX_ERR(0, 1459, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_5___len__.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_5___len__.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_5___len__.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_5___len__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_5___len__ = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_5___len__; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 1461, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_6_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_6_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_6_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_6_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_6_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_6_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_7___iter__) < 0) __PYX_ERR(0, 1483, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_7___iter__.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_7___iter__.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_7___iter__.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_7___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_7___iter__ = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_7___iter__; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 1484, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_8_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_8_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_8_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_8_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_8_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_8_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_9_start) < 0) __PYX_ERR(0, 3232, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_9_start.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_9_start.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_9_start.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_9_start.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_9_start = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_9_start; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_10_close) < 0) __PYX_ERR(0, 3293, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_10_close.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_10_close.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_10_close.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_10_close.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_10_close = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_10_close; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_11_close_worker) < 0) __PYX_ERR(0, 3358, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_11_close_worker.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_11_close_worker.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_11_close_worker.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_11_close_worker.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_11_close_worker = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_11_close_worker; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_12_add_worker) < 0) __PYX_ERR(0, 3454, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_12_add_worker.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_12_add_worker.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_12_add_worker.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_12_add_worker.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_12_add_worker = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_12_add_worker; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_13_update_graph) < 0) __PYX_ERR(0, 3659, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_13_update_graph.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_13_update_graph.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_13_update_graph.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_13_update_graph.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_13_update_graph = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_13_update_graph; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 3702, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_14_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_14_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_14_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_14_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_14_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_14_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 3738, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_15_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_15_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_15_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_15_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_15_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_15_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_16_genexpr) < 0) __PYX_ERR(0, 3797, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_16_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_16_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_16_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_16_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_16_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_16_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_17_remove_worker) < 0) __PYX_ERR(0, 4083, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_17_remove_worker.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_17_remove_worker.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_17_remove_worker.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_17_remove_worker.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_17_remove_worker = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_17_remove_worker; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_18_cancel_key) < 0) __PYX_ERR(0, 4208, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_18_cancel_key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_18_cancel_key.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_18_cancel_key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_18_cancel_key.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_18_cancel_key = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_18_cancel_key; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_19_validate_state) < 0) __PYX_ERR(0, 4366, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_19_validate_state.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_19_validate_state.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_19_validate_state.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_19_validate_state.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_19_validate_state = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_19_validate_state; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 4398, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_20_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_20_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_20_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_20_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_20_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_20_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_21_add_client) < 0) __PYX_ERR(0, 4459, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_21_add_client.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_21_add_client.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_21_add_client.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_21_add_client.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_21_add_client = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_21_add_client; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_22_remove_client) < 0) __PYX_ERR(0, 4508, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_22_remove_client.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_22_remove_client.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_22_remove_client.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_22_remove_client.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_22_remove_client = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_22_remove_client; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_23_handle_worker) < 0) __PYX_ERR(0, 4651, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_23_handle_worker.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_23_handle_worker.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_23_handle_worker.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_23_handle_worker.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_23_handle_worker = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_23_handle_worker; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_24_add_plugin) < 0) __PYX_ERR(0, 4672, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_24_add_plugin.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_24_add_plugin.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_24_add_plugin.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_24_add_plugin.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_24_add_plugin = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_24_add_plugin; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_25_genexpr) < 0) __PYX_ERR(0, 4681, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_25_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_25_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_25_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_25_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_25_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_25_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_26_scatter) < 0) __PYX_ERR(0, 4741, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_26_scatter.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_26_scatter.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_26_scatter.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_26_scatter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_26_scatter = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_26_scatter; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_27_gather) < 0) __PYX_ERR(0, 4790, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_27_gather.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_27_gather.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_27_gather.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_27_gather.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_27_gather = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_27_gather; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_28_restart) < 0) __PYX_ERR(0, 4858, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_28_restart.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_28_restart.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_28_restart.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_28_restart.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_28_restart = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_28_restart; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_29_genexpr) < 0) __PYX_ERR(0, 4918, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_29_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_29_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_29_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_29_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_29_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_29_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_30_broadcast) < 0) __PYX_ERR(0, 4938, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_30_broadcast.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_30_broadcast.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_30_broadcast.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_30_broadcast.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_30_broadcast = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_30_broadcast; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_31_send_message) < 0) __PYX_ERR(0, 4965, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_31_send_message.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_31_send_message.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_31_send_message.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_31_send_message.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_31_send_message = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_31_send_message; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_32_proxy) < 0) __PYX_ERR(0, 4980, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_32_proxy.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_32_proxy.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_32_proxy.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_32_proxy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_32_proxy = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_32_proxy; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data) < 0) __PYX_ERR(0, 4987, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_33__delete_worker_data; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_34_rebalance) < 0) __PYX_ERR(0, 5011, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_34_rebalance.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_34_rebalance.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_34_rebalance.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_34_rebalance.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_34_rebalance = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_34_rebalance; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_35_genexpr) < 0) __PYX_ERR(0, 5049, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_35_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_35_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_35_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_35_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_35_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_35_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_36_genexpr) < 0) __PYX_ERR(0, 5096, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_36_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_36_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_36_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_36_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_36_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_36_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_37_genexpr) < 0) __PYX_ERR(0, 5114, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_37_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_37_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_37_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_37_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_37_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_37_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_38_genexpr) < 0) __PYX_ERR(0, 5119, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_38_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_38_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_38_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_38_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_38_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_38_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_39_genexpr) < 0) __PYX_ERR(0, 5142, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_39_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_39_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_39_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_39_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_39_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_39_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_40_replicate) < 0) __PYX_ERR(0, 5147, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_40_replicate.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_40_replicate.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_40_replicate.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_40_replicate.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_40_replicate = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_40_replicate; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_41_genexpr) < 0) __PYX_ERR(0, 5240, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_41_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_41_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_41_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_41_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_41_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_41_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close) < 0) __PYX_ERR(0, 5262, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_42_workers_to_close; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_43_retire_workers) < 0) __PYX_ERR(0, 5398, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_43_retire_workers.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_43_retire_workers.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_43_retire_workers.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_43_retire_workers.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_43_retire_workers = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_43_retire_workers; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_44_feed) < 0) __PYX_ERR(0, 5591, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_44_feed.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_44_feed.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_44_feed.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_44_feed.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_44_feed = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_44_feed; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack) < 0) __PYX_ERR(0, 5708, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_45_get_call_stack; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_46_genexpr) < 0) __PYX_ERR(0, 5734, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_46_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_46_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_46_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_46_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_46_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_46_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin) < 0) __PYX_ERR(0, 5832, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_47_register_worker_plugin; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_48_get_profile) < 0) __PYX_ERR(0, 6164, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_48_get_profile.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_48_get_profile.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_48_get_profile.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_48_get_profile.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_48_get_profile = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_48_get_profile; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_49_genexpr) < 0) __PYX_ERR(0, 6186, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_49_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_49_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_49_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_49_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_49_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_49_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata) < 0) __PYX_ERR(0, 6200, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_50_get_profile_metadata; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_51_genexpr) < 0) __PYX_ERR(0, 6220, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_51_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_51_genexpr.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_51_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_51_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_51_genexpr = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_51_genexpr; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_52_performance_report) < 0) __PYX_ERR(0, 6251, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_52_performance_report.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_52_performance_report.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_52_performance_report.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_52_performance_report.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_52_performance_report = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_52_performance_report; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs) < 0) __PYX_ERR(0, 6388, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_53_get_worker_logs; if (PyType_Ready(&__pyx_type_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl) < 0) __PYX_ERR(0, 6464, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl.tp_dictoffset && __pyx_type_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl = &__pyx_type_11distributed_9scheduler___pyx_scope_struct_54_check_worker_ttl; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initscheduler(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initscheduler(void) #else __Pyx_PyMODINIT_FUNC PyInit_scheduler(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_scheduler(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_scheduler(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; double __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'scheduler' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_scheduler(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("scheduler", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_distributed__scheduler) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_3, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "distributed.scheduler")) { if (unlikely(PyDict_SetItemString(modules, "distributed.scheduler", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "distributed/scheduler.py":1 * import asyncio # <<<<<<<<<<<<<< * from collections import defaultdict, deque * */ __pyx_t_1 = __Pyx_patch_asyncio(__Pyx_Import(__pyx_n_s_asyncio, 0, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":2 * import asyncio * from collections import defaultdict, deque # <<<<<<<<<<<<<< * * from collections.abc import Mapping, Set */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_defaultdict); __Pyx_GIVEREF(__pyx_n_s_defaultdict); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_defaultdict); __Pyx_INCREF(__pyx_n_s_deque); __Pyx_GIVEREF(__pyx_n_s_deque); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_deque); __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_defaultdict, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_deque, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4 * from collections import defaultdict, deque * * from collections.abc import Mapping, Set # <<<<<<<<<<<<<< * from contextlib import suppress * from datetime import timedelta */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Mapping); __Pyx_GIVEREF(__pyx_n_s_Mapping); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Mapping); __Pyx_INCREF(__pyx_n_s_Set); __Pyx_GIVEREF(__pyx_n_s_Set); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Set); __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Mapping, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Set, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":5 * * from collections.abc import Mapping, Set * from contextlib import suppress # <<<<<<<<<<<<<< * from datetime import timedelta * from functools import partial */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_suppress); __Pyx_GIVEREF(__pyx_n_s_suppress); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_suppress); __pyx_t_2 = __Pyx_Import(__pyx_n_s_contextlib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_suppress); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_suppress, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6 * from collections.abc import Mapping, Set * from contextlib import suppress * from datetime import timedelta # <<<<<<<<<<<<<< * from functools import partial * import inspect */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_timedelta); __Pyx_GIVEREF(__pyx_n_s_timedelta); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_timedelta); __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_timedelta, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":7 * from contextlib import suppress * from datetime import timedelta * from functools import partial # <<<<<<<<<<<<<< * import inspect * import itertools */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_partial); __Pyx_GIVEREF(__pyx_n_s_partial); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_partial); __pyx_t_2 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_partial, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":8 * from datetime import timedelta * from functools import partial * import inspect # <<<<<<<<<<<<<< * import itertools * import json */ __pyx_t_2 = __Pyx_patch_inspect(__Pyx_Import(__pyx_n_s_inspect, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_inspect, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":9 * from functools import partial * import inspect * import itertools # <<<<<<<<<<<<<< * import json * import logging */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":10 * import inspect * import itertools * import json # <<<<<<<<<<<<<< * import logging * import math */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":11 * import itertools * import json * import logging # <<<<<<<<<<<<<< * import math * from numbers import Number */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_logging, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":12 * import json * import logging * import math # <<<<<<<<<<<<<< * from numbers import Number * import operator */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":13 * import logging * import math * from numbers import Number # <<<<<<<<<<<<<< * import operator * import os */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Number); __Pyx_GIVEREF(__pyx_n_s_Number); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Number); __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Number, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":14 * import math * from numbers import Number * import operator # <<<<<<<<<<<<<< * import os * import sys */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":15 * from numbers import Number * import operator * import os # <<<<<<<<<<<<<< * import sys * import random */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":16 * import operator * import os * import sys # <<<<<<<<<<<<<< * import random * import warnings */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":17 * import os * import sys * import random # <<<<<<<<<<<<<< * import warnings * import weakref */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":18 * import sys * import random * import warnings # <<<<<<<<<<<<<< * import weakref * import psutil */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":19 * import random * import warnings * import weakref # <<<<<<<<<<<<<< * import psutil * import sortedcontainers */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_weakref, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":20 * import warnings * import weakref * import psutil # <<<<<<<<<<<<<< * import sortedcontainers * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_psutil, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_psutil, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":21 * import weakref * import psutil * import sortedcontainers # <<<<<<<<<<<<<< * * from tlz import ( */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sortedcontainers, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sortedcontainers, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":24 * * from tlz import ( * merge, # <<<<<<<<<<<<<< * pluck, * merge_sorted, */ __pyx_t_1 = PyList_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_merge); __Pyx_GIVEREF(__pyx_n_s_merge); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_merge); __Pyx_INCREF(__pyx_n_s_pluck); __Pyx_GIVEREF(__pyx_n_s_pluck); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_pluck); __Pyx_INCREF(__pyx_n_s_merge_sorted); __Pyx_GIVEREF(__pyx_n_s_merge_sorted); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_merge_sorted); __Pyx_INCREF(__pyx_n_s_first); __Pyx_GIVEREF(__pyx_n_s_first); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_first); __Pyx_INCREF(__pyx_n_s_merge_with); __Pyx_GIVEREF(__pyx_n_s_merge_with); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_merge_with); __Pyx_INCREF(__pyx_n_s_valmap); __Pyx_GIVEREF(__pyx_n_s_valmap); PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_valmap); __Pyx_INCREF(__pyx_n_s_second); __Pyx_GIVEREF(__pyx_n_s_second); PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_second); __Pyx_INCREF(__pyx_n_s_compose); __Pyx_GIVEREF(__pyx_n_s_compose); PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_compose); __Pyx_INCREF(__pyx_n_s_groupby); __Pyx_GIVEREF(__pyx_n_s_groupby); PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_groupby); __Pyx_INCREF(__pyx_n_s_concat); __Pyx_GIVEREF(__pyx_n_s_concat); PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_concat); /* "distributed/scheduler.py":23 * import sortedcontainers * * from tlz import ( # <<<<<<<<<<<<<< * merge, * pluck, */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_tlz, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_merge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_merge, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_pluck); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pluck, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_merge_sorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_merge_sorted, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_first); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_first, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_merge_with); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_merge_with, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_valmap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_valmap, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_second, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_compose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_compose, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_groupby); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_concat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":35 * concat, * ) * from tornado.ioloop import IOLoop, PeriodicCallback # <<<<<<<<<<<<<< * * import dask */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_IOLoop); __Pyx_GIVEREF(__pyx_n_s_IOLoop); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_IOLoop); __Pyx_INCREF(__pyx_n_s_PeriodicCallback); __Pyx_GIVEREF(__pyx_n_s_PeriodicCallback); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_PeriodicCallback); __pyx_t_1 = __Pyx_Import(__pyx_n_s_tornado_ioloop, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_IOLoop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOLoop, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PeriodicCallback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PeriodicCallback, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":37 * from tornado.ioloop import IOLoop, PeriodicCallback * * import dask # <<<<<<<<<<<<<< * * from . import profile */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_dask, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_dask, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":39 * import dask * * from . import profile # <<<<<<<<<<<<<< * from .batched import BatchedSend * from .comm import ( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_profile); __Pyx_GIVEREF(__pyx_n_s_profile); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_profile); __pyx_t_2 = __Pyx_Import(__pyx_n_s__50, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_profile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_profile, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":40 * * from . import profile * from .batched import BatchedSend # <<<<<<<<<<<<<< * from .comm import ( * normalize_address, */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_BatchedSend); __Pyx_GIVEREF(__pyx_n_s_BatchedSend); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BatchedSend); __pyx_t_1 = __Pyx_Import(__pyx_n_s_batched, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BatchedSend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BatchedSend, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":42 * from .batched import BatchedSend * from .comm import ( * normalize_address, # <<<<<<<<<<<<<< * resolve_address, * get_address_host, */ __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_normalize_address); __Pyx_GIVEREF(__pyx_n_s_normalize_address); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_normalize_address); __Pyx_INCREF(__pyx_n_s_resolve_address); __Pyx_GIVEREF(__pyx_n_s_resolve_address); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_resolve_address); __Pyx_INCREF(__pyx_n_s_get_address_host); __Pyx_GIVEREF(__pyx_n_s_get_address_host); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_get_address_host); __Pyx_INCREF(__pyx_n_s_unparse_host_port); __Pyx_GIVEREF(__pyx_n_s_unparse_host_port); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_unparse_host_port); /* "distributed/scheduler.py":41 * from . import profile * from .batched import BatchedSend * from .comm import ( # <<<<<<<<<<<<<< * normalize_address, * resolve_address, */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_comm, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_normalize_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_address, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_resolve_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_resolve_address, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_address_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_address_host, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unparse_host_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unparse_host_port, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":47 * unparse_host_port, * ) * from .comm.addressing import addresses_from_user_args # <<<<<<<<<<<<<< * from .core import rpc, send_recv, clean_exception, CommClosedError, Status * from .diagnostics.plugin import SchedulerPlugin */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_addresses_from_user_args); __Pyx_GIVEREF(__pyx_n_s_addresses_from_user_args); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_addresses_from_user_args); __pyx_t_1 = __Pyx_Import(__pyx_n_s_comm_addressing, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_addresses_from_user_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_addresses_from_user_args, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":48 * ) * from .comm.addressing import addresses_from_user_args * from .core import rpc, send_recv, clean_exception, CommClosedError, Status # <<<<<<<<<<<<<< * from .diagnostics.plugin import SchedulerPlugin * */ __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_rpc); __Pyx_GIVEREF(__pyx_n_s_rpc); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_rpc); __Pyx_INCREF(__pyx_n_s_send_recv); __Pyx_GIVEREF(__pyx_n_s_send_recv); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_send_recv); __Pyx_INCREF(__pyx_n_s_clean_exception); __Pyx_GIVEREF(__pyx_n_s_clean_exception); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_clean_exception); __Pyx_INCREF(__pyx_n_s_CommClosedError); __Pyx_GIVEREF(__pyx_n_s_CommClosedError); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_CommClosedError); __Pyx_INCREF(__pyx_n_s_Status); __Pyx_GIVEREF(__pyx_n_s_Status); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_Status); __pyx_t_2 = __Pyx_Import(__pyx_n_s_core, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_rpc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rpc, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_send_recv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_send_recv, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_clean_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean_exception, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CommClosedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CommClosedError, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Status, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":49 * from .comm.addressing import addresses_from_user_args * from .core import rpc, send_recv, clean_exception, CommClosedError, Status * from .diagnostics.plugin import SchedulerPlugin # <<<<<<<<<<<<<< * * from .http import get_handlers */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SchedulerPlugin); __Pyx_GIVEREF(__pyx_n_s_SchedulerPlugin); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SchedulerPlugin); __pyx_t_1 = __Pyx_Import(__pyx_n_s_diagnostics_plugin, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SchedulerPlugin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SchedulerPlugin, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":51 * from .diagnostics.plugin import SchedulerPlugin * * from .http import get_handlers # <<<<<<<<<<<<<< * from .metrics import time * from .node import ServerNode */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_get_handlers); __Pyx_GIVEREF(__pyx_n_s_get_handlers); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_handlers); __pyx_t_2 = __Pyx_Import(__pyx_n_s_http, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_handlers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_handlers, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":52 * * from .http import get_handlers * from .metrics import time # <<<<<<<<<<<<<< * from .node import ServerNode * from . import preloading */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_time); __Pyx_GIVEREF(__pyx_n_s_time); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_time); __pyx_t_1 = __Pyx_Import(__pyx_n_s_metrics, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":53 * from .http import get_handlers * from .metrics import time * from .node import ServerNode # <<<<<<<<<<<<<< * from . import preloading * from .proctitle import setproctitle */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_ServerNode); __Pyx_GIVEREF(__pyx_n_s_ServerNode); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ServerNode); __pyx_t_2 = __Pyx_Import(__pyx_n_s_node, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ServerNode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ServerNode, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":54 * from .metrics import time * from .node import ServerNode * from . import preloading # <<<<<<<<<<<<<< * from .proctitle import setproctitle * from .security import Security */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_preloading); __Pyx_GIVEREF(__pyx_n_s_preloading); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_preloading); __pyx_t_1 = __Pyx_Import(__pyx_n_s__50, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_preloading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_preloading, __pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":55 * from .node import ServerNode * from . import preloading * from .proctitle import setproctitle # <<<<<<<<<<<<<< * from .security import Security * from .utils import ( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_setproctitle); __Pyx_GIVEREF(__pyx_n_s_setproctitle); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_setproctitle); __pyx_t_2 = __Pyx_Import(__pyx_n_s_proctitle, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_setproctitle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setproctitle, __pyx_t_1) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":56 * from . import preloading * from .proctitle import setproctitle * from .security import Security # <<<<<<<<<<<<<< * from .utils import ( * All, */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Security); __Pyx_GIVEREF(__pyx_n_s_Security); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Security); __pyx_t_1 = __Pyx_Import(__pyx_n_s_security, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Security); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Security, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":58 * from .security import Security * from .utils import ( * All, # <<<<<<<<<<<<<< * get_fileno_limit, * log_errors, */ __pyx_t_1 = PyList_New(15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_All); __Pyx_GIVEREF(__pyx_n_s_All); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_All); __Pyx_INCREF(__pyx_n_s_get_fileno_limit); __Pyx_GIVEREF(__pyx_n_s_get_fileno_limit); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_fileno_limit); __Pyx_INCREF(__pyx_n_s_log_errors); __Pyx_GIVEREF(__pyx_n_s_log_errors); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_log_errors); __Pyx_INCREF(__pyx_n_s_key_split); __Pyx_GIVEREF(__pyx_n_s_key_split); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_key_split); __Pyx_INCREF(__pyx_n_s_validate_key); __Pyx_GIVEREF(__pyx_n_s_validate_key); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_validate_key); __Pyx_INCREF(__pyx_n_s_no_default); __Pyx_GIVEREF(__pyx_n_s_no_default); PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_no_default); __Pyx_INCREF(__pyx_n_s_parse_timedelta); __Pyx_GIVEREF(__pyx_n_s_parse_timedelta); PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_parse_timedelta); __Pyx_INCREF(__pyx_n_s_parse_bytes); __Pyx_GIVEREF(__pyx_n_s_parse_bytes); PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_parse_bytes); __Pyx_INCREF(__pyx_n_s_shutting_down); __Pyx_GIVEREF(__pyx_n_s_shutting_down); PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_shutting_down); __Pyx_INCREF(__pyx_n_s_key_split_group); __Pyx_GIVEREF(__pyx_n_s_key_split_group); PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_key_split_group); __Pyx_INCREF(__pyx_n_s_empty_context); __Pyx_GIVEREF(__pyx_n_s_empty_context); PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_empty_context); __Pyx_INCREF(__pyx_n_s_tmpfile); __Pyx_GIVEREF(__pyx_n_s_tmpfile); PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_s_tmpfile); __Pyx_INCREF(__pyx_n_s_format_bytes); __Pyx_GIVEREF(__pyx_n_s_format_bytes); PyList_SET_ITEM(__pyx_t_1, 12, __pyx_n_s_format_bytes); __Pyx_INCREF(__pyx_n_s_format_time); __Pyx_GIVEREF(__pyx_n_s_format_time); PyList_SET_ITEM(__pyx_t_1, 13, __pyx_n_s_format_time); __Pyx_INCREF(__pyx_n_s_TimeoutError); __Pyx_GIVEREF(__pyx_n_s_TimeoutError); PyList_SET_ITEM(__pyx_t_1, 14, __pyx_n_s_TimeoutError); /* "distributed/scheduler.py":57 * from .proctitle import setproctitle * from .security import Security * from .utils import ( # <<<<<<<<<<<<<< * All, * get_fileno_limit, */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_utils, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_All); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_All, __pyx_t_1) < 0) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_fileno_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_fileno_limit, __pyx_t_1) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_log_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_log_errors, __pyx_t_1) < 0) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_key_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_key_split, __pyx_t_1) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_validate_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_validate_key, __pyx_t_1) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_no_default, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_timedelta, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_parse_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_bytes, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_shutting_down); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_shutting_down, __pyx_t_1) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_key_split_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_key_split_group, __pyx_t_1) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_empty_context); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_empty_context, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tmpfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_tmpfile, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_format_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_bytes, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_format_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_time, __pyx_t_1) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeoutError, __pyx_t_1) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":74 * TimeoutError, * ) * from .utils_comm import scatter_to_workers, gather_from_workers, retry_operation # <<<<<<<<<<<<<< * from .utils_perf import enable_gc_diagnosis, disable_gc_diagnosis * from . import versions as version_module */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_scatter_to_workers); __Pyx_GIVEREF(__pyx_n_s_scatter_to_workers); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_scatter_to_workers); __Pyx_INCREF(__pyx_n_s_gather_from_workers); __Pyx_GIVEREF(__pyx_n_s_gather_from_workers); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_gather_from_workers); __Pyx_INCREF(__pyx_n_s_retry_operation); __Pyx_GIVEREF(__pyx_n_s_retry_operation); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_retry_operation); __pyx_t_1 = __Pyx_Import(__pyx_n_s_utils_comm, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_scatter_to_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scatter_to_workers, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_gather_from_workers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gather_from_workers, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_retry_operation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_retry_operation, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":75 * ) * from .utils_comm import scatter_to_workers, gather_from_workers, retry_operation * from .utils_perf import enable_gc_diagnosis, disable_gc_diagnosis # <<<<<<<<<<<<<< * from . import versions as version_module * */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_enable_gc_diagnosis); __Pyx_GIVEREF(__pyx_n_s_enable_gc_diagnosis); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_enable_gc_diagnosis); __Pyx_INCREF(__pyx_n_s_disable_gc_diagnosis); __Pyx_GIVEREF(__pyx_n_s_disable_gc_diagnosis); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_disable_gc_diagnosis); __pyx_t_2 = __Pyx_Import(__pyx_n_s_utils_perf, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_enable_gc_diagnosis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_enable_gc_diagnosis, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_disable_gc_diagnosis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_disable_gc_diagnosis, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":76 * from .utils_comm import scatter_to_workers, gather_from_workers, retry_operation * from .utils_perf import enable_gc_diagnosis, disable_gc_diagnosis * from . import versions as version_module # <<<<<<<<<<<<<< * * from .publish import PublishExtension */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_versions); __Pyx_GIVEREF(__pyx_n_s_versions); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_versions); __pyx_t_1 = __Pyx_Import(__pyx_n_s__50, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_versions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_module, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":78 * from . import versions as version_module * * from .publish import PublishExtension # <<<<<<<<<<<<<< * from .queues import QueueExtension * from .semaphore import SemaphoreExtension */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PublishExtension); __Pyx_GIVEREF(__pyx_n_s_PublishExtension); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PublishExtension); __pyx_t_2 = __Pyx_Import(__pyx_n_s_publish, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PublishExtension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PublishExtension, __pyx_t_1) < 0) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":79 * * from .publish import PublishExtension * from .queues import QueueExtension # <<<<<<<<<<<<<< * from .semaphore import SemaphoreExtension * from .recreate_exceptions import ReplayExceptionScheduler */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_QueueExtension); __Pyx_GIVEREF(__pyx_n_s_QueueExtension); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_QueueExtension); __pyx_t_1 = __Pyx_Import(__pyx_n_s_queues, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_QueueExtension); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueExtension, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":80 * from .publish import PublishExtension * from .queues import QueueExtension * from .semaphore import SemaphoreExtension # <<<<<<<<<<<<<< * from .recreate_exceptions import ReplayExceptionScheduler * from .lock import LockExtension */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_SemaphoreExtension); __Pyx_GIVEREF(__pyx_n_s_SemaphoreExtension); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_SemaphoreExtension); __pyx_t_2 = __Pyx_Import(__pyx_n_s_semaphore, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SemaphoreExtension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SemaphoreExtension, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":81 * from .queues import QueueExtension * from .semaphore import SemaphoreExtension * from .recreate_exceptions import ReplayExceptionScheduler # <<<<<<<<<<<<<< * from .lock import LockExtension * from .event import EventExtension */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_ReplayExceptionScheduler); __Pyx_GIVEREF(__pyx_n_s_ReplayExceptionScheduler); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ReplayExceptionScheduler); __pyx_t_1 = __Pyx_Import(__pyx_n_s_recreate_exceptions, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ReplayExceptionScheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ReplayExceptionScheduler, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":82 * from .semaphore import SemaphoreExtension * from .recreate_exceptions import ReplayExceptionScheduler * from .lock import LockExtension # <<<<<<<<<<<<<< * from .event import EventExtension * from .pubsub import PubSubSchedulerExtension */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_LockExtension); __Pyx_GIVEREF(__pyx_n_s_LockExtension); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_LockExtension); __pyx_t_2 = __Pyx_Import(__pyx_n_s_lock_2, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_LockExtension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LockExtension, __pyx_t_1) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":83 * from .recreate_exceptions import ReplayExceptionScheduler * from .lock import LockExtension * from .event import EventExtension # <<<<<<<<<<<<<< * from .pubsub import PubSubSchedulerExtension * from .stealing import WorkStealing */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_EventExtension); __Pyx_GIVEREF(__pyx_n_s_EventExtension); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_EventExtension); __pyx_t_1 = __Pyx_Import(__pyx_n_s_event, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_EventExtension); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventExtension, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":84 * from .lock import LockExtension * from .event import EventExtension * from .pubsub import PubSubSchedulerExtension # <<<<<<<<<<<<<< * from .stealing import WorkStealing * from .variable import VariableExtension */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PubSubSchedulerExtension); __Pyx_GIVEREF(__pyx_n_s_PubSubSchedulerExtension); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PubSubSchedulerExtension); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pubsub, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PubSubSchedulerExtension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PubSubSchedulerExtension, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":85 * from .event import EventExtension * from .pubsub import PubSubSchedulerExtension * from .stealing import WorkStealing # <<<<<<<<<<<<<< * from .variable import VariableExtension * from .protocol.highlevelgraph import highlevelgraph_unpack */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_WorkStealing); __Pyx_GIVEREF(__pyx_n_s_WorkStealing); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_WorkStealing); __pyx_t_1 = __Pyx_Import(__pyx_n_s_stealing, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_WorkStealing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WorkStealing, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":86 * from .pubsub import PubSubSchedulerExtension * from .stealing import WorkStealing * from .variable import VariableExtension # <<<<<<<<<<<<<< * from .protocol.highlevelgraph import highlevelgraph_unpack * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_VariableExtension); __Pyx_GIVEREF(__pyx_n_s_VariableExtension); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_VariableExtension); __pyx_t_2 = __Pyx_Import(__pyx_n_s_variable, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_VariableExtension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VariableExtension, __pyx_t_1) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":87 * from .stealing import WorkStealing * from .variable import VariableExtension * from .protocol.highlevelgraph import highlevelgraph_unpack # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_highlevelgraph_unpack); __Pyx_GIVEREF(__pyx_n_s_highlevelgraph_unpack); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_highlevelgraph_unpack); __pyx_t_1 = __Pyx_Import(__pyx_n_s_protocol_highlevelgraph, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_highlevelgraph_unpack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_highlevelgraph_unpack, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "distributed/scheduler.py":89 * from .protocol.highlevelgraph import highlevelgraph_unpack * * try: # <<<<<<<<<<<<<< * from cython import compiled * except ImportError: */ { (void)__pyx_t_3; (void)__pyx_t_4; (void)__pyx_t_5; /* mark used */ /*try:*/ { } } /* "distributed/scheduler.py":94 * compiled = False * * if compiled: # <<<<<<<<<<<<<< * from cython import ( * bint, */ __pyx_t_6 = (1 != 0); if (__pyx_t_6) { goto __pyx_L8; } /* "distributed/scheduler.py":111 * ) * else: * from ctypes import ( # <<<<<<<<<<<<<< * c_double as double, * c_ssize_t as Py_hash_t, */ /*else*/ { /* "distributed/scheduler.py":112 * else: * from ctypes import ( * c_double as double, # <<<<<<<<<<<<<< * c_ssize_t as Py_hash_t, * c_ssize_t as Py_ssize_t, */ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_c_double); __Pyx_GIVEREF(__pyx_n_s_c_double); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_c_double); __Pyx_INCREF(__pyx_n_s_c_ssize_t); __Pyx_GIVEREF(__pyx_n_s_c_ssize_t); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_c_ssize_t); __Pyx_INCREF(__pyx_n_s_c_ssize_t); __Pyx_GIVEREF(__pyx_n_s_c_ssize_t); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_c_ssize_t); /* "distributed/scheduler.py":111 * ) * else: * from ctypes import ( # <<<<<<<<<<<<<< * c_double as double, * c_ssize_t as Py_hash_t, */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_ctypes, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_c_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_double, __pyx_t_1) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_c_ssize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Py_hash_t, __pyx_t_1) < 0) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_c_ssize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Py_ssize_t, __pyx_t_1) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":117 * ) * * bint = bool # <<<<<<<<<<<<<< * * def cast(T, v, *a, **k): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_bint, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 117, __pyx_L1_error) /* "distributed/scheduler.py":119 * bint = bool * * def cast(T, v, *a, **k): # <<<<<<<<<<<<<< * return v * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_1cast, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cast, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":122 * return v * * def ccall(func): # <<<<<<<<<<<<<< * return func * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_3ccall, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ccall, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":125 * return func * * def cclass(cls): # <<<<<<<<<<<<<< * return cls * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_5cclass, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cclass, __pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":128 * return cls * * def cfunc(func): # <<<<<<<<<<<<<< * return func * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_7cfunc, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cfunc, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":131 * return func * * def declare(*a, **k): # <<<<<<<<<<<<<< * if len(a) == 2: * return a[1] */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_9declare, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_declare, __pyx_t_2) < 0) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":137 * pass * * def exceptval(*a, **k): # <<<<<<<<<<<<<< * def wrapper(func): * return func */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_11exceptval, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_exceptval, __pyx_t_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":143 * return wrapper * * def final(cls): # <<<<<<<<<<<<<< * return cls * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_13final, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_final, __pyx_t_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":146 * return cls * * def inline(func): # <<<<<<<<<<<<<< * return func * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_15inline, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_inline, __pyx_t_2) < 0) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":149 * return func * * def nogil(func): # <<<<<<<<<<<<<< * return func * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_17nogil, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_nogil, __pyx_t_2) < 0) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L8:; /* "distributed/scheduler.py":153 * * * if sys.version_info < (3, 8): # <<<<<<<<<<<<<< * try: * import pickle5 as pickle */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__113, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { /* "distributed/scheduler.py":154 * * if sys.version_info < (3, 8): * try: # <<<<<<<<<<<<<< * import pickle5 as pickle * except ImportError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "distributed/scheduler.py":155 * if sys.version_info < (3, 8): * try: * import pickle5 as pickle # <<<<<<<<<<<<<< * except ImportError: * import pickle */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pickle5, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_2) < 0) __PYX_ERR(0, 155, __pyx_L10_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":154 * * if sys.version_info < (3, 8): * try: # <<<<<<<<<<<<<< * import pickle5 as pickle * except ImportError: */ } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L15_try_end; __pyx_L10_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":156 * try: * import pickle5 as pickle * except ImportError: # <<<<<<<<<<<<<< * import pickle * else: */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_7) { __Pyx_AddTraceback("distributed.scheduler", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 156, __pyx_L12_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); /* "distributed/scheduler.py":157 * import pickle5 as pickle * except ImportError: * import pickle # <<<<<<<<<<<<<< * else: * import pickle */ __pyx_t_9 = __Pyx_Import(__pyx_n_s_pickle, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 157, __pyx_L12_except_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_9) < 0) __PYX_ERR(0, 157, __pyx_L12_except_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_exception_handled; } goto __pyx_L12_except_error; __pyx_L12_except_error:; /* "distributed/scheduler.py":154 * * if sys.version_info < (3, 8): * try: # <<<<<<<<<<<<<< * import pickle5 as pickle * except ImportError: */ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; __pyx_L11_exception_handled:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); __pyx_L15_try_end:; } /* "distributed/scheduler.py":153 * * * if sys.version_info < (3, 8): # <<<<<<<<<<<<<< * try: * import pickle5 as pickle */ goto __pyx_L9; } /* "distributed/scheduler.py":159 * import pickle * else: * import pickle # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_8 = __Pyx_Import(__pyx_n_s_pickle, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_8) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L9:; /* "distributed/scheduler.py":162 * * * logger = logging.getLogger(__name__) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_logging); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_name_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_2) < 0) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":165 * * * LOG_PDB = dask.config.get("distributed.admin.pdb-on-err") # <<<<<<<<<<<<<< * DEFAULT_DATA_SIZE = declare( * Py_ssize_t, parse_bytes(dask.config.get("distributed.scheduler.default-data-size")) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_LOG_PDB, __pyx_t_8) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "distributed/scheduler.py":167 * LOG_PDB = dask.config.get("distributed.admin.pdb-on-err") * DEFAULT_DATA_SIZE = declare( * Py_ssize_t, parse_bytes(dask.config.get("distributed.scheduler.default-data-size")) # <<<<<<<<<<<<<< * ) * UNKNOWN_TASK_DURATION = declare( */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_bytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_11distributed_9scheduler_DEFAULT_DATA_SIZE = __pyx_t_10; /* "distributed/scheduler.py":171 * UNKNOWN_TASK_DURATION = declare( * double, * parse_timedelta(dask.config.get("distributed.scheduler.unknown-task-duration")), # <<<<<<<<<<<<<< * ) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_11distributed_9scheduler_UNKNOWN_TASK_DURATION = __pyx_t_11; /* "distributed/scheduler.py":175 * * DEFAULT_EXTENSIONS = [ * LockExtension, # <<<<<<<<<<<<<< * PublishExtension, * ReplayExceptionScheduler, */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LockExtension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "distributed/scheduler.py":176 * DEFAULT_EXTENSIONS = [ * LockExtension, * PublishExtension, # <<<<<<<<<<<<<< * ReplayExceptionScheduler, * QueueExtension, */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PublishExtension); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "distributed/scheduler.py":177 * LockExtension, * PublishExtension, * ReplayExceptionScheduler, # <<<<<<<<<<<<<< * QueueExtension, * VariableExtension, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ReplayExceptionScheduler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "distributed/scheduler.py":178 * PublishExtension, * ReplayExceptionScheduler, * QueueExtension, # <<<<<<<<<<<<<< * VariableExtension, * PubSubSchedulerExtension, */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_QueueExtension); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "distributed/scheduler.py":179 * ReplayExceptionScheduler, * QueueExtension, * VariableExtension, # <<<<<<<<<<<<<< * PubSubSchedulerExtension, * SemaphoreExtension, */ __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_VariableExtension); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "distributed/scheduler.py":180 * QueueExtension, * VariableExtension, * PubSubSchedulerExtension, # <<<<<<<<<<<<<< * SemaphoreExtension, * EventExtension, */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PubSubSchedulerExtension); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "distributed/scheduler.py":181 * VariableExtension, * PubSubSchedulerExtension, * SemaphoreExtension, # <<<<<<<<<<<<<< * EventExtension, * ] */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SemaphoreExtension); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "distributed/scheduler.py":182 * PubSubSchedulerExtension, * SemaphoreExtension, * EventExtension, # <<<<<<<<<<<<<< * ] * */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_EventExtension); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); /* "distributed/scheduler.py":174 * ) * * DEFAULT_EXTENSIONS = [ # <<<<<<<<<<<<<< * LockExtension, * PublishExtension, */ __pyx_t_16 = PyList_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_16, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_9); PyList_SET_ITEM(__pyx_t_16, 3, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_12); PyList_SET_ITEM(__pyx_t_16, 4, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_13); PyList_SET_ITEM(__pyx_t_16, 5, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_14); PyList_SET_ITEM(__pyx_t_16, 6, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_15); PyList_SET_ITEM(__pyx_t_16, 7, __pyx_t_15); __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_2 = 0; __pyx_t_9 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_EXTENSIONS, __pyx_t_16) < 0) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":185 * ] * * ALL_TASK_STATES = declare( # <<<<<<<<<<<<<< * set, {"released", "waiting", "no-worker", "processing", "erred", "memory"} * ) */ __pyx_t_16 = PySet_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PySet_Add(__pyx_t_16, __pyx_n_u_released) < 0) __PYX_ERR(0, 186, __pyx_L1_error) if (PySet_Add(__pyx_t_16, __pyx_n_u_waiting) < 0) __PYX_ERR(0, 186, __pyx_L1_error) if (PySet_Add(__pyx_t_16, __pyx_kp_u_no_worker) < 0) __PYX_ERR(0, 186, __pyx_L1_error) if (PySet_Add(__pyx_t_16, __pyx_n_u_processing_2) < 0) __PYX_ERR(0, 186, __pyx_L1_error) if (PySet_Add(__pyx_t_16, __pyx_n_u_erred) < 0) __PYX_ERR(0, 186, __pyx_L1_error) if (PySet_Add(__pyx_t_16, __pyx_n_u_memory_2) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_11distributed_9scheduler_ALL_TASK_STATES); __Pyx_DECREF_SET(__pyx_v_11distributed_9scheduler_ALL_TASK_STATES, ((PyObject*)__pyx_t_16)); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":188 * set, {"released", "waiting", "no-worker", "processing", "erred", "memory"} * ) * globals()["ALL_TASK_STATES"] = ALL_TASK_STATES # <<<<<<<<<<<<<< * * */ __pyx_t_16 = __Pyx_Globals(); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (unlikely(PyObject_SetItem(__pyx_t_16, __pyx_n_u_ALL_TASK_STATES, __pyx_v_11distributed_9scheduler_ALL_TASK_STATES) < 0)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":220 * _versions: dict * * __slots__ = ("_client_key", "_hash", "_wants_what", "_last_seen", "_versions") # <<<<<<<<<<<<<< * * def __init__(self, client: str, versions: dict = None): */ if (PyDict_SetItem((PyObject *)__pyx_ptype_11distributed_9scheduler_ClientState->tp_dict, __pyx_n_s_slots, __pyx_tuple__117) < 0) __PYX_ERR(0, 220, __pyx_L1_error) PyType_Modified(__pyx_ptype_11distributed_9scheduler_ClientState); /* "distributed/scheduler.py":379 * * __slots__ = ( * "_actors", # <<<<<<<<<<<<<< * "_address", * "_bandwidth", */ if (PyDict_SetItem((PyObject *)__pyx_ptype_11distributed_9scheduler_WorkerState->tp_dict, __pyx_n_s_slots, __pyx_tuple__118) < 0) __PYX_ERR(0, 378, __pyx_L1_error) PyType_Modified(__pyx_ptype_11distributed_9scheduler_WorkerState); /* "distributed/scheduler.py":1145 * __slots__ = ( * # === General description === * "_actor", # <<<<<<<<<<<<<< * # Key name * "_key", */ if (PyDict_SetItem((PyObject *)__pyx_ptype_11distributed_9scheduler_TaskState->tp_dict, __pyx_n_s_slots, __pyx_tuple__119) < 0) __PYX_ERR(0, 1143, __pyx_L1_error) PyType_Modified(__pyx_ptype_11distributed_9scheduler_TaskState); /* "distributed/scheduler.py":1423 * * * class _StateLegacyMapping(Mapping): # <<<<<<<<<<<<<< * """ * A mapping interface mimicking the former Scheduler state dictionaries. */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_14 = __Pyx_Py3MetaclassPrepare(__pyx_t_16, __pyx_t_15, __pyx_n_s_StateLegacyMapping, __pyx_n_s_StateLegacyMapping, (PyObject *) NULL, __pyx_n_s_distributed_scheduler, __pyx_kp_s_A_mapping_interface_mimicking_t); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "distributed/scheduler.py":1428 * """ * * def __init__(self, states, accessor): # <<<<<<<<<<<<<< * self._states = states * self._accessor = accessor */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_1__init__, 0, __pyx_n_s_StateLegacyMapping___init, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_init, __pyx_t_13) < 0) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1432 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self._states) * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_3__iter__, 0, __pyx_n_s_StateLegacyMapping___iter, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_iter, __pyx_t_13) < 0) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1435 * return iter(self._states) * * def __len__(self): # <<<<<<<<<<<<<< * return len(self._states) * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_5__len__, 0, __pyx_n_s_StateLegacyMapping___len, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_len_2, __pyx_t_13) < 0) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1438 * return len(self._states) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self._accessor(self._states[key]) * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_7__getitem__, 0, __pyx_n_s_StateLegacyMapping___getitem, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_getitem, __pyx_t_13) < 0) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1441 * return self._accessor(self._states[key]) * * def __repr__(self): # <<<<<<<<<<<<<< * return "%s(%s)" % (self.__class__, dict(self)) * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_19_StateLegacyMapping_9__repr__, 0, __pyx_n_s_StateLegacyMapping___repr, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_repr, __pyx_t_13) < 0) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1423 * * * class _StateLegacyMapping(Mapping): # <<<<<<<<<<<<<< * """ * A mapping interface mimicking the former Scheduler state dictionaries. */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_16, __pyx_n_s_StateLegacyMapping, __pyx_t_15, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_StateLegacyMapping, __pyx_t_13) < 0) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":1445 * * * class _OptionalStateLegacyMapping(_StateLegacyMapping): # <<<<<<<<<<<<<< * """ * Similar to _StateLegacyMapping, but a false-y value is interpreted */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_StateLegacyMapping); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_16, __pyx_n_s_OptionalStateLegacyMapping, __pyx_n_s_OptionalStateLegacyMapping, (PyObject *) NULL, __pyx_n_s_distributed_scheduler, __pyx_kp_s_Similar_to__StateLegacyMapping); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "distributed/scheduler.py":1453 * # For tasks etc. * * def __iter__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * for k, v in self._states.items(): */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_27_OptionalStateLegacyMapping_1__iter__, 0, __pyx_n_s_OptionalStateLegacyMapping___it, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_iter, __pyx_t_13) < 0) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1459 * yield k * * def __len__(self): # <<<<<<<<<<<<<< * accessor = self._accessor * return sum(bool(accessor(v)) for v in self._states.values()) */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_27_OptionalStateLegacyMapping_4__len__, 0, __pyx_n_s_OptionalStateLegacyMapping___le_2, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_len_2, __pyx_t_13) < 0) __PYX_ERR(0, 1459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1463 * return sum(bool(accessor(v)) for v in self._states.values()) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * v = self._accessor(self._states[key]) * if v: */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_27_OptionalStateLegacyMapping_6__getitem__, 0, __pyx_n_s_OptionalStateLegacyMapping___ge, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_getitem, __pyx_t_13) < 0) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1445 * * * class _OptionalStateLegacyMapping(_StateLegacyMapping): # <<<<<<<<<<<<<< * """ * Similar to _StateLegacyMapping, but a false-y value is interpreted */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_OptionalStateLegacyMapping, __pyx_t_16, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_OptionalStateLegacyMapping, __pyx_t_13) < 0) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":1471 * * * class _StateLegacySet(Set): # <<<<<<<<<<<<<< * """ * Similar to _StateLegacyMapping, but exposes a set containing */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_Set); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_14 = __Pyx_Py3MetaclassPrepare(__pyx_t_16, __pyx_t_15, __pyx_n_s_StateLegacySet, __pyx_n_s_StateLegacySet, (PyObject *) NULL, __pyx_n_s_distributed_scheduler, __pyx_kp_s_Similar_to__StateLegacyMapping_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "distributed/scheduler.py":1479 * # For loose_restrictions * * def __init__(self, states, accessor): # <<<<<<<<<<<<<< * self._states = states * self._accessor = accessor */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_15_StateLegacySet_1__init__, 0, __pyx_n_s_StateLegacySet___init, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_init, __pyx_t_13) < 0) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1483 * self._accessor = accessor * * def __iter__(self): # <<<<<<<<<<<<<< * return (k for k, v in self._states.items() if self._accessor(v)) * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_15_StateLegacySet_3__iter__, 0, __pyx_n_s_StateLegacySet___iter, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_iter, __pyx_t_13) < 0) __PYX_ERR(0, 1483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1486 * return (k for k, v in self._states.items() if self._accessor(v)) * * def __len__(self): # <<<<<<<<<<<<<< * return sum(map(bool, map(self._accessor, self._states.values()))) * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_15_StateLegacySet_5__len__, 0, __pyx_n_s_StateLegacySet___len, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_len_2, __pyx_t_13) < 0) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1489 * return sum(map(bool, map(self._accessor, self._states.values()))) * * def __contains__(self, k): # <<<<<<<<<<<<<< * st = self._states.get(k) * return st is not None and bool(self._accessor(st)) */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_15_StateLegacySet_7__contains__, 0, __pyx_n_s_StateLegacySet___contains, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_contains, __pyx_t_13) < 0) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1493 * return st is not None and bool(self._accessor(st)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "%s(%s)" % (self.__class__, set(self)) * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_15_StateLegacySet_9__repr__, 0, __pyx_n_s_StateLegacySet___repr, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_repr, __pyx_t_13) < 0) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":1471 * * * class _StateLegacySet(Set): # <<<<<<<<<<<<<< * """ * Similar to _StateLegacyMapping, but exposes a set containing */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_16, __pyx_n_s_StateLegacySet, __pyx_t_15, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_StateLegacySet, __pyx_t_13) < 0) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":1497 * * * def _legacy_task_key_set(tasks): # <<<<<<<<<<<<<< * """ * Transform a set of task states into a set of task keys. */ __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_19_legacy_task_key_set, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_d, __pyx_n_s_legacy_task_key_set, __pyx_t_15) < 0) __PYX_ERR(0, 1497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":1505 * * * def _legacy_client_key_set(clients): # <<<<<<<<<<<<<< * """ * Transform a set of client states into a set of client keys. */ __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_21_legacy_client_key_set, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_d, __pyx_n_s_legacy_client_key_set, __pyx_t_15) < 0) __PYX_ERR(0, 1505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":1513 * * * def _legacy_worker_key_set(workers): # <<<<<<<<<<<<<< * """ * Transform a set of worker states into a set of worker keys. */ __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_23_legacy_worker_key_set, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_d, __pyx_n_s_legacy_worker_key_set, __pyx_t_15) < 0) __PYX_ERR(0, 1513, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":1521 * * * def _legacy_task_key_dict(task_dict): # <<<<<<<<<<<<<< * """ * Transform a dict of {task state: value} into a dict of {task key: value}. */ __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_25_legacy_task_key_dict, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_d, __pyx_n_s_legacy_task_key_dict, __pyx_t_15) < 0) __PYX_ERR(0, 1521, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":1529 * * * def _task_key_or_none(task): # <<<<<<<<<<<<<< * return task.key if task is not None else None * */ __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_27_task_key_or_none, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_d, __pyx_n_s_task_key_or_none, __pyx_t_15) < 0) __PYX_ERR(0, 1529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":2592 * @ccall * @exceptval(check=False) * def check_idle_saturated(self, ws: WorkerState, occ: double = -1.0): # <<<<<<<<<<<<<< * """Update the status of the idle and saturated state * */ __pyx_k__13 = (-1.0); __pyx_k__13 = (-1.0); /* "distributed/scheduler.py":2764 * * * class Scheduler(SchedulerState, ServerNode): # <<<<<<<<<<<<<< * """Dynamic distributed task scheduler * */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_ServerNode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(((PyObject *)__pyx_ptype_11distributed_9scheduler_SchedulerState)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_11distributed_9scheduler_SchedulerState)); PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_ptype_11distributed_9scheduler_SchedulerState)); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_16, __pyx_n_s_Scheduler, __pyx_n_s_Scheduler, (PyObject *) NULL, __pyx_n_s_distributed_scheduler, __pyx_kp_s_Dynamic_distributed_task_schedul); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "distributed/scheduler.py":2834 * """ * * default_port = 8786 # <<<<<<<<<<<<<< * _instances = weakref.WeakSet() * */ if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_default_port, __pyx_int_8786) < 0) __PYX_ERR(0, 2834, __pyx_L1_error) /* "distributed/scheduler.py":2835 * * default_port = 8786 * _instances = weakref.WeakSet() # <<<<<<<<<<<<<< * * def __init__( */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_weakref); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_WeakSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_12 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_instances, __pyx_t_12) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":2837 * _instances = weakref.WeakSet() * * def __init__( # <<<<<<<<<<<<<< * self, * loop=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_1__init__, 0, __pyx_n_s_Scheduler___init, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_12); PyList_Append(__pyx_t_13, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__157); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_init, __pyx_t_12) < 0) __PYX_ERR(0, 2837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3181 * ################## * * def __repr__(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * return '' % ( */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_3__repr__, 0, __pyx_n_s_Scheduler___repr, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_repr, __pyx_t_12) < 0) __PYX_ERR(0, 3181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3189 * ) * * def identity(self, comm=None): # <<<<<<<<<<<<<< * """ Basic information about ourselves and our cluster """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_5identity, 0, __pyx_n_s_Scheduler_identity, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__162); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_identity, __pyx_t_12) < 0) __PYX_ERR(0, 3189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3204 * return d * * def get_worker_service_addr(self, worker, service_name, protocol=False): # <<<<<<<<<<<<<< * """ * Get the (host, port) address of the named service on the *worker*. */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_7get_worker_service_addr, 0, __pyx_n_s_Scheduler_get_worker_service_add, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__165); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_worker_service_addr, __pyx_t_12) < 0) __PYX_ERR(0, 3204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3232 * return ws.host, port * * async def start(self): # <<<<<<<<<<<<<< * """ Clear out old state and restart all running coroutines """ * await super().start() */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_9start, 0, __pyx_n_s_Scheduler_start, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_12); PyList_Append(__pyx_t_13, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_start, __pyx_t_12) < 0) __PYX_ERR(0, 3232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3293 * return self * * async def close(self, comm=None, fast=False, close_workers=False): # <<<<<<<<<<<<<< * """Send cleanup signal to all coroutines then wait until finished * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_12close, 0, __pyx_n_s_Scheduler_close, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_12); PyList_Append(__pyx_t_13, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__168); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_close, __pyx_t_12) < 0) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3358 * disable_gc_diagnosis() * * async def close_worker(self, comm=None, worker=None, safe=None): # <<<<<<<<<<<<<< * """Remove a worker from the cluster * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_15close_worker, 0, __pyx_n_s_Scheduler_close_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__170); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_close_worker, __pyx_t_12) < 0) __PYX_ERR(0, 3358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3380 * ########### * * def heartbeat_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_18heartbeat_worker, 0, __pyx_n_s_Scheduler_heartbeat_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__173); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_heartbeat_worker, __pyx_t_12) < 0) __PYX_ERR(0, 3380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3454 * } * * async def add_worker( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_20add_worker, 0, __pyx_n_s_Scheduler_add_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__175); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_add_worker, __pyx_t_12) < 0) __PYX_ERR(0, 3454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3605 * await self.handle_worker(comm=comm, worker=address) * * def update_graph_hlg( # <<<<<<<<<<<<<< * self, * client=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_23update_graph_hlg, 0, __pyx_n_s_Scheduler_update_graph_hlg, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__178); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_update_graph_hlg_2, __pyx_t_12) < 0) __PYX_ERR(0, 3605, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3659 * ) * * def update_graph( # <<<<<<<<<<<<<< * self, * client=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_25update_graph, 0, __pyx_n_s_Scheduler_update_graph, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__181); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_update_graph_2, __pyx_t_12) < 0) __PYX_ERR(0, 3659, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3932 * # TODO: balance workers * * def new_task(self, key, spec, state): # <<<<<<<<<<<<<< * """ Create a new task, and associated states """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_27new_task, 0, __pyx_n_s_Scheduler_new_task, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_new_task, __pyx_t_12) < 0) __PYX_ERR(0, 3932, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3955 * return ts * * def stimulus_task_finished(self, key=None, worker=None, **kwargs): # <<<<<<<<<<<<<< * """ Mark that a task has finished execution on a particular worker """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_29stimulus_task_finished, 0, __pyx_n_s_Scheduler_stimulus_task_finished, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__186); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_stimulus_task_finished, __pyx_t_12) < 0) __PYX_ERR(0, 3955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":3988 * return recommendations * * def stimulus_task_erred( # <<<<<<<<<<<<<< * self, key=None, worker=None, exception=None, traceback=None, **kwargs * ): */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_31stimulus_task_erred, 0, __pyx_n_s_Scheduler_stimulus_task_erred, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__189); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_stimulus_task_erred, __pyx_t_12) < 0) __PYX_ERR(0, 3988, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4020 * return recommendations * * def stimulus_missing_data( # <<<<<<<<<<<<<< * self, cause=None, key=None, worker=None, ensure=True, **kwargs * ): */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_33stimulus_missing_data, 0, __pyx_n_s_Scheduler_stimulus_missing_data, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__192); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_stimulus_missing_data, __pyx_t_12) < 0) __PYX_ERR(0, 4020, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4053 * return {} * * def stimulus_retry(self, comm=None, keys=None, client=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * logger.info("Client %s requests to retry %d keys", client, len(keys)) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_35stimulus_retry, 0, __pyx_n_s_Scheduler_stimulus_retry, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__195); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_stimulus_retry, __pyx_t_12) < 0) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4083 * return tuple(seen) * * async def remove_worker(self, comm=None, address=None, safe=False, close=True): # <<<<<<<<<<<<<< * """ * Remove worker from cluster */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_37remove_worker, 0, __pyx_n_s_Scheduler_remove_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__197); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_remove_worker, __pyx_t_12) < 0) __PYX_ERR(0, 4083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4198 * return "OK" * * def stimulus_cancel(self, comm, keys=None, client=None, force=False): # <<<<<<<<<<<<<< * """ Stop execution on a list of keys """ * logger.info("Client %s requests to cancel %d keys", client, len(keys)) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_40stimulus_cancel, 0, __pyx_n_s_Scheduler_stimulus_cancel, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__200); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_stimulus_cancel, __pyx_t_12) < 0) __PYX_ERR(0, 4198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4208 * self.cancel_key(key, client, force=force) * * def cancel_key(self, key, client, retries=5, force=False): # <<<<<<<<<<<<<< * """ Cancel a particular key and all dependents """ * # TODO: this should be converted to use the transition mechanism */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_42cancel_key, 0, __pyx_n_s_Scheduler_cancel_key, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__203); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_cancel_key, __pyx_t_12) < 0) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4233 * self.client_releases_keys(keys=[key], client=cs._client_key) * * def client_desires_keys(self, keys=None, client=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * cs: ClientState = parent._clients.get(client) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_44client_desires_keys, 0, __pyx_n_s_Scheduler_client_desires_keys, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__206); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_client_desires_keys_2, __pyx_t_12) < 0) __PYX_ERR(0, 4233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4251 * self.report_on_key(ts=ts, client=client) * * def client_releases_keys(self, keys=None, client=None): # <<<<<<<<<<<<<< * """ Remove keys from client desired list """ * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_46client_releases_keys, 0, __pyx_n_s_Scheduler_client_releases_keys, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__209); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_client_releases_keys_2, __pyx_t_12) < 0) __PYX_ERR(0, 4251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4263 * self.transitions(recommendations) * * def client_heartbeat(self, client=None): # <<<<<<<<<<<<<< * """ Handle heartbeats from Client """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_48client_heartbeat, 0, __pyx_n_s_Scheduler_client_heartbeat, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__212); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_client_heartbeat, __pyx_t_12) < 0) __PYX_ERR(0, 4263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4273 * ################### * * def validate_released(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_50validate_released, 0, __pyx_n_s_Scheduler_validate_released, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_validate_released, __pyx_t_12) < 0) __PYX_ERR(0, 4273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4285 * assert ts not in parent._unrunnable * * def validate_waiting(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_52validate_waiting, 0, __pyx_n_s_Scheduler_validate_waiting, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_validate_waiting, __pyx_t_12) < 0) __PYX_ERR(0, 4285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4298 * assert ts in dts._waiters # XXX even if dts._who_has? * * def validate_processing(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_54validate_processing, 0, __pyx_n_s_Scheduler_validate_processing, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_validate_processing, __pyx_t_12) < 0) __PYX_ERR(0, 4298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4311 * assert ts in dts._waiters * * def validate_memory(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_56validate_memory, 0, __pyx_n_s_Scheduler_validate_memory, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_validate_memory, __pyx_t_12) < 0) __PYX_ERR(0, 4311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4323 * assert ts not in dts._waiting_on * * def validate_no_worker(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_58validate_no_worker, 0, __pyx_n_s_Scheduler_validate_no_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_validate_no_worker, __pyx_t_12) < 0) __PYX_ERR(0, 4323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4335 * assert dts._who_has * * def validate_erred(self, key): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks[key] */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_60validate_erred, 0, __pyx_n_s_Scheduler_validate_erred, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_validate_erred, __pyx_t_12) < 0) __PYX_ERR(0, 4335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4341 * assert not ts._who_has * * def validate_key(self, key, ts: TaskState = None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * try: */ __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_ts, __pyx_n_u_TaskState) < 0) __PYX_ERR(0, 4341, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_62validate_key, 0, __pyx_n_s_Scheduler_validate_key, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__227); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_validate_key, __pyx_t_2) < 0) __PYX_ERR(0, 4341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4366 * raise * * def validate_state(self, allow_overlap=False): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * validate_state(parent._tasks, parent._workers, parent._clients) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_64validate_state, 0, __pyx_n_s_Scheduler_validate_state, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__230); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_validate_state, __pyx_t_2) < 0) __PYX_ERR(0, 4366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4417 * ################### * * def report(self, msg: dict, ts: TaskState = None, client: str = None): # <<<<<<<<<<<<<< * """ * Publish updates to all listening Queues and Comms */ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_msg, __pyx_n_u_dict_2) < 0) __PYX_ERR(0, 4417, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ts, __pyx_n_u_TaskState) < 0) __PYX_ERR(0, 4417, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client, __pyx_n_u_unicode) < 0) __PYX_ERR(0, 4417, __pyx_L1_error) __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_66report, 0, __pyx_n_s_Scheduler_report, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__233); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_report, __pyx_t_12) < 0) __PYX_ERR(0, 4417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4459 * logger.critical("Tried writing to closed comm: %s", msg) * * async def add_client(self, comm, client=None, versions=None): # <<<<<<<<<<<<<< * """Add client to network * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_68add_client, 0, __pyx_n_s_Scheduler_add_client, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__235); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_add_client, __pyx_t_12) < 0) __PYX_ERR(0, 4459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4508 * pass * * def remove_client(self, client=None): # <<<<<<<<<<<<<< * """ Remove client from network """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_71remove_client, 0, __pyx_n_s_Scheduler_remove_client, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__238); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_remove_client, __pyx_t_12) < 0) __PYX_ERR(0, 4508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4542 * self.loop.call_later(cleanup_delay, remove_client_from_events) * * def send_task_to_worker(self, worker, ts: TaskState, duration=None): # <<<<<<<<<<<<<< * """ Send a single computational task to a worker """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_ts, __pyx_n_u_TaskState) < 0) __PYX_ERR(0, 4542, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_73send_task_to_worker, 0, __pyx_n_s_Scheduler_send_task_to_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__241); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_send_task_to_worker, __pyx_t_2) < 0) __PYX_ERR(0, 4542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4556 * raise * * def handle_uncaught_error(self, **msg): # <<<<<<<<<<<<<< * logger.exception(clean_exception(**msg)[1]) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_75handle_uncaught_error, 0, __pyx_n_s_Scheduler_handle_uncaught_error, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_handle_uncaught_error, __pyx_t_2) < 0) __PYX_ERR(0, 4556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4559 * logger.exception(clean_exception(**msg)[1]) * * def handle_task_finished(self, key=None, worker=None, **msg): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * if worker not in parent._workers_dv: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_77handle_task_finished, 0, __pyx_n_s_Scheduler_handle_task_finished, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__246); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_handle_task_finished, __pyx_t_2) < 0) __PYX_ERR(0, 4559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4567 * self.transitions(r) * * def handle_task_erred(self, key=None, **msg): # <<<<<<<<<<<<<< * r = self.stimulus_task_erred(key=key, **msg) * self.transitions(r) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_79handle_task_erred, 0, __pyx_n_s_Scheduler_handle_task_erred, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__249); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_handle_task_erred, __pyx_t_2) < 0) __PYX_ERR(0, 4567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4571 * self.transitions(r) * * def handle_release_data(self, key=None, worker=None, client=None, **msg): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState = parent._tasks.get(key) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_81handle_release_data, 0, __pyx_n_s_Scheduler_handle_release_data, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__252); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_handle_release_data, __pyx_t_2) < 0) __PYX_ERR(0, 4571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4582 * self.transitions(r) * * def handle_missing_data(self, key=None, errant_worker=None, **kwargs): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * logger.debug("handle missing data key=%s worker=%s", key, errant_worker) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_83handle_missing_data, 0, __pyx_n_s_Scheduler_handle_missing_data, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__255); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_handle_missing_data, __pyx_t_2) < 0) __PYX_ERR(0, 4582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4602 * self.transitions({key: "forgotten"}) * * def release_worker_data(self, comm=None, keys=None, worker=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_85release_worker_data, 0, __pyx_n_s_Scheduler_release_worker_data, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__258); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_release_worker_data_2, __pyx_t_2) < 0) __PYX_ERR(0, 4602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4620 * self.transitions(recommendations) * * def handle_long_running(self, key=None, worker=None, compute_duration=None): # <<<<<<<<<<<<<< * """A task has seceded from the thread pool * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_87handle_long_running, 0, __pyx_n_s_Scheduler_handle_long_running, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__261); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_handle_long_running, __pyx_t_2) < 0) __PYX_ERR(0, 4620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4651 * self.check_idle_saturated(ws) * * async def handle_worker(self, comm=None, worker=None): # <<<<<<<<<<<<<< * """ * Listen to responses from a single worker */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_89handle_worker, 0, __pyx_n_s_Scheduler_handle_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__263); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_handle_worker, __pyx_t_2) < 0) __PYX_ERR(0, 4651, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4672 * await self.remove_worker(address=worker) * * def add_plugin(self, plugin=None, idempotent=False, **kwargs): # <<<<<<<<<<<<<< * """ * Add external plugin to scheduler */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_92add_plugin, 0, __pyx_n_s_Scheduler_add_plugin, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__266); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_add_plugin, __pyx_t_2) < 0) __PYX_ERR(0, 4672, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4686 * self.plugins.append(plugin) * * def remove_plugin(self, plugin): # <<<<<<<<<<<<<< * """ Remove external plugin from scheduler """ * self.plugins.remove(plugin) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_94remove_plugin, 0, __pyx_n_s_Scheduler_remove_plugin, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_remove_plugin, __pyx_t_2) < 0) __PYX_ERR(0, 4686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4690 * self.plugins.remove(plugin) * * def worker_send(self, worker, msg): # <<<<<<<<<<<<<< * """Send message to worker * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_96worker_send, 0, __pyx_n_s_Scheduler_worker_send, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_worker_send, __pyx_t_2) < 0) __PYX_ERR(0, 4690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4702 * self.loop.add_callback(self.remove_worker, address=worker) * * def client_send(self, client, msg): # <<<<<<<<<<<<<< * """Send message to client""" * client_comms: dict = self.client_comms */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_98client_send, 0, __pyx_n_s_Scheduler_client_send, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_client_send, __pyx_t_2) < 0) __PYX_ERR(0, 4702, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":4714 * logger.critical("Tried writing to closed comm: %s", msg) * * def send_all(self, client_msgs: dict, worker_msgs: dict): # <<<<<<<<<<<<<< * """Send messages to client and workers""" * stream_comms: dict = self.stream_comms */ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client_msgs, __pyx_n_u_dict_2) < 0) __PYX_ERR(0, 4714, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_worker_msgs, __pyx_n_u_dict_2) < 0) __PYX_ERR(0, 4714, __pyx_L1_error) __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_100send_all, 0, __pyx_n_s_Scheduler_send_all, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_send_all, __pyx_t_12) < 0) __PYX_ERR(0, 4714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4741 * ############################ * * async def scatter( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_102scatter, 0, __pyx_n_s_Scheduler_scatter, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__276); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_scatter, __pyx_t_12) < 0) __PYX_ERR(0, 4741, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4790 * return keys * * async def gather(self, comm=None, keys=None, serializers=None): # <<<<<<<<<<<<<< * """ Collect data in from workers """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_105gather, 0, __pyx_n_s_Scheduler_gather, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__278); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_gather, __pyx_t_12) < 0) __PYX_ERR(0, 4790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4851 * return result * * def clear_task_state(self): # <<<<<<<<<<<<<< * # XXX what about nested state such as ClientState.wants_what * # (see also fire-and-forget...) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_108clear_task_state, 0, __pyx_n_s_Scheduler_clear_task_state, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_clear_task_state, __pyx_t_12) < 0) __PYX_ERR(0, 4851, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4858 * collection.clear() * * async def restart(self, client=None, timeout=3): # <<<<<<<<<<<<<< * """ Restart all workers. Reset local state. """ * parent: SchedulerState = cast(SchedulerState, self) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_110restart, 0, __pyx_n_s_Scheduler_restart, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__282); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_restart, __pyx_t_12) < 0) __PYX_ERR(0, 4858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4938 * self.report({"op": "restart"}) * * async def broadcast( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_113broadcast, 0, __pyx_n_s_Scheduler_broadcast, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__284); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_broadcast, __pyx_t_12) < 0) __PYX_ERR(0, 4938, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4980 * return dict(zip(workers, results)) * * async def proxy(self, comm=None, msg=None, worker=None, serializers=None): # <<<<<<<<<<<<<< * """ Proxy a communication through the scheduler to some other worker """ * d = await self.broadcast( */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_116proxy, 0, __pyx_n_s_Scheduler_proxy, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__286); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_proxy, __pyx_t_12) < 0) __PYX_ERR(0, 4980, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":4987 * return d[worker] * * async def _delete_worker_data(self, worker_address, keys): # <<<<<<<<<<<<<< * """Delete data from a worker and update the corresponding worker/task states * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_119_delete_worker_data, 0, __pyx_n_s_Scheduler__delete_worker_data, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_delete_worker_data, __pyx_t_12) < 0) __PYX_ERR(0, 4987, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5011 * self.log_event(ws._address, {"action": "remove-worker-data", "keys": keys}) * * async def rebalance(self, comm=None, keys=None, workers=None): # <<<<<<<<<<<<<< * """Rebalance keys so that each worker stores roughly equal bytes * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_122rebalance, 0, __pyx_n_s_Scheduler_rebalance, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__289); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_rebalance, __pyx_t_12) < 0) __PYX_ERR(0, 5011, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5147 * return {"status": "OK"} * * async def replicate( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_125replicate, 0, __pyx_n_s_Scheduler_replicate, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__291); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_replicate, __pyx_t_12) < 0) __PYX_ERR(0, 5147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5262 * ) * * def workers_to_close( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_128workers_to_close, 0, __pyx_n_s_Scheduler_workers_to_close, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__293)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__294); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_workers_to_close, __pyx_t_12) < 0) __PYX_ERR(0, 5262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5398 * return result * * async def retire_workers( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_u_dict_2) < 0) __PYX_ERR(0, 5398, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_130retire_workers, 0, __pyx_n_s_Scheduler_retire_workers, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__296); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_retire_workers, __pyx_t_2) < 0) __PYX_ERR(0, 5398, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5514 * return worker_keys * * def add_keys(self, comm=None, worker=None, keys=()): # <<<<<<<<<<<<<< * """ * Learn that a worker has certain keys */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_133add_keys, 0, __pyx_n_s_Scheduler_add_keys, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__298)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__299); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_add_keys_2, __pyx_t_2) < 0) __PYX_ERR(0, 5514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5539 * return "OK" * * def update_data( # <<<<<<<<<<<<<< * self, comm=None, who_has=None, nbytes=None, client=None, serializers=None * ): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_135update_data, 0, __pyx_n_s_Scheduler_update_data, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__301)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__302); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_update_data_2, __pyx_t_2) < 0) __PYX_ERR(0, 5539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5576 * self.client_desires_keys(keys=list(who_has), client=client) * * def report_on_key(self, key: str = None, ts: TaskState = None, client: str = None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * if ts is None: */ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_u_unicode) < 0) __PYX_ERR(0, 5576, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ts, __pyx_n_u_TaskState) < 0) __PYX_ERR(0, 5576, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_client, __pyx_n_u_unicode) < 0) __PYX_ERR(0, 5576, __pyx_L1_error) __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_137report_on_key, 0, __pyx_n_s_Scheduler_report_on_key, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__304)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__305); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_report_on_key, __pyx_t_12) < 0) __PYX_ERR(0, 5576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5591 * self.report(report_msg, ts=ts, client=client) * * async def feed( # <<<<<<<<<<<<<< * self, comm, function=None, setup=None, teardown=None, interval="1s", **kwargs * ): */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_139feed, 0, __pyx_n_s_Scheduler_feed, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__307); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_feed, __pyx_t_12) < 0) __PYX_ERR(0, 5591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5634 * teardown(self, state) * * def log_worker_event(self, worker=None, topic=None, msg=None): # <<<<<<<<<<<<<< * self.log_event(topic, msg) * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_142log_worker_event, 0, __pyx_n_s_Scheduler_log_worker_event, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__310); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_log_worker_event, __pyx_t_12) < 0) __PYX_ERR(0, 5634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5637 * self.log_event(topic, msg) * * def subscribe_worker_status(self, comm=None): # <<<<<<<<<<<<<< * WorkerStatusPlugin(self, comm) * ident = self.identity() */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_144subscribe_worker_status, 0, __pyx_n_s_Scheduler_subscribe_worker_statu, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__312)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__313); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_subscribe_worker_status, __pyx_t_12) < 0) __PYX_ERR(0, 5637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5645 * return ident * * def get_processing(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_146get_processing, 0, __pyx_n_s_Scheduler_get_processing, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__316); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_processing, __pyx_t_12) < 0) __PYX_ERR(0, 5645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5660 * } * * def get_who_has(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_148get_who_has, 0, __pyx_n_s_Scheduler_get_who_has, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__319); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_who_has, __pyx_t_12) < 0) __PYX_ERR(0, 5660, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5677 * } * * def get_has_what(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_150get_has_what, 0, __pyx_n_s_Scheduler_get_has_what, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__321)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__322); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_has_what, __pyx_t_12) < 0) __PYX_ERR(0, 5677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5695 * } * * def get_ncores(self, comm=None, workers=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_152get_ncores, 0, __pyx_n_s_Scheduler_get_ncores, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__325); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_ncores, __pyx_t_12) < 0) __PYX_ERR(0, 5695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5708 * return {w: ws._nthreads for w, ws in parent._workers_dv.items()} * * async def get_call_stack(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_154get_call_stack, 0, __pyx_n_s_Scheduler_get_call_stack, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__327); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_call_stack, __pyx_t_12) < 0) __PYX_ERR(0, 5708, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5739 * return response * * def get_nbytes(self, comm=None, keys=None, summary=True): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ts: TaskState */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_157get_nbytes, 0, __pyx_n_s_Scheduler_get_nbytes, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__329)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__330); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_nbytes, __pyx_t_12) < 0) __PYX_ERR(0, 5739, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5758 * return result * * def run_function(self, stream, function, args=(), kwargs={}, wait=True): # <<<<<<<<<<<<<< * """Run a function within this process * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_159run_function, 0, __pyx_n_s_Scheduler_run_function, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__332)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 5758, __pyx_L1_error) __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_12)->__pyx_arg_kwargs = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_11distributed_9scheduler_48__defaults__); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_run_function, __pyx_t_12) < 0) __PYX_ERR(0, 5758, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5770 * return run(self, stream, function=function, args=args, kwargs=kwargs, wait=wait) * * def set_metadata(self, comm=None, keys=None, value=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * try: */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_161set_metadata, 0, __pyx_n_s_Scheduler_set_metadata, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__334)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__335); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_set_metadata, __pyx_t_12) < 0) __PYX_ERR(0, 5770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5784 * pdb.set_trace() * * def get_metadata(self, comm=None, keys=None, default=no_default): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * metadata = parent._task_metadata */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_163get_metadata, 0, __pyx_n_s_Scheduler_get_metadata, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__337)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 5784, __pyx_L1_error) __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_12)->__pyx_arg_default = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_11distributed_9scheduler_50__defaults__); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_metadata, __pyx_t_12) < 0) __PYX_ERR(0, 5784, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5797 * raise * * def get_task_status(self, comm=None, keys=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * return { */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_165get_task_status, 0, __pyx_n_s_Scheduler_get_task_status, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__339)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__340); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_task_status, __pyx_t_12) < 0) __PYX_ERR(0, 5797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5804 * } * * def get_task_stream(self, comm=None, start=None, stop=None, count=None): # <<<<<<<<<<<<<< * from distributed.diagnostics.task_stream import TaskStreamPlugin * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_167get_task_stream, 0, __pyx_n_s_Scheduler_get_task_stream, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__342)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__343); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_task_stream, __pyx_t_12) < 0) __PYX_ERR(0, 5804, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5811 * return tsp.collect(start=start, stop=stop, count=count) * * def start_task_metadata(self, comm=None, name=None): # <<<<<<<<<<<<<< * plugin = CollectTaskMetaDataPlugin(scheduler=self, name=name) * */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_169start_task_metadata, 0, __pyx_n_s_Scheduler_start_task_metadata, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__345)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__346); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_start_task_metadata, __pyx_t_12) < 0) __PYX_ERR(0, 5811, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5816 * self.add_plugin(plugin) * * def stop_task_metadata(self, comm=None, name=None): # <<<<<<<<<<<<<< * plugins = [ * p */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_171stop_task_metadata, 0, __pyx_n_s_Scheduler_stop_task_metadata, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__348)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__349); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_stop_task_metadata, __pyx_t_12) < 0) __PYX_ERR(0, 5816, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5832 * return {"metadata": plugin.metadata, "state": plugin.state} * * async def register_worker_plugin(self, comm, plugin, name=None): # <<<<<<<<<<<<<< * """ Registers a setup function, and call it on every worker """ * self.worker_plugins.append({"plugin": plugin, "name": name}) */ __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_173register_worker_plugin, 0, __pyx_n_s_Scheduler_register_worker_plugin, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__351); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_register_worker_plugin, __pyx_t_12) < 0) __PYX_ERR(0, 5832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":5845 * ##################### * * def _transition(self, key, finish: str, *args, **kwargs): # <<<<<<<<<<<<<< * """Transition a key from its current state to the finish state * */ __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_finish, __pyx_n_u_unicode) < 0) __PYX_ERR(0, 5845, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_176_transition, 0, __pyx_n_s_Scheduler__transition, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__353)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_transition_2, __pyx_t_2) < 0) __PYX_ERR(0, 5845, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":5989 * raise * * def transition(self, key, finish: str, *args, **kwargs): # <<<<<<<<<<<<<< * """Transition a key from its current state to the finish state * */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_finish, __pyx_n_u_unicode) < 0) __PYX_ERR(0, 5989, __pyx_L1_error) __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_178transition, 0, __pyx_n_s_Scheduler_transition, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__355)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_transition, __pyx_t_12) < 0) __PYX_ERR(0, 5989, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "distributed/scheduler.py":6013 * return recommendations * * def transitions(self, recommendations: dict): # <<<<<<<<<<<<<< * """Process transitions until none are left * */ __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_recommendations, __pyx_n_u_dict_2) < 0) __PYX_ERR(0, 6013, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_180transitions, 0, __pyx_n_s_Scheduler_transitions, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__357)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_transitions_2, __pyx_t_2) < 0) __PYX_ERR(0, 6013, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6057 * self.validate_key(key) * * def story(self, *keys): # <<<<<<<<<<<<<< * """ Get all transitions that touch one of the input keys """ * keys = {key.key if isinstance(key, TaskState) else key for key in keys} */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_182story, 0, __pyx_n_s_Scheduler_story, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__359)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_story, __pyx_t_2) < 0) __PYX_ERR(0, 6057, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6064 * ] * * transition_story = story # <<<<<<<<<<<<<< * * def reschedule(self, key=None, worker=None): */ __pyx_t_2 = PyObject_GetItem(__pyx_t_14, __pyx_n_s_story); if (unlikely(!__pyx_t_2)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_story); } if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_transition_story, __pyx_t_2) < 0) __PYX_ERR(0, 6064, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6066 * transition_story = story * * def reschedule(self, key=None, worker=None): # <<<<<<<<<<<<<< * """Reschedule a task * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_184reschedule, 0, __pyx_n_s_Scheduler_reschedule, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__361)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__362); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_reschedule, __pyx_t_2) < 0) __PYX_ERR(0, 6066, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6092 * ##################### * * def add_resources(self, comm=None, worker=None, resources=None): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_186add_resources, 0, __pyx_n_s_Scheduler_add_resources, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__364)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__365); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_add_resources, __pyx_t_2) < 0) __PYX_ERR(0, 6092, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6103 * return "OK" * * def remove_resources(self, worker): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState = parent._workers_dv[worker] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_188remove_resources, 0, __pyx_n_s_Scheduler_remove_resources, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__367)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_remove_resources, __pyx_t_2) < 0) __PYX_ERR(0, 6103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6109 * del parent._resources[resource][worker] * * def coerce_address(self, addr, resolve=True): # <<<<<<<<<<<<<< * """ * Coerce possible input addresses to canonical form. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_190coerce_address, 0, __pyx_n_s_Scheduler_coerce_address, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__369)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__370); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_coerce_address, __pyx_t_2) < 0) __PYX_ERR(0, 6109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6132 * return addr * * def workers_list(self, workers): # <<<<<<<<<<<<<< * """ * List of qualifying workers */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_192workers_list, 0, __pyx_n_s_Scheduler_workers_list, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_workers_list, __pyx_t_2) < 0) __PYX_ERR(0, 6132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6151 * return list(out) * * def start_ipython(self, comm=None): # <<<<<<<<<<<<<< * """Start an IPython kernel * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_194start_ipython, 0, __pyx_n_s_Scheduler_start_ipython, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__374)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__375); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_start_ipython, __pyx_t_2) < 0) __PYX_ERR(0, 6151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6164 * return self._ipython_kernel.get_connection_info() * * async def get_profile( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_196get_profile, 0, __pyx_n_s_Scheduler_get_profile, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__377); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_profile, __pyx_t_2) < 0) __PYX_ERR(0, 6164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6200 * return response * * async def get_profile_metadata( # <<<<<<<<<<<<<< * self, * comm=None, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_199get_profile_metadata, 0, __pyx_n_s_Scheduler_get_profile_metadata, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__379); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_profile_metadata, __pyx_t_2) < 0) __PYX_ERR(0, 6200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6251 * return {"counts": counts, "keys": keys} * * async def performance_report(self, comm=None, start=None, code=""): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * stop = time() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_202performance_report, 0, __pyx_n_s_Scheduler_performance_report, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__381); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_performance_report, __pyx_t_2) < 0) __PYX_ERR(0, 6251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6388 * return data * * async def get_worker_logs(self, comm=None, n=None, workers=None, nanny=False): # <<<<<<<<<<<<<< * results = await self.broadcast( * msg={"op": "get_logs", "n": n}, workers=workers, nanny=nanny */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_205get_worker_logs, 0, __pyx_n_s_Scheduler_get_worker_logs, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__383); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_worker_logs, __pyx_t_2) < 0) __PYX_ERR(0, 6388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6394 * return results * * def log_event(self, name, msg): # <<<<<<<<<<<<<< * event = (time(), msg) * if isinstance(name, list): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_208log_event, 0, __pyx_n_s_Scheduler_log_event, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__385)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_log_event_2, __pyx_t_2) < 0) __PYX_ERR(0, 6394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6404 * self.event_counts[name] += 1 * * def get_events(self, comm=None, topic=None): # <<<<<<<<<<<<<< * if topic is not None: * return tuple(self.events[topic]) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_210get_events, 0, __pyx_n_s_Scheduler_get_events, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__387)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__388); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_get_events, __pyx_t_2) < 0) __PYX_ERR(0, 6404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "distributed/scheduler.py":6414 * ########### * * def reevaluate_occupancy(self, worker_index: Py_ssize_t = 0): # <<<<<<<<<<<<<< * """Periodically reassess task duration time * */ __pyx_t_2 = PyInt_FromSsize_t(((Py_ssize_t)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 6414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_worker_index, __pyx_n_u_Py_ssize_t) < 0) __PYX_ERR(0, 6414, __pyx_L1_error) __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_212reevaluate_occupancy, 0, __pyx_n_s_Scheduler_reevaluate_occupancy, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__390)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_12); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_reevaluate_occupancy, __pyx_t_9) < 0) __PYX_ERR(0, 6414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":6464 * raise * * async def check_worker_ttl(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_214check_worker_ttl, 0, __pyx_n_s_Scheduler_check_worker_ttl, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_check_worker_ttl, __pyx_t_9) < 0) __PYX_ERR(0, 6464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":6479 * await self.remove_worker(address=ws._address) * * def check_idle(self): # <<<<<<<<<<<<<< * parent: SchedulerState = cast(SchedulerState, self) * ws: WorkerState */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_217check_idle, 0, __pyx_n_s_Scheduler_check_idle, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__393)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_check_idle, __pyx_t_9) < 0) __PYX_ERR(0, 6479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":6498 * self.loop.add_callback(self.close) * * def adaptive_target(self, comm=None, target_duration=None): # <<<<<<<<<<<<<< * """Desired number of workers based on the current workload * */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_9Scheduler_219adaptive_target, 0, __pyx_n_s_Scheduler_adaptive_target, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__395)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__396); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_adaptive_target, __pyx_t_9) < 0) __PYX_ERR(0, 6498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "distributed/scheduler.py":2764 * * * class Scheduler(SchedulerState, ServerNode): # <<<<<<<<<<<<<< * """Dynamic distributed task scheduler * */ __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_Scheduler, __pyx_t_16, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_CyFunction_InitClassCell(__pyx_t_13, __pyx_t_9) < 0) __PYX_ERR(0, 2764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_Scheduler, __pyx_t_9) < 0) __PYX_ERR(0, 2764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":6878 * * * def validate_task_state(ts: TaskState): # <<<<<<<<<<<<<< * """ * Validate the given TaskState. */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_29validate_task_state, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 6878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_validate_task_state, __pyx_t_16) < 0) __PYX_ERR(0, 6878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":6979 * * * def validate_worker_state(ws: WorkerState): # <<<<<<<<<<<<<< * ts: TaskState * for ts in ws._has_what: */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_31validate_worker_state, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 6979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_validate_worker_state, __pyx_t_16) < 0) __PYX_ERR(0, 6979, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":6993 * * * def validate_state(tasks, workers, clients): # <<<<<<<<<<<<<< * """ * Validate a current runtime state */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_33validate_state, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 6993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_validate_state, __pyx_t_16) < 0) __PYX_ERR(0, 6993, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":7019 * * * _round_robin = [0] # <<<<<<<<<<<<<< * * */ __pyx_t_16 = PyList_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 7019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_16, 0, __pyx_int_0); if (PyDict_SetItem(__pyx_d, __pyx_n_s_round_robin, __pyx_t_16) < 0) __PYX_ERR(0, 7019, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":7022 * * * def heartbeat_interval(n): # <<<<<<<<<<<<<< * """ * Interval in seconds that we desire heartbeats based on number of workers */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_35heartbeat_interval, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 7022, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_heartbeat_interval_2, __pyx_t_16) < 0) __PYX_ERR(0, 7022, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":7037 * * * class KilledWorker(Exception): # <<<<<<<<<<<<<< * def __init__(self, task, last_worker): * super().__init__(task, last_worker) */ __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 7037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 7037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_16, __pyx_n_s_KilledWorker, __pyx_n_s_KilledWorker, (PyObject *) NULL, __pyx_n_s_distributed_scheduler, (PyObject *) NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 7037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 7037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "distributed/scheduler.py":7038 * * class KilledWorker(Exception): * def __init__(self, task, last_worker): # <<<<<<<<<<<<<< * super().__init__(task, last_worker) * self.task = task */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_12KilledWorker_1__init__, 0, __pyx_n_s_KilledWorker___init, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__406)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_13); PyList_Append(__pyx_t_9, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_init, __pyx_t_13) < 0) __PYX_ERR(0, 7038, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":7037 * * * class KilledWorker(Exception): # <<<<<<<<<<<<<< * def __init__(self, task, last_worker): * super().__init__(task, last_worker) */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_KilledWorker, __pyx_t_16, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_CyFunction_InitClassCell(__pyx_t_9, __pyx_t_13) < 0) __PYX_ERR(0, 7037, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_KilledWorker, __pyx_t_13) < 0) __PYX_ERR(0, 7037, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":7044 * * * class WorkerStatusPlugin(SchedulerPlugin): # <<<<<<<<<<<<<< * """ * An plugin to share worker status with a remote observer */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_SchedulerPlugin); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 7044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 7044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 7044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_14 = __Pyx_Py3MetaclassPrepare(__pyx_t_16, __pyx_t_15, __pyx_n_s_WorkerStatusPlugin, __pyx_n_s_WorkerStatusPlugin, (PyObject *) NULL, __pyx_n_s_distributed_scheduler, __pyx_kp_s_An_plugin_to_share_worker_statu); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 7044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "distributed/scheduler.py":7052 * """ * * def __init__(self, scheduler, comm): # <<<<<<<<<<<<<< * self.bcomm = BatchedSend(interval="5ms") * self.bcomm.start(comm) */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_18WorkerStatusPlugin_1__init__, 0, __pyx_n_s_WorkerStatusPlugin___init, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__408)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_init, __pyx_t_13) < 0) __PYX_ERR(0, 7052, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":7059 * self.scheduler.add_plugin(self) * * def add_worker(self, worker=None, **kwargs): # <<<<<<<<<<<<<< * ident = self.scheduler.workers[worker].identity() * del ident["metrics"] */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_18WorkerStatusPlugin_3add_worker, 0, __pyx_n_s_WorkerStatusPlugin_add_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__410)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_tuple__411); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_add_worker, __pyx_t_13) < 0) __PYX_ERR(0, 7059, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":7068 * self.scheduler.remove_plugin(self) * * def remove_worker(self, worker=None, **kwargs): # <<<<<<<<<<<<<< * try: * self.bcomm.send(["remove", worker]) */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_18WorkerStatusPlugin_5remove_worker, 0, __pyx_n_s_WorkerStatusPlugin_remove_worker, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__413)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_tuple__414); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_remove_worker, __pyx_t_13) < 0) __PYX_ERR(0, 7068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":7074 * self.scheduler.remove_plugin(self) * * def teardown(self): # <<<<<<<<<<<<<< * self.bcomm.close() * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_18WorkerStatusPlugin_7teardown, 0, __pyx_n_s_WorkerStatusPlugin_teardown, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__416)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_teardown, __pyx_t_13) < 0) __PYX_ERR(0, 7074, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":7044 * * * class WorkerStatusPlugin(SchedulerPlugin): # <<<<<<<<<<<<<< * """ * An plugin to share worker status with a remote observer */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_16, __pyx_n_s_WorkerStatusPlugin, __pyx_t_15, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WorkerStatusPlugin, __pyx_t_13) < 0) __PYX_ERR(0, 7044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "distributed/scheduler.py":7078 * * * class CollectTaskMetaDataPlugin(SchedulerPlugin): # <<<<<<<<<<<<<< * def __init__(self, scheduler, name): * self.scheduler = scheduler */ __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_SchedulerPlugin); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 7078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 7078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 7078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_16, __pyx_n_s_CollectTaskMetaDataPlugin, __pyx_n_s_CollectTaskMetaDataPlugin, (PyObject *) NULL, __pyx_n_s_distributed_scheduler, (PyObject *) NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 7078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "distributed/scheduler.py":7079 * * class CollectTaskMetaDataPlugin(SchedulerPlugin): * def __init__(self, scheduler, name): # <<<<<<<<<<<<<< * self.scheduler = scheduler * self.name = name */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_25CollectTaskMetaDataPlugin_1__init__, 0, __pyx_n_s_CollectTaskMetaDataPlugin___init, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__418)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_init, __pyx_t_13) < 0) __PYX_ERR(0, 7079, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":7086 * self.state = {} * * def update_graph(self, scheduler, dsk=None, keys=None, restrictions=None, **kwargs): # <<<<<<<<<<<<<< * self.keys.update(keys) * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_25CollectTaskMetaDataPlugin_3update_graph, 0, __pyx_n_s_CollectTaskMetaDataPlugin_update, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__420)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_tuple__421); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_update_graph_2, __pyx_t_13) < 0) __PYX_ERR(0, 7086, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":7089 * self.keys.update(keys) * * def transition(self, key, start, finish, *args, **kwargs): # <<<<<<<<<<<<<< * if finish == "memory" or finish == "erred": * ts: TaskState = self.scheduler.tasks.get(key) */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_11distributed_9scheduler_25CollectTaskMetaDataPlugin_5transition, 0, __pyx_n_s_CollectTaskMetaDataPlugin_transi, NULL, __pyx_n_s_distributed_scheduler, __pyx_d, ((PyObject *)__pyx_codeobj__423)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_n_s_transition, __pyx_t_13) < 0) __PYX_ERR(0, 7089, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "distributed/scheduler.py":7078 * * * class CollectTaskMetaDataPlugin(SchedulerPlugin): # <<<<<<<<<<<<<< * def __init__(self, scheduler, name): * self.scheduler = scheduler */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_CollectTaskMetaDataPlugin, __pyx_t_16, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 7078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CollectTaskMetaDataPlugin, __pyx_t_13) < 0) __PYX_ERR(0, 7078, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_ClientState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_37__pyx_unpickle_ClientState, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ClientState, __pyx_t_16) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "(tree fragment)":11 * __pyx_unpickle_ClientState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_ClientState__set_state(ClientState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._client_key = __pyx_state[0]; __pyx_result._hash = __pyx_state[1]; __pyx_result._last_seen = __pyx_state[2]; __pyx_result._versions = __pyx_state[3]; __pyx_result._wants_what = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_39__pyx_unpickle_WorkerState, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_WorkerState, __pyx_t_16) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_TaskPrefix(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_41__pyx_unpickle_TaskPrefix, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TaskPrefix, __pyx_t_16) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "(tree fragment)":11 * __pyx_unpickle_TaskPrefix__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TaskPrefix__set_state(TaskPrefix __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._all_durations = __pyx_state[0]; __pyx_result._duration_average = __pyx_state[1]; __pyx_result._groups = __pyx_state[2]; __pyx_result._name = __pyx_state[3]; __pyx_result._suspicious = __pyx_state[4] * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_43__pyx_unpickle_TaskGroup, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TaskGroup, __pyx_t_16) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_TaskState(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_45__pyx_unpickle_TaskState, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TaskState, __pyx_t_16) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "(tree fragment)":11 * __pyx_unpickle_TaskState__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TaskState__set_state(TaskState __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._actor = __pyx_state[0]; __pyx_result._annotations = __pyx_state[1]; __pyx_result._dependencies = __pyx_state[2]; __pyx_result._dependents = __pyx_state[3]; __pyx_result._exception = __pyx_state[4]; __pyx_result._exception_blame = __pyx_state[5]; __pyx_result._group = __pyx_state[6]; __pyx_result._group_key = __pyx_state[7]; __pyx_result._has_lost_dependencies = __pyx_state[8]; __pyx_result._hash = __pyx_state[9]; __pyx_result._host_restrictions = __pyx_state[10]; __pyx_result._key = __pyx_state[11]; __pyx_result._loose_restrictions = __pyx_state[12]; __pyx_result._metadata = __pyx_state[13]; __pyx_result._nbytes = __pyx_state[14]; __pyx_result._prefix = __pyx_state[15]; __pyx_result._priority = __pyx_state[16]; __pyx_result._processing_on = __pyx_state[17]; __pyx_result._resource_restrictions = __pyx_state[18]; __pyx_result._retries = __pyx_state[19]; __pyx_result._run_spec = __pyx_state[20]; __pyx_result._state = __pyx_state[21]; __pyx_result._suspicious = __pyx_state[22]; __pyx_result._traceback = __pyx_state[23]; __pyx_result._type = __pyx_state[24]; __pyx_result._waiters = __pyx_state[25]; __pyx_result._waiting_on = __pyx_state[26]; __pyx_result._who_has = __pyx_state[27]; __pyx_result._who_wants = __pyx_state[28]; __pyx_result._worker_restrictions = __pyx_state[29] * if len(__pyx_state) > 30 and hasattr(__pyx_result, '__dict__'): */ __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_11distributed_9scheduler_47__pyx_unpickle_SchedulerState, NULL, __pyx_n_s_distributed_scheduler); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SchedulerState, __pyx_t_16) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "distributed/scheduler.py":1 * import asyncio # <<<<<<<<<<<<<< * from collections import defaultdict, deque * */ __pyx_t_16 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_t_16, __pyx_kp_u_Scheduler_workers_to_close_line, __pyx_kp_u_Find_workers_that_we_can_close) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_kp_u_Scheduler__transition_line_5845, __pyx_kp_u_Transition_a_key_from_its_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_kp_u_Scheduler_transition_line_5989, __pyx_kp_u_Transition_a_key_from_its_curren_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_16) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init distributed.scheduler", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init distributed.scheduler"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CythonFunctionShared */ #include static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { if (unlikely(op == NULL)) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { #if PY_MAJOR_VERSION < 3 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; #endif return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); return 0; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) #endif { if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* GetAttr3 */ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } /* pyobject_as_double */ static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; #if !CYTHON_USE_TYPE_SLOTS float_value = PyNumber_Float(obj); if ((0)) goto bad; #else PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; if (likely(nb) && likely(nb->nb_float)) { float_value = nb->nb_float(obj); if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { PyErr_Format(PyExc_TypeError, "__float__ returned non-float (type %.200s)", Py_TYPE(float_value)->tp_name); Py_DECREF(float_value); goto bad; } } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif } else { PyObject* args = PyTuple_New(1); if (unlikely(!args)) goto bad; PyTuple_SET_ITEM(args, 0, obj); float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } #endif if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); return value; } bad: return (double)-1; } /* PyObjectCall2Args */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args, *result = NULL; #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyFunction_FastCall(function, args, 2); } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyCFunction_FastCall(function, args, 2); } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); done: return result; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (descr != NULL) { *method = descr; return 0; } PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(name)); #endif return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = Py_TYPE(iter)->tp_iternext; value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* PyObjectFormatAndDecref */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { if (unlikely(!s)) return NULL; if (likely(PyUnicode_CheckExact(s))) return s; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(s))) { PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); Py_DECREF(s); return result; } #endif return __Pyx_PyObject_FormatAndDecref(s, f); } static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { PyObject *result = PyObject_Format(s, f); Py_DECREF(s); return result; } /* CIntToDigits */ static const char DIGIT_PAIRS_10[2*10*10+1] = { "00010203040506070809" "10111213141516171819" "20212223242526272829" "30313233343536373839" "40414243444546474849" "50515253545556575859" "60616263646566676869" "70717273747576777879" "80818283848586878889" "90919293949596979899" }; static const char DIGIT_PAIRS_8[2*8*8+1] = { "0001020304050607" "1011121314151617" "2021222324252627" "3031323334353637" "4041424344454647" "5051525354555657" "6061626364656667" "7071727374757677" }; static const char DIGITS_HEX[2*16+1] = { "0123456789abcdef" "0123456789ABCDEF" }; /* BuildPyUnicode */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, int prepend_sign, char padding_char) { PyObject *uval; Py_ssize_t uoffset = ulength - clength; #if CYTHON_USE_UNICODE_INTERNALS Py_ssize_t i; #if CYTHON_PEP393_ENABLED void *udata; uval = PyUnicode_New(ulength, 127); if (unlikely(!uval)) return NULL; udata = PyUnicode_DATA(uval); #else Py_UNICODE *udata; uval = PyUnicode_FromUnicode(NULL, ulength); if (unlikely(!uval)) return NULL; udata = PyUnicode_AS_UNICODE(uval); #endif if (uoffset > 0) { i = 0; if (prepend_sign) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); i++; } for (; i < uoffset; i++) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); } } for (i=0; i < clength; i++) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); } #else { PyObject *sign = NULL, *padding = NULL; uval = NULL; if (uoffset > 0) { prepend_sign = !!prepend_sign; if (uoffset > prepend_sign) { padding = PyUnicode_FromOrdinal(padding_char); if (likely(padding) && uoffset > prepend_sign + 1) { PyObject *tmp; PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign); if (unlikely(!repeat)) goto done_or_error; tmp = PyNumber_Multiply(padding, repeat); Py_DECREF(repeat); Py_DECREF(padding); padding = tmp; } if (unlikely(!padding)) goto done_or_error; } if (prepend_sign) { sign = PyUnicode_FromOrdinal('-'); if (unlikely(!sign)) goto done_or_error; } } uval = PyUnicode_DecodeASCII(chars, clength, NULL); if (likely(uval) && padding) { PyObject *tmp = PyNumber_Add(padding, uval); Py_DECREF(uval); uval = tmp; } if (likely(uval) && sign) { PyObject *tmp = PyNumber_Add(sign, uval); Py_DECREF(uval); uval = tmp; } done_or_error: Py_XDECREF(padding); Py_XDECREF(sign); } #endif return uval; } /* CIntToPyUnicode */ #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned short uint16_t; #else typedef unsigned __int16 uint16_t; #endif #endif #else #include #endif #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define GCC_DIAGNOSTIC #endif static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(Py_ssize_t)*3+2]; char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; Py_ssize_t remaining; #ifdef GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0; #ifdef GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (format_char == 'X') { hex_digits += 16; format_char = 'x'; } remaining = value; last_one_off = 0; dpos = end; do { int digit_pos; switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); remaining = (Py_ssize_t) (remaining / (8*8)); dpos -= 2; *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos]; last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); remaining = (Py_ssize_t) (remaining / (10*10)); dpos -= 2; *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos]; last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; remaining = (Py_ssize_t) (remaining / 16); break; default: assert(0); break; } } while (unlikely(remaining != 0)); if (last_one_off) { assert(*dpos == '0'); dpos++; } length = end - dpos; ulength = length; prepend_sign = 0; if (!is_unsigned && value <= neg_one) { if (padding_char == ' ' || width <= length + 1) { *(--dpos) = '-'; ++length; } else { prepend_sign = 1; } ++ulength; } if (width > ulength) { ulength = width; } if (ulength == 1) { return PyUnicode_FromOrdinal(*dpos); } return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } /* JoinPyUnicode */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, CYTHON_UNUSED Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind; Py_ssize_t i, char_pos; void *result_udata; #if CYTHON_PEP393_ENABLED result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; result_udata = PyUnicode_DATA(result_uval); #else result_uval = PyUnicode_FromUnicode(NULL, result_ulength); if (unlikely(!result_uval)) return NULL; result_ukind = sizeof(Py_UNICODE); result_udata = PyUnicode_AS_UNICODE(result_uval); #endif char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); if (unlikely(__Pyx_PyUnicode_READY(uval))) goto bad; ulength = __Pyx_PyUnicode_GET_LENGTH(uval); if (unlikely(!ulength)) continue; if (unlikely(char_pos + ulength < 0)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind)); } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; for (j=0; j < ulength; j++) { Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); } #endif } char_pos += ulength; } return result_uval; overflow: PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); bad: Py_DECREF(result_uval); return NULL; #else result_ulength++; value_count++; return PyUnicode_Join(__pyx_empty_unicode, value_tuple); #endif } /* RaiseMappingExpected */ static void __Pyx_RaiseMappingExpectedError(PyObject* arg) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not a mapping", Py_TYPE(arg)->tp_name); } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* PyIntCompare */ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { if (op1 == op2) { Py_RETURN_FALSE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = Py_SIZE(op1); const digit* digits = ((PyLongObject*)op1)->ob_digit; if (intval == 0) { if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } else if (intval < 0) { if (size >= 0) Py_RETURN_TRUE; intval = -intval; size = -size; } else { if (size <= 0) Py_RETURN_TRUE; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( PyObject_RichCompare(op1, op2, Py_NE)); } /* None */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* set_iter */ static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, Py_ssize_t* p_orig_length, int* p_source_is_set) { #if CYTHON_COMPILING_IN_CPYTHON is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable)); *p_source_is_set = is_set; if (likely(is_set)) { *p_orig_length = PySet_Size(iterable); Py_INCREF(iterable); return iterable; } #else (void)is_set; *p_source_is_set = 0; #endif *p_orig_length = 0; return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_set_iter_next( PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject **value, int source_is_set) { if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) { *value = PyIter_Next(iter_obj); if (unlikely(!*value)) { return __Pyx_IterFinish(); } (void)orig_length; (void)ppos; return 1; } #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) { PyErr_SetString( PyExc_RuntimeError, "set changed size during iteration"); return -1; } { Py_hash_t hash; int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash); assert (ret != -1); if (likely(ret)) { Py_INCREF(*value); return 1; } } #endif return 0; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { (void)inplace; (void)zerodivision_check; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* UnpackUnboundCMethod */ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } #endif return 0; } /* CallUnboundCMethod0 */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { PyObject *args, *result = NULL; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_ASSUME_SAFE_MACROS args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); #else args = PyTuple_Pack(1, self); if (unlikely(!args)) goto bad; #endif result = __Pyx_PyObject_Call(cfunc->method, args, NULL); Py_DECREF(args); bad: return result; } /* py_dict_items */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { if (PY_MAJOR_VERSION >= 3) return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d); else return PyDict_Items(d); } /* py_dict_values */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { if (PY_MAJOR_VERSION >= 3) return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d); else return PyDict_Values(d); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { (void)inplace; (void)zerodivision_check; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a - b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* PyUnicode_Unicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { if (unlikely(obj == Py_None)) obj = __pyx_kp_u_None; return __Pyx_NewRef(obj); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { PyObject *runerr; Py_ssize_t key_value; PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; if (unlikely(!(m && m->sq_item))) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); return NULL; } key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; if (likely(m && m->mp_subscript)) { return m->mp_subscript(obj, key); } return __Pyx_PyObject_GetIndex(obj, key); } #endif /* pyfrozenset_new */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { if (it) { PyObject* result; #if CYTHON_COMPILING_IN_PYPY PyObject* args; args = PyTuple_Pack(1, it); if (unlikely(!args)) return NULL; result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); Py_DECREF(args); return result; #else if (PyFrozenSet_CheckExact(it)) { Py_INCREF(it); return it; } result = PyFrozenSet_New(it); if (unlikely(!result)) return NULL; if (likely(PySet_GET_SIZE(result))) return result; Py_DECREF(result); #endif } #if CYTHON_USE_TYPE_SLOTS return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); #else return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); #endif } /* PySetContains */ static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { int result = -1; if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { PyObject *tmpkey; PyErr_Clear(); tmpkey = __Pyx_PyFrozenSet_New(key); if (tmpkey != NULL) { result = PySet_Contains(set, tmpkey); Py_DECREF(tmpkey); } } return result; } static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { int result = PySet_Contains(set, key); if (unlikely(result < 0)) { result = __Pyx_PySet_ContainsUnhashable(set, key); } return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* py_set_discard_unhashable */ static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) { PyObject *tmpkey; int rv; if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))) return -1; PyErr_Clear(); tmpkey = __Pyx_PyFrozenSet_New(key); if (tmpkey == NULL) return -1; rv = PySet_Discard(set, tmpkey); Py_DECREF(tmpkey); return rv; } /* py_set_remove */ static int __Pyx_PySet_RemoveNotFound(PyObject *set, PyObject *key, int found) { if (unlikely(found < 0)) { found = __Pyx_PySet_DiscardUnhashable(set, key); } if (likely(found == 0)) { PyObject *tup; tup = PyTuple_Pack(1, key); if (!tup) return -1; PyErr_SetObject(PyExc_KeyError, tup); Py_DECREF(tup); return -1; } return found; } static CYTHON_INLINE int __Pyx_PySet_Remove(PyObject *set, PyObject *key) { int found = PySet_Discard(set, key); if (unlikely(found != 1)) { return __Pyx_PySet_RemoveNotFound(set, key, found); } return 0; } /* None */ static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { Py_ssize_t r = a % b; r += ((r != 0) & ((r ^ b) < 0)) * b; return r; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { if (PY_VERSION_HEX >= 0x030700A0) { return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); } else { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* py_set_discard */ static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key) { int found = PySet_Discard(set, key); if (unlikely(found < 0)) { found = __Pyx_PySet_DiscardUnhashable(set, key); } return found; } /* py_dict_pop */ static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 if ((1)) { return _PyDict_Pop(d, key, default_value); } else #endif if (default_value) { return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value); } else { return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key); } } /* PyObjectCallMethod1 */ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* None */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY #if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS #define __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(operand)\ if (unlikely(zerodivision_check && ((operand) == 0))) {\ PyErr_SetString(PyExc_ZeroDivisionError, "integer division by zero");\ return NULL;\ } #endif static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { (void)inplace; (void)zerodivision_check; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(b) if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) { return PyFloat_FromDouble((double)a / (double)b); } return PyInt_Type.tp_as_number->nb_true_divide(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); } } __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(b) if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) || __Pyx_sst_abs(size) <= 52 / PyLong_SHIFT) { return PyFloat_FromDouble((double)a / (double)b); } return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); return PyLong_FromLong(x); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; if (unlikely(zerodivision_check && b == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL; } PyFPE_START_PROTECT("divide", return NULL) result = ((double)a) / (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } #endif /* MergeKeywords */ static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) { PyObject *iter, *key = NULL, *value = NULL; int source_is_dict, result; Py_ssize_t orig_length, ppos = 0; iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict); if (unlikely(!iter)) { PyObject *args; if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); args = PyTuple_Pack(1, source_mapping); if (likely(args)) { PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL); Py_DECREF(args); if (likely(fallback)) { iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict); Py_DECREF(fallback); } } if (unlikely(!iter)) goto bad; } while (1) { result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict); if (unlikely(result < 0)) goto bad; if (!result) break; if (unlikely(PyDict_Contains(kwdict, key))) { __Pyx_RaiseDoubleKeywordsError("function", key); result = -1; } else { result = PyDict_SetItem(kwdict, key, value); } Py_DECREF(key); Py_DECREF(value); if (unlikely(result < 0)) goto bad; } Py_XDECREF(iter); return 0; bad: Py_XDECREF(iter); return -1; } /* CoroutineBase */ #include #include #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; __Pyx_ErrFetch(&et, &ev, &tb); if (!et) { Py_XDECREF(tb); Py_XDECREF(ev); Py_INCREF(Py_None); *pvalue = Py_None; return 0; } if (likely(et == PyExc_StopIteration)) { if (!ev) { Py_INCREF(Py_None); value = Py_None; } #if PY_VERSION_HEX >= 0x030300A0 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); } #endif else if (unlikely(PyTuple_Check(ev))) { if (PyTuple_GET_SIZE(ev) >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); #else value = PySequence_ITEM(ev, 0); #endif } else { Py_INCREF(Py_None); value = Py_None; } Py_DECREF(ev); } else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { value = ev; } if (likely(value)) { Py_XDECREF(tb); Py_DECREF(et); *pvalue = value; return 0; } } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { __Pyx_ErrRestore(et, ev, tb); return -1; } PyErr_NormalizeException(&et, &ev, &tb); if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { __Pyx_ErrRestore(et, ev, tb); return -1; } Py_XDECREF(tb); Py_DECREF(et); #if PY_VERSION_HEX >= 0x030300A0 value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); #else { PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); Py_DECREF(ev); if (likely(args)) { value = PySequence_GetItem(args, 0); Py_DECREF(args); } if (unlikely(!value)) { __Pyx_ErrRestore(NULL, NULL, NULL); Py_INCREF(Py_None); value = Py_None; } } #endif *pvalue = value; return 0; } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { PyObject *t, *v, *tb; t = exc_state->exc_type; v = exc_state->exc_value; tb = exc_state->exc_traceback; exc_state->exc_type = NULL; exc_state->exc_value = NULL; exc_state->exc_traceback = NULL; Py_XDECREF(t); Py_XDECREF(v); Py_XDECREF(tb); } #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) { const char *msg; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { msg = "coroutine already executing"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { msg = "async generator already executing"; #endif } else { msg = "generator already executing"; } PyErr_SetString(PyExc_ValueError, msg); } #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) { const char *msg; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(gen)) { msg = "can't send non-None value to a just-started coroutine"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(gen)) { msg = "can't send non-None value to a just-started async generator"; #endif } else { msg = "can't send non-None value to a just-started generator"; } PyErr_SetString(PyExc_TypeError, msg); } #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) { #ifdef __Pyx_Coroutine_USED if (!closing && __Pyx_Coroutine_Check(gen)) { PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); } else #endif if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { return __Pyx_Coroutine_NotStartedError((PyObject*)self); } } if (unlikely(self->resume_label == -1)) { return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign tstate = __pyx_tstate; #else tstate = __Pyx_PyThreadState_Current; #endif exc_state = &self->gi_exc_state; if (exc_state->exc_type) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON #else if (exc_state->exc_traceback) { PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback; PyFrameObject *f = tb->tb_frame; Py_XINCREF(tstate->frame); assert(f->f_back == NULL); f->f_back = tstate->frame; } #endif } #if CYTHON_USE_EXC_INFO_STACK exc_state->previous_item = tstate->exc_info; tstate->exc_info = exc_state; #else if (exc_state->exc_type) { __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } else { __Pyx_Coroutine_ExceptionClear(exc_state); __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif self->is_running = 1; retval = self->body((PyObject *) self, tstate, value); self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif return retval; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { PyObject *exc_tb = exc_state->exc_traceback; if (likely(exc_tb)) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON #else PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; Py_CLEAR(f->f_back); #endif } } static CYTHON_INLINE PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) { if (unlikely(!retval)) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { PyObject *exc = PyExc_StopIteration; #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) exc = __Pyx_PyExc_StopAsyncIteration; #endif __Pyx_PyErr_SetNone(exc); } } return retval; } static CYTHON_INLINE PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { PyObject *ret; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); ret = __Pyx_Coroutine_SendEx(gen, val, 0); Py_XDECREF(val); return ret; } static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { PyObject *retval; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif { if (value == Py_None) ret = Py_TYPE(yf)->tp_iternext(yf); else ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); } gen->is_running = 0; if (likely(ret)) { return ret; } retval = __Pyx_Coroutine_FinishDelegation(gen); } else { retval = __Pyx_Coroutine_SendEx(gen, value, 0); } return __Pyx_Coroutine_MethodReturn(self, retval); } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { PyObject *retval = NULL; int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); if (!retval) return -1; } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); } else #endif { PyObject *meth; gen->is_running = 1; meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); if (unlikely(!meth)) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_WriteUnraisable(yf); } PyErr_Clear(); } else { retval = PyObject_CallFunction(meth, NULL); Py_DECREF(meth); if (!retval) err = -1; } gen->is_running = 0; } Py_XDECREF(retval); return err; } static PyObject *__Pyx_Generator_Next(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, NULL); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif ret = Py_TYPE(yf)->tp_iternext(yf); gen->is_running = 0; if (likely(ret)) { return ret; } return __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_SendEx(gen, Py_None, 0); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __Pyx_Coroutine_Close(self); } static PyObject *__Pyx_Coroutine_Close(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *retval, *raised_exception; PyObject *yf = gen->yieldfrom; int err = 0; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); __Pyx_Coroutine_Undelegate(gen); Py_DECREF(yf); } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); if (unlikely(retval)) { const char *msg; Py_DECREF(retval); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { msg = "coroutine ignored GeneratorExit"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { #if PY_VERSION_HEX < 0x03060000 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; #else msg = "async generator ignored GeneratorExit"; #endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); return NULL; } raised_exception = PyErr_Occurred(); if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { if (raised_exception) PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { int err = __Pyx_Coroutine_CloseIter(gen, yf); Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); goto throw_here; } gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) #endif #ifdef __Pyx_Coroutine_USED || __Pyx_Coroutine_Check(yf) #endif ) { ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); #ifdef __Pyx_Coroutine_USED } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { gen->is_running = 0; return NULL; } PyErr_Clear(); __Pyx_Coroutine_Undelegate(gen); gen->is_running = 0; goto throw_here; } if (likely(args)) { ret = PyObject_CallObject(meth, args); } else { ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL); } Py_DECREF(meth); } gen->is_running = 0; Py_DECREF(yf); if (!ret) { ret = __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_MethodReturn(self, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { Py_VISIT(exc_state->exc_type); Py_VISIT(exc_state->exc_value); Py_VISIT(exc_state->exc_traceback); return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); } static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); Py_CLEAR(gen->yieldfrom); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); } #endif Py_CLEAR(gen->gi_code); Py_CLEAR(gen->gi_name); Py_CLEAR(gen->gi_qualname); Py_CLEAR(gen->gi_modulename); return 0; } static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE if (PyObject_CallFinalizerFromDealloc(self)) #else Py_TYPE(gen)->tp_del(self); if (self->ob_refcnt > 0) #endif { return; } PyObject_GC_UnTrack(self); } #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { /* We have to handle this case for asynchronous generators right here, because this code has to be between UNTRACK and GC_Del. */ Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); } #endif __Pyx_Coroutine_clear(self); PyObject_GC_Del(gen); } static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; __Pyx_PyThreadState_declare if (gen->resume_label < 0) { return; } #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt == 0); self->ob_refcnt = 1; #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; PyObject *finalizer = agen->ag_finalizer; if (finalizer && !agen->ag_closed) { PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); if (unlikely(!res)) { PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } __Pyx_ErrRestore(error_type, error_value, error_traceback); return; } } #endif if (unlikely(gen->resume_label == 0 && !error_value)) { #ifdef __Pyx_Coroutine_USED #ifdef __Pyx_Generator_USED if (!__Pyx_Generator_CheckExact(self)) #endif { PyObject_GC_UnTrack(self); #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); #else {PyObject *msg; char *cmsg; #if CYTHON_COMPILING_IN_PYPY msg = NULL; cmsg = (char*) "coroutine was never awaited"; #else char *cname; PyObject *qualname; qualname = gen->gi_qualname; cname = PyString_AS_STRING(qualname); msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); if (unlikely(!msg)) { PyErr_Clear(); cmsg = (char*) "coroutine was never awaited"; } else { cmsg = PyString_AS_STRING(msg); } #endif if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) PyErr_WriteUnraisable(self); Py_XDECREF(msg);} #endif PyObject_GC_Track(self); } #endif } else { PyObject *res = __Pyx_Coroutine_Close(self); if (unlikely(!res)) { if (PyErr_Occurred()) PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt > 0); if (--self->ob_refcnt == 0) { return; } { Py_ssize_t refcnt = self->ob_refcnt; _Py_NewReference(self); self->ob_refcnt = refcnt; } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(self->ob_type) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); _Py_DEC_REFTOTAL; #endif #ifdef COUNT_ALLOCS --Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_allocs; #endif #endif } static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) { PyObject *name = self->gi_name; if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = self->gi_name; Py_INCREF(value); self->gi_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) { PyObject *name = self->gi_qualname; if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = self->gi_qualname; Py_INCREF(value); self->gi_qualname = value; Py_XDECREF(tmp); return 0; } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); if (unlikely(!gen)) return NULL; return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); } static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { gen->body = body; gen->closure = closure; Py_XINCREF(closure); gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; gen->gi_exc_state.exc_type = NULL; gen->gi_exc_state.exc_value = NULL; gen->gi_exc_state.exc_traceback = NULL; #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif gen->gi_weakreflist = NULL; Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); gen->gi_name = name; Py_XINCREF(module_name); gen->gi_modulename = module_name; Py_XINCREF(code); gen->gi_code = code; PyObject_GC_Track(gen); return gen; } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PatchModuleWithCoroutine */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; globals = PyDict_New(); if (unlikely(!globals)) goto ignore; result = PyDict_SetItemString(globals, "_cython_coroutine_type", #ifdef __Pyx_Coroutine_USED (PyObject*)__pyx_CoroutineType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; result = PyDict_SetItemString(globals, "_cython_generator_type", #ifdef __Pyx_Generator_USED (PyObject*)__pyx_GeneratorType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; result_obj = PyRun_String(py_code, Py_file_input, globals, globals); if (unlikely(!result_obj)) goto ignore; Py_DECREF(result_obj); Py_DECREF(globals); return module; ignore: Py_XDECREF(globals); PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else py_code++; #endif return module; } /* PatchGeneratorABC */ #ifndef CYTHON_REGISTER_ABCS #define CYTHON_REGISTER_ABCS 1 #endif #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( module, "" "if _cython_generator_type is not None:\n" " try: Generator = _module.Generator\n" " except AttributeError: pass\n" " else: Generator.register(_cython_generator_type)\n" "if _cython_coroutine_type is not None:\n" " try: Coroutine = _module.Coroutine\n" " except AttributeError: pass\n" " else: Coroutine.register(_cython_coroutine_type)\n" ); return module; } #endif static int __Pyx_patch_abc(void) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static int abc_patched = 0; if (CYTHON_REGISTER_ABCS && !abc_patched) { PyObject *module; module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); if (!module) { PyErr_WriteUnraisable(NULL); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, ((PY_MAJOR_VERSION >= 3) ? "Cython module failed to register with collections.abc module" : "Cython module failed to register with collections module"), 1) < 0)) { return -1; } } else { module = __Pyx_patch_abc_module(module); abc_patched = 1; if (unlikely(!module)) return -1; Py_DECREF(module); } module = PyImport_ImportModule("backports_abc"); if (module) { module = __Pyx_patch_abc_module(module); Py_XDECREF(module); } if (!module) { PyErr_Clear(); } } #else if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); #endif return 0; } /* Coroutine */ static void __Pyx_CoroutineAwait_dealloc(PyObject *self) { PyObject_GC_UnTrack(self); Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine); PyObject_GC_Del(self); } static int __Pyx_CoroutineAwait_traverse(__pyx_CoroutineAwaitObject *self, visitproc visit, void *arg) { Py_VISIT(self->coroutine); return 0; } static int __Pyx_CoroutineAwait_clear(__pyx_CoroutineAwaitObject *self) { Py_CLEAR(self->coroutine); return 0; } static PyObject *__Pyx_CoroutineAwait_Next(__pyx_CoroutineAwaitObject *self) { return __Pyx_Generator_Next(self->coroutine); } static PyObject *__Pyx_CoroutineAwait_Send(__pyx_CoroutineAwaitObject *self, PyObject *value) { return __Pyx_Coroutine_Send(self->coroutine, value); } static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) { return __Pyx_Coroutine_Throw(self->coroutine, args); } static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, CYTHON_UNUSED PyObject *arg) { return __Pyx_Coroutine_Close(self->coroutine); } static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) { Py_INCREF(self); return self; } #if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_CoroutineAwait_no_new(CYTHON_UNUSED PyTypeObject *type, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwargs) { PyErr_SetString(PyExc_TypeError, "cannot instantiate type, use 'await coroutine' instead"); return NULL; } #endif static PyMethodDef __pyx_CoroutineAwait_methods[] = { {"send", (PyCFunction) __Pyx_CoroutineAwait_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_CoroutineAwait_Close, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")}, {0, 0, 0, 0} }; static PyTypeObject __pyx_CoroutineAwaitType_type = { PyVarObject_HEAD_INIT(0, 0) "coroutine_wrapper", sizeof(__pyx_CoroutineAwaitObject), 0, (destructor) __Pyx_CoroutineAwait_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, PyDoc_STR("A wrapper object implementing __await__ for coroutines."), (traverseproc) __Pyx_CoroutineAwait_traverse, (inquiry) __Pyx_CoroutineAwait_clear, 0, 0, __Pyx_CoroutineAwait_self, (iternextfunc) __Pyx_CoroutineAwait_Next, __pyx_CoroutineAwait_methods, 0 , 0 , 0, 0, 0, 0, 0, 0, 0, #if !CYTHON_COMPILING_IN_PYPY __Pyx_CoroutineAwait_no_new, #else 0, #endif 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; #if PY_VERSION_HEX < 0x030500B1 || defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) { __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_CoroutineAwaitType); if (unlikely(!await)) return NULL; Py_INCREF(coroutine); await->coroutine = coroutine; PyObject_GC_Track(await); return (PyObject*)await; } #endif #if PY_VERSION_HEX < 0x030500B1 static PyObject *__Pyx_Coroutine_await_method(PyObject *coroutine, CYTHON_UNUSED PyObject *arg) { return __Pyx__Coroutine_await(coroutine); } #endif #if defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) { if (unlikely(!coroutine || !__Pyx_Coroutine_Check(coroutine))) { PyErr_SetString(PyExc_TypeError, "invalid input, expected coroutine"); return NULL; } return __Pyx__Coroutine_await(coroutine); } #endif static PyObject * __Pyx_Coroutine_get_frame(CYTHON_UNUSED __pyx_CoroutineObject *self, CYTHON_UNUSED void *context) { Py_RETURN_NONE; } #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1 static PyObject *__Pyx_Coroutine_compare(PyObject *obj, PyObject *other, int op) { PyObject* result; switch (op) { case Py_EQ: result = (other == obj) ? Py_True : Py_False; break; case Py_NE: result = (other != obj) ? Py_True : Py_False; break; default: result = Py_NotImplemented; } Py_INCREF(result); return result; } #endif static PyMethodDef __pyx_Coroutine_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next iterated value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")}, #if PY_VERSION_HEX < 0x030500B1 {"__await__", (PyCFunction) __Pyx_Coroutine_await_method, METH_NOARGS, (char*) PyDoc_STR("__await__() -> return an iterator to be used in await expression.")}, #endif {0, 0, 0, 0} }; static PyMemberDef __pyx_Coroutine_memberlist[] = { {(char *) "cr_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being awaited, or None")}, {(char*) "cr_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Coroutine_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the coroutine"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the coroutine"), 0}, {(char *) "cr_frame", (getter)__Pyx_Coroutine_get_frame, NULL, (char*) PyDoc_STR("Frame of the coroutine"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_ASYNC_SLOTS static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async = { __Pyx_Coroutine_await, 0, 0, }; #endif static PyTypeObject __pyx_CoroutineType_type = { PyVarObject_HEAD_INIT(0, 0) "coroutine", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, #if CYTHON_USE_ASYNC_SLOTS &__pyx_Coroutine_as_async, #else 0, #endif 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, #if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1 __Pyx_Coroutine_compare, #else 0, #endif offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, 0, __pyx_Coroutine_methods, __pyx_Coroutine_memberlist, __pyx_Coroutine_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_Coroutine_init(void) { __pyx_CoroutineType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_CoroutineType = __Pyx_FetchCommonType(&__pyx_CoroutineType_type); if (unlikely(!__pyx_CoroutineType)) return -1; #ifdef __Pyx_IterableCoroutine_USED if (unlikely(__pyx_IterableCoroutine_init() == -1)) return -1; #endif __pyx_CoroutineAwaitType = __Pyx_FetchCommonType(&__pyx_CoroutineAwaitType_type); if (unlikely(!__pyx_CoroutineAwaitType)) return -1; return 0; } /* GetAwaitIter */ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) { #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(o)) { return __Pyx_NewRef(o); } #endif return __Pyx__Coroutine_GetAwaitableIter(o); } static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) { #if PY_VERSION_HEX >= 0x030600B3 || defined(_PyErr_FormatFromCause) _PyErr_FormatFromCause( PyExc_TypeError, "'async for' received an invalid object " "from __anext__: %.100s", Py_TYPE(source)->tp_name); #elif PY_MAJOR_VERSION >= 3 PyObject *exc, *val, *val2, *tb; assert(PyErr_Occurred()); PyErr_Fetch(&exc, &val, &tb); PyErr_NormalizeException(&exc, &val, &tb); if (tb != NULL) { PyException_SetTraceback(val, tb); Py_DECREF(tb); } Py_DECREF(exc); assert(!PyErr_Occurred()); PyErr_Format( PyExc_TypeError, "'async for' received an invalid object " "from __anext__: %.100s", Py_TYPE(source)->tp_name); PyErr_Fetch(&exc, &val2, &tb); PyErr_NormalizeException(&exc, &val2, &tb); Py_INCREF(val); PyException_SetCause(val2, val); PyException_SetContext(val2, val); PyErr_Restore(exc, val2, tb); #else source++; #endif } static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) { PyObject *res; #if CYTHON_USE_ASYNC_SLOTS __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj); if (likely(am && am->am_await)) { res = (*am->am_await)(obj); } else #endif #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact) if (PyCoro_CheckExact(obj)) { return __Pyx_NewRef(obj); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE) if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) { return __Pyx_NewRef(obj); } else #endif { PyObject *method = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, __pyx_n_s_await, &method); if (likely(is_method)) { res = __Pyx_PyObject_CallOneArg(method, obj); } else if (likely(method)) { res = __Pyx_PyObject_CallNoArg(method); } else goto slot_error; Py_DECREF(method); } if (unlikely(!res)) { __Pyx_Coroutine_AwaitableIterError(obj); goto bad; } if (unlikely(!PyIter_Check(res))) { PyErr_Format(PyExc_TypeError, "__await__() returned non-iterator of type '%.100s'", Py_TYPE(res)->tp_name); Py_CLEAR(res); } else { int is_coroutine = 0; #ifdef __Pyx_Coroutine_USED is_coroutine |= __Pyx_Coroutine_Check(res); #endif #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact) is_coroutine |= PyCoro_CheckExact(res); #endif if (unlikely(is_coroutine)) { /* __await__ must return an *iterator*, not a coroutine or another awaitable (see PEP 492) */ PyErr_SetString(PyExc_TypeError, "__await__() returned a coroutine"); Py_CLEAR(res); } } return res; slot_error: PyErr_Format(PyExc_TypeError, "object %.100s can't be used in 'await' expression", Py_TYPE(obj)->tp_name); bad: return NULL; } /* CoroutineYieldFrom */ static PyObject* __Pyx__Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source) { PyObject *retval; PyObject *source_gen = __Pyx__Coroutine_GetAwaitableIter(source); if (unlikely(!source_gen)) { return NULL; } if (__Pyx_Coroutine_Check(source_gen)) { retval = __Pyx_Generator_Next(source_gen); } else { #if CYTHON_USE_TYPE_SLOTS retval = Py_TYPE(source_gen)->tp_iternext(source_gen); #else retval = PyIter_Next(source_gen); #endif } if (retval) { gen->yieldfrom = source_gen; return retval; } Py_DECREF(source_gen); return NULL; } static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) { PyObject *retval; if (__Pyx_Coroutine_Check(source)) { if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) { PyErr_SetString( PyExc_RuntimeError, "coroutine is being awaited already"); return NULL; } retval = __Pyx_Generator_Next(source); #ifdef __Pyx_AsyncGen_USED } else if (__pyx_PyAsyncGenASend_CheckExact(source)) { retval = __Pyx_async_gen_asend_iternext(source); #endif } else { return __Pyx__Coroutine_Yield_From_Generic(gen, source); } if (retval) { Py_INCREF(source); gen->yieldfrom = source; } return retval; } /* ReturnWithStopIteration */ static void __Pyx__ReturnWithStopIteration(PyObject* value) { PyObject *exc, *args; #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_PYSTON __Pyx_PyThreadState_declare if ((PY_VERSION_HEX >= 0x03030000 && PY_VERSION_HEX < 0x030500B1) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { args = PyTuple_New(1); if (unlikely(!args)) return; Py_INCREF(value); PyTuple_SET_ITEM(args, 0, value); exc = PyType_Type.tp_call(PyExc_StopIteration, args, NULL); Py_DECREF(args); if (!exc) return; } else { Py_INCREF(value); exc = value; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign #if CYTHON_USE_EXC_INFO_STACK if (!__pyx_tstate->exc_info->exc_type) #else if (!__pyx_tstate->exc_type) #endif { Py_INCREF(PyExc_StopIteration); __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL); return; } #endif #else args = PyTuple_Pack(1, value); if (unlikely(!args)) return; exc = PyObject_Call(PyExc_StopIteration, args, NULL); Py_DECREF(args); if (unlikely(!exc)) return; #endif PyErr_SetObject(PyExc_StopIteration, exc); Py_DECREF(exc); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { (void)inplace; (void)zerodivision_check; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long x; long b = PyInt_AS_LONG(op2); x = (long)((unsigned long)a - b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif const digit* digits = ((PyLongObject*)op2)->ob_digit; const Py_ssize_t size = Py_SIZE(op2); if (likely(__Pyx_sst_abs(size) <= 1)) { b = likely(size) ? digits[0] : 0; if (size == -1) b = -b; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; double b = PyFloat_AS_DOUBLE(op2); double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } /* pop */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { if (Py_TYPE(L) == &PySet_Type) { return PySet_Pop(L); } return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); } return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); } #endif /* PyFloatBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { const double b = floatval; double a, result; (void)inplace; (void)zerodivision_check; if (likely(PyFloat_CheckExact(op1))) { a = PyFloat_AS_DOUBLE(op1); } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); switch (size) { case 0: a = 0.0; break; case -1: a = -(double) digits[0]; break; case 1: a = (double) digits[0]; break; case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; } } CYTHON_FALLTHROUGH; case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; } } CYTHON_FALLTHROUGH; case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; } } CYTHON_FALLTHROUGH; default: #else { #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; } } else { return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } PyFPE_START_PROTECT("subtract", return NULL) result = a - b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* py_abs */ #if CYTHON_USE_PYLONG_INTERNALS static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { if (likely(Py_SIZE(n) == -1)) { return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]); } #if CYTHON_COMPILING_IN_CPYTHON { PyObject *copy = _PyLong_Copy((PyLongObject*)n); if (likely(copy)) { __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); } return copy; } #else return PyNumber_Negative(n); #endif } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; itp_name); } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; if (likely(iternext)) { #if CYTHON_USE_TYPE_SLOTS next = iternext(iterator); if (likely(next)) return next; #if PY_VERSION_HEX >= 0x02070000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; #endif #else next = PyIter_Next(iterator); if (likely(next)) return next; #endif } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } #if !CYTHON_USE_TYPE_SLOTS else { next = PyIter_Next(iterator); if (likely(next)) return next; } #endif return __Pyx_PyIter_Next2Default(defval); } /* None */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { Py_ssize_t q = a / b; Py_ssize_t r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* SliceTupleAndList */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { Py_ssize_t start = *_start, stop = *_stop, length = *_length; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; else if (stop > length) stop = length; *_length = stop - start; *_start = start; *_stop = stop; } static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { PyObject* dest; Py_ssize_t length = PyList_GET_SIZE(src); __Pyx_crop_slice(&start, &stop, &length); if (unlikely(length <= 0)) return PyList_New(0); dest = PyList_New(length); if (unlikely(!dest)) return NULL; __Pyx_copy_object_array( ((PyListObject*)src)->ob_item + start, ((PyListObject*)dest)->ob_item, length); return dest; } static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { PyObject* dest; Py_ssize_t length = PyTuple_GET_SIZE(src); __Pyx_crop_slice(&start, &stop, &length); if (unlikely(length <= 0)) return PyTuple_New(0); dest = PyTuple_New(length); if (unlikely(!dest)) return NULL; __Pyx_copy_object_array( ((PyTupleObject*)src)->ob_item + start, ((PyTupleObject*)dest)->ob_item, length); return dest; } #endif /* PyIntCompare */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = Py_SIZE(op1); const digit* digits = ((PyLongObject*)op1)->ob_digit; if (intval == 0) { if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } else if (intval < 0) { if (size >= 0) Py_RETURN_FALSE; intval = -intval; size = -size; } else { if (size <= 0) Py_RETURN_FALSE; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( PyObject_RichCompare(op1, op2, Py_EQ)); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* SetItemInt */ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return -1; PyErr_Clear(); } } return m->sq_ass_item(o, i, v); } } #else #if CYTHON_COMPILING_IN_PYPY if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) #else if (is_list || PySequence_Check(o)) #endif { return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (unlikely(!r)) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* PyObjectGetAttrStrNoError */ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; } /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_3); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* PatchInspect */ static PyObject* __Pyx_patch_inspect(PyObject* module) { #if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT) static int inspect_patched = 0; if (unlikely((!inspect_patched) && module)) { module = __Pyx_Coroutine_patch_module( module, "" "old_types = getattr(_module.isgenerator, '_cython_generator_types', None)\n" "if old_types is None or not isinstance(old_types, set):\n" " old_types = set()\n" " def cy_wrap(orig_func, type=type, cython_generator_types=old_types):\n" " def cy_isgenerator(obj): return type(obj) in cython_generator_types or orig_func(obj)\n" " cy_isgenerator._cython_generator_types = cython_generator_types\n" " return cy_isgenerator\n" " _module.isgenerator = cy_wrap(_module.isgenerator)\n" "old_types.add(_cython_generator_type)\n" ); inspect_patched = 1; } #else if ((0)) return __Pyx_Coroutine_patch_module(module, NULL); #endif return module; } /* PatchAsyncIO */ static PyObject* __Pyx_patch_asyncio(PyObject* module) { #if PY_VERSION_HEX < 0x030500B2 &&\ (defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED)) &&\ (!defined(CYTHON_PATCH_ASYNCIO) || CYTHON_PATCH_ASYNCIO) PyObject *patch_module = NULL; static int asyncio_patched = 0; if (unlikely((!asyncio_patched) && module)) { PyObject *package; package = __Pyx_Import(__pyx_n_s_asyncio_coroutines, NULL, 0); if (package) { patch_module = __Pyx_Coroutine_patch_module( PyObject_GetAttrString(package, "coroutines"), "" "try:\n" " coro_types = _module._COROUTINE_TYPES\n" "except AttributeError: pass\n" "else:\n" " if _cython_coroutine_type is not None and _cython_coroutine_type not in coro_types:\n" " coro_types = tuple(coro_types) + (_cython_coroutine_type,)\n" " if _cython_generator_type is not None and _cython_generator_type not in coro_types:\n" " coro_types = tuple(coro_types) + (_cython_generator_type,)\n" "_module._COROUTINE_TYPES = coro_types\n" ); } else { PyErr_Clear(); package = __Pyx_Import(__pyx_n_s_asyncio_tasks, NULL, 0); if (unlikely(!package)) goto asyncio_done; patch_module = __Pyx_Coroutine_patch_module( PyObject_GetAttrString(package, "tasks"), "" "if hasattr(_module, 'iscoroutine'):\n" " old_types = getattr(_module.iscoroutine, '_cython_coroutine_types', None)\n" " if old_types is None or not isinstance(old_types, set):\n" " old_types = set()\n" " def cy_wrap(orig_func, type=type, cython_coroutine_types=old_types):\n" " def cy_iscoroutine(obj): return type(obj) in cython_coroutine_types or orig_func(obj)\n" " cy_iscoroutine._cython_coroutine_types = cython_coroutine_types\n" " return cy_iscoroutine\n" " _module.iscoroutine = cy_wrap(_module.iscoroutine)\n" " if _cython_coroutine_type is not None:\n" " old_types.add(_cython_coroutine_type)\n" " if _cython_generator_type is not None:\n" " old_types.add(_cython_generator_type)\n" ); } Py_DECREF(package); if (unlikely(!patch_module)) goto ignore; asyncio_done: PyErr_Clear(); asyncio_patched = 1; #ifdef __Pyx_Generator_USED { PyObject *inspect_module; if (patch_module) { inspect_module = PyObject_GetAttr(patch_module, __pyx_n_s_inspect); Py_DECREF(patch_module); } else { inspect_module = __Pyx_Import(__pyx_n_s_inspect, NULL, 0); } if (unlikely(!inspect_module)) goto ignore; inspect_module = __Pyx_patch_inspect(inspect_module); if (unlikely(!inspect_module)) { Py_DECREF(module); module = NULL; } Py_XDECREF(inspect_module); } #else if ((0)) return __Pyx_patch_inspect(module); #endif } return module; ignore: PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch asyncio package with custom generator type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else if ((0)) return __Pyx_patch_inspect(__Pyx_Coroutine_patch_module(module, NULL)); #endif return module; } /* Globals */ static PyObject* __Pyx_Globals(void) { Py_ssize_t i; PyObject *names; PyObject *globals = __pyx_d; Py_INCREF(globals); names = PyObject_Dir(__pyx_m); if (!names) goto bad; for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { #if CYTHON_COMPILING_IN_PYPY PyObject* name = PySequence_ITEM(names, i); if (!name) goto bad; #else PyObject* name = PyList_GET_ITEM(names, i); #endif if (!PyDict_Contains(globals, name)) { PyObject* value = __Pyx_GetAttr(__pyx_m, name); if (!value) { #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif goto bad; } if (PyDict_SetItem(globals, name, value) < 0) { #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif Py_DECREF(value); goto bad; } } #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif } Py_DECREF(names); return globals; bad: Py_XDECREF(names); Py_XDECREF(globals); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } /* CyFunctionClassCell */ static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) { Py_ssize_t i, count = PyList_GET_SIZE(cyfunctions); for (i = 0; i < count; i++) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyList_GET_ITEM(cyfunctions, i); #else PySequence_ITEM(cyfunctions, i); if (unlikely(!m)) return -1; #endif Py_INCREF(classobj); m->func_classobj = classobj; #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF((PyObject*)m); #endif } return 0; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the generator"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the generator"), 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) "generator", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, 0, offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, (iternextfunc) __Pyx_Generator_Next, __pyx_Generator_methods, __pyx_Generator_memberlist, __pyx_Generator_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_Generator_init(void) { __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); if (unlikely(!__pyx_GeneratorType)) { return -1; } return 0; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */